I want to access my smart contract through a mobile app, which is on my private network. There is ethereum android app, can I connect that app to my ethereum network or if there any other app through which I can access my smart contract on the private network.

  • Did you get any idea about it? – vijju Apr 7 '18 at 3:33
  • i did not get any ideas. – Anand Kumar Jun 1 '18 at 11:48

First of all let’s think about the mobile app as a client. The client running web3 needs to connect to a node. This node is brought by a Provider, whether HTTP, WebSocket or IPC. The provider defines the remote node and port.

What you need to do is basically running a node on your server using geth or parity for example OR use a node provided by Infura. Then in the mobile app, provide the node address and inject that provider into the web3 instance. Then you’ll have a successful connection.

That’s ideal, but it comes with challenges. Like managing the user’s private keys. This will be your responsibility in the app, to secure and encrypt those keys. Also you need to provide a way to backup/restore keys. Private keys are needed to sign raw transactions sent to the blockchain.

Now what we only need to finally answer your question is what framework should you use on Android to do this task? Luckily someone was brave enough to work on a java based web3 library called web3j: https://github.com/web3j/web3j

Let me know if you need more details!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.