How can dapps on mobile web browsers interact with web3.js?
Is there any tool like Metamask or Mist on the roadmap for mobile?
Status is a good start to develop a Ethereum mobile dapp.
Status is an open source messaging platform and mobile browser to interact with decentralized applications that run on the Ethereum Network.
Decentralized Apps at your fingertips: With Status your mobile device becomes a light client node on the Ethereum Network, enabling you to access Ethereum’s entire ecosystem from anywhere.
Smarter private messaging: Status is more than a messenger. Send payments and smart contracts to friends from within chats, and enjoy encrypted messaging by default, using a peer-to-peer protocol that doesn’t rely on centralized servers.
Status app (Ethereum Mobile gateway) is currently in alpha and can be tested on Android and iPhone.
Please find below a quick tutorial how to deploy a dapp on Status.Let's imagine you have a dapp (ReactNative, Ionic, ...) running on {DAPP_URL}
Download Status on your phone and configure an account
Install status-dev-cli npm i -g status-dev-cli
In status console, enter /debug
. That will give you your device IP address {DEVICE_IP}
From your machine, make sure you can see you device and status: status-dev-cli scan
(status must be running)
Last step, consist in registering the dapp in status: status-dev-cli add "{\"whisper-identity\": \"my-dapp\", \"dapp-url\": \"{DAPP_URL}\", \"name\": \"MyDAPP\"}" --ip {DEVICE_IP}
You can now refresh you status app and you will see appear MyDapp in the list. The browser will launch you dapp and it can interact (web3) with the Ethereum blockchain and smart contracts.
By default, status run on the testnet network. You can switch to another node (private, testrpc or mainnet) with the following command status-dev-cli switch-node {NODE_URL} --ip {DEVICE_IP}
Documentation: Here
Some examples: Me and other devs have recently attended to the Status hackaton. This blog post (Winners Announcement) will illustrate some of the projects developed in a one-week period.
Trust Wallet is an open-source iOS app that provides a mobile experience for dApps. It's available both on iOS and Android.
As a based you have a wallet for handling key securely locally on the phone, since you need to have a private key in order to communicate with a blockchain.
Trust has a Browser feature which is injecting JavaScript web3 provider to handle sign transaction and messages.
To learn how this being implemented you can check out source code: https://github.com/TrustWallet/trust-wallet-ios
I would recommend using light client Android and iOS API available from go-ethereum project. As ethereum now supports light client go-ethereum developers have created API for Android and iOS and can be cross compiled using make android
or make ios
on go-ethereum source code.
If you don't want to compile the code, you can even include go-ethereum client as maven dependency.
repositories {
mavenCentral()
}
dependencies {
// All your previous dependencies
compile 'org.ethereum:geth:1.5.2' // Change the version to the latest release
}
If you don't want to include dependency, try downloading the bundle(.aar) and importing it to your project.
Above procedure will help you program your app completely in java, but even now if you want to use web3j you can hack the go-ethereum source to enable RPC in your android node and interact with that using JSON-API.
If you don't want to require your users to download dapp browsers or a chrome extension. You can try this project called Fortmatic I've recently come across. Your users will be able to interact with your dapp through browsers they are already familiar with on mobile (Safari, Firefox and Chrome).
I just got into the alpha and started playing around with it, docs seems pretty clean and if your app already works with web3, you should be able to get it working pretty seamlessly.
The Tasit SDK is an open-source JavaScript SDK for making standalone native mobile Ethereum dapps using React Native.
Use the same web3js and you can use infura as the Web3 provider. Using react or ionic this can enable you to write mobile apps that interact with your smart contract