Are there any existing native libraries (not whole wallets, I do not need a UI but want to sign transactions and call smart contract functions embedded in another app) for iOS or Android? If not, are there efforts currently ongoing or what is the closest I could get right now?
4 Answers
There are some guys who are running geth on Android and iOS. you could find the libs and the apk project. But seriously, you need to wait the light protocol client because it is a bit insane to use a full client (Many Go of storage + so many writes that it will use battery and storage longevity).
Look this:
Android
- Ethereum on Android: https://www.reddit.com/r/ethereum/comments/3wx09s/experimental_android_geth_library_archive/
- LES (Light client protocol): https://github.com/ethereum/wiki/wiki/Light-client-protocol
- Karalabe (one dev of geth): What can I use to interact with the Ethereum network from an Android device?
The geth with LES is in test currently. I have made few benchmarks:
- 600MB disk storage (4GB of write) vs 4.8GB for fast synch
- 20min to synchronize vs 21min for fast synch
iOS
- Native implementation on Swift of
geth
functionality: web3swift
There is Nethereum which is a .Net client for Ethereum.
You can use Xamarin (comes free with VS now) to build Android, iOS and Windows apps through the .Net framework.
Github link - https://github.com/Nethereum/Nethereum
(Note: I haven't done any mobile development for a while, and certainly none related to Ethereum. The below answer therefore includes a level of conjecture. I don't know of any existing efforts.)
Android apps are (most often) written in Java, so it's plausible that the relevant parts of EthereumJ could be ported with relatively little pain.
It's also been possible to write Android apps in Go since (Go) version 1.4, though I'm unsure how well supported this is. It does, however, raise the possibility of a Geth port, or partial port. Similarly, looking at Go's available mobile packages, it looks like iOS support is also there.
Edit:
Or I could have just Googled... (Thanks Ellis for the prod.)
This entry on the official GitHub repo describes how to perform an Android-Geth port, and references the more general Ethereum cross compilation page. From there, the xgo README has some further details of building mobile libraries.
I can't immediately see any pre-built libraries/images.
-
There are some guys who are running geth on Android and iOS. you could find the libs and the apk project.– EllisCommented Jun 28, 2016 at 22:11
web3j now provides a Android release for working with Ethereum nodes. web3j is a lightweight Java library that provides full support for Ethereum's JSON-RPC API and transaction signing.
It also provides generation of smart-contract wrappers for deploying, transacting and calling smart contracts.
You need to run your own client, or use a cloud-based service like Infura to work with it.
As mentioned by Richard, the Geth team also provide a pre-built Android binary now. This is built using gomobile, rather than being a pure Java implementation like web3j.
-
That seems like just another wrapper for a full node. Don't see how this can natively sign transactions. Commented Dec 19, 2016 at 22:10
-
See documentation at docs.web3j.io/transactions.html#offline-transaction-signing Commented Dec 19, 2016 at 23:32