you're reading...
Blockchain, Development, Ethereum, Java, web3j

web3j Android port now available for Ethereum

After announcing the 1.0 milestone of web3j, it was clear that there was demand for an Android port of web3j.

As of the latest release - 1.0.5 of web3j, I am publishing Java 1.6 (i.e. Android) compatible releases. The first Android release is available here, and the artefacts are available on JFrog's Bintray and Maven's Nexus repositories:

compile ('org.web3j:core-android:1.0.5')

The API is nearly identical to the existing API, with one small difference - you need to use a Web3jFactory to create your client instance:

Web3j web3 = Web3jFactory.build(new HttpService());  // defaults to http://localhost:8545/

You can use the web3j command line tools for generating your smart contract wrappers (the generated code is also Android compatible).

For further release notes, please head to the 1.0.5-android release page.


2 Responses to “web3j Android port now available for Ethereum”

  1. Was trying web3j api of core-1.0.7 jar in java to access ethereum node using below snippet of code but HttpService is not getting imported though class available in jar

    Web3j web3 = Web3j.build((Web3jService) new HttpService()}; // defaults to ..

    what is the reason for it

    Posted by svprasad | 22/11/2016, 19:10
  2. The imports you require are:

    import org.web3j.protocol.http.HttpService;
    import org.web3j.protocol.Web3j;

    Then you should be good to go.

    Posted by conor | 22/11/2016, 21:23

Leave a Comment

Your email address will not be published. Required fields are marked *