Getting Started

First, add jitpack to your root gradle file at the end of repositories:

allprojects {
    repositories {
    ...
        maven { url 'https://jitpack.io'}
    }
}

Adding Tron Client SDK as a Maven Dependency

Maven:

<dependency>
        <groupId>com.github.centerprime</groupId>
        <artifactId>Tron-Client-SDK</artifactId>
        <version>1.0.6</version>
</dependency>

Gradle:

dependencies {
      implementation 'com.github.centerprime:Tron-Client-SDK:1.0.6'
}

Basic Usage

Once you have the dependencies set up you can start using CenterPrime by creating a Tron Wallet:


public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TronWalletManager tronWalletManager = TronWalletManager.getInstance();
        tronWalletManager.init(this);

        tronWalletManager.createWallet("{{wallet_password}}", this)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(wallet -> {
                    String walletAddress = wallet.getAddress();
                    String keystore = wallet.getKeystore();

                }, error -> {
                    System.out.println(error);
                });
    }
}