How to create an Ethereum wallet (Keystore JSON file) in android using org.web3j:core:3.3.1-android (web3j library). Please guide me to create one.

1 Answer 1


Using https://github.com/web3j/web3j you can create JSON wallet file in your android external directory.

Android code to create a wallet JSON file in Downloads directory.

        public class Wallet {

// Create new wallet
public String createWallet() throws Exception {
    String path = Environment.getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS).getPath();
    String fileName = WalletUtils.generateLightNewWalletFile("password", new File(path));
    return path + fileName;

/* Load the new wallet file once it is created
*  Replace the File path with newly created wallet file path 
public Credentials loadCredentials(String password) throws Exception {
    Credentials credentials = WalletUtils.loadCredentials(
    Log.i("Loading credentials", "Credentials loaded");
    return credentials;

Check https://github.com/subhodi/android-web3-lightwallet repo for creating a wallet, loading wallet, sending raw transaction, Deploy, write, query smart contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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