Skip to content

HamidQureshi/SDK-Android

Repository files navigation

Activeledger

Activeledger SDK-Android

To use the Android SDK please Add it in your root build.gradle at the end of repositories:

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

Add the dependency

dependencies {
	implementation 'com.github.activeledger:SDK-Android:Tag'
}

For Maven:

<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

Add the dependency

<dependency>
	<groupId>com.github.activeledger</groupId>
	<artifactId>SDK-Android</artifactId>
	<version>Tag</version>
</dependency>

NOTE: Please update the Tag : 0.1.3

SDK Dev Instruction

Use the ActiveLedger SDK interface to Use the SDK.

Initialise the SDK

ActiveLedgerSDK.getInstance().initSDK(this,"protocol","URL","port");
Example:
ActiveLedgerSDK.getInstance().initSDK(this,"http","testnet-uk.activeledger.io","5260");

Generate KeyPair

Generating a KeyPair will give an Observable in return. User RxAndroid to subscribe to the Obserable.

Observable<KeyPair> keyPair = ActiveLedgerSDK.getInstance().generateAndSetKeyPair(KeyType,SaveKeysToFile);
Example:
Observable<KeyPair> keyPair = ActiveLedgerSDK.getInstance().generateAndSetKeyPair(keyType,true);

Oboard KeyPair

Onboarding a KeyPair will give an Observable in return. User RxAndroid to subscribe to the Obserable.

Observable<String> response = ActiveLedgerSDK.getInstance().onBoardKeys(KeyPair, "KeyName");
Example:
ActiveLedgerSDK.getInstance().onBoardKeys(keyPair, "ActiveLedgerAwesomeKey");

Executing a Transaction

Execute method takes a transaction and will give an Observable in return with response in String format. User RxAndroid to subscribe to the Obserable.

Observable<String>  respinse =  ActiveLedgerSDK.getInstance().executeTransaction(String transactionJson);

License


This project is licensed under the MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages