QuickStart for Android

Get sample projects up and running quickly! The sample project included with the SDK is pre-configured and ready to be compiled and run with little configuration required. Please contact us first to obtain credentials for your application.

Min Requirements

• JDK 1.8.181+
• Android Studio 3.2.0+. 

Please try to use only the production builds avoiding preview builds such as Canary or Beta as these may have features that aren't yet supported in the digi.me Android SDK or the example app project

• Development environment to support Android API 21+
• Any Android device with Android 5.0 and above
• Digi.me and a library installed on the Android device

New to Android?

Please see the Android developer guide for help on building apps and other resources.

Get started with the example app

1. Clone the example app with the SDK

Download digi.me SDK with a few example apps to try. The digi.me SDK code repository is stored under GitHub where you can find always the most recent version of SDK with the latest bug fixes and an up to date compatible example app. Clone the repository to your machine to get the SDK and the example apps. Run the following command in the terminal;

git clone https://github.com/digime/digime-android-sdk.git

2. Import project into Android Studio

a. From Android Studio, select "Import Project". This can be found on the window displayed for new projects (as shown below). Or, alternatively, by selecting `File` > `New` > `Import Project...` from Android Studio.

b. Navigate to the cloned project directory, select the repository folder, then click 'ok' to start importing the project to Android Studio

c. Allow the project to complete importing. If shown, please dismiss any prompts to upgrade Gradle for the example app as this may cause compatibility issues.

3. Configure the example app

A demo contract ID and p12 file have already been embedded in the example app for ease of use. The contract selects both Social and Finance data from a digi.me library for a given time period (please contact us if you would like to use a different contract). Add your application ID and p12 password in the build.grade file (digime-android-sdk/examples/consent-access/build.gradle) as shown from the placeholders below:

defaultConfig {
	applicationId "me.digi.examples.ca"
	minSdkVersion buildConfig.minSdk
	targetSdkVersion buildConfig.targetSdk
	versionCode 1
	versionName "1.0"

	 * Consent Access Configuration parameters:
	 * The following lines set parameters necessary for initialization and usage of the CA API (through SDK):
	 * App ID, Contract ID, Private Key file and Private Key file password if any;
	 * These are helper resource constructors which get injected into AndroidManifest.xml
	 * For further details how these are mapped to meta-data used by the SDK, look at AndroidManifest.xml at the section marked with 

	resValue "string", "APP_ID", 
// <- sample: "gDdQfubl66rj07webI92m4afPL9va9Z1" (32 characters hex string given by digi.me support) resValue "string", "P12_KEYSTORE_PASSWORD",
// <- sample: "20ov;p-1Fi3oL" (the password that goes with your private key). You will need to request the key password from dev support if using pre-set contract ID. resValue "string", "CONTRACT_ID", "gzqYsbQ1V1XROWjmqiFLcH2AF1jvcKcg" // <- demo contract ID for testing purposes resValue "string", "P12_KEYSTORE_FILENAME", "CA_RSA_PRIVATE_KEY.p12" // <- demo private key in assets folder, accompanying the demo contract ID }

4. Build and run

Run the example app then create a digi.me library to use with PS. Ensure that the 'Private Sharing' sub project is selected, then with an Android device plugged in, click the 'Run' or 'Debug' icon to start

5. Make it your own

Explore the code! Use the sample app as a base or start a new project using the SDK. For more information about the SDK or how to integrate the SDK into an existing or new project, please check out our GitHub Android SDK documentation.