MTC Android SDK

Provides API to find all the tokens cardholder owns and to control them.

Installation

It is recommended to use Android Studio and Gradle to build the project.

Requirements

  • Device must be able to connect to the Internet.
  • Android version must be 4.4 (KitKat) or above.

Gradle Configuration

MTC SDK should be added to the project as a dependency. MTC SDK is hosted in a private Maven repository, so you need to configure build.gradle by setting the assigned URL and credentials.

Environments (library flavors):

  • test – test (staging) environment
  • prod – production environment
				
					repositories {
    maven {
        url 'https://nexus-developer.meawallet.com/content/groups/<user>-group'

        credentials {
            username '<user>-user'
            password '<password>'
        }
    }
}

dependencies {
    implementation 'com.meawallet:mtc-<user>-<environment>:<version>'
}				
			

Examples

Debug version:

				
					implementation 'com.meawallet:mtc-mea-test:1.0.0-debug'				
			

Release version:

				
					implementation 'com.meawallet:mtc-mea-test:1.0.0'				
			

App Manifest

No need to specify any permissions for SDK in AndroidManifest.xml file. MTC SDK is using following permissions which are merged with the application manifest file:

				
					<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>				
			

Implementation guide

Overview

com.meawallet.mtc.MeaTokenControl is the main class for interaction with the MTC SDK.

Before you can use the MTC SDK in your application, you must initialize it once during every Application launch using MeaTokenControl.initialize(...) method.

All the Token Control actions can be invoked using following methods: MeaTokenControl.getTokens(...)MeaTokenControl.getTokenStatusHistory(...)MeaTokenControl.suspendToken(...)MeaTokenControl.resumeToken(...) and MeaTokenControl.deleteToken(...).

Initialization

Before you can use the MTC SDK in your application, you must initialize it using MeaTokenControl.initialize(...) method once during every Application launch.

We suggest initializing the MTC library in Application.onCreate() method:

Token Control methods

For all the Token Control APIs MTC SDK support both synchronous and asynchronous invocations:

  • asynchronous (the network call is executed on a background thread and the result returned on the Main/UI thread as a callback)

  • synchronous (executed on the same thread, cannot be used from the Main/UI thread)

Error handling

MtcError is a general MTC error object containing all error info (error code, error name, error message and request Id). MtcError can be returned with onFailure callback or gathered from MtcException object.

Changelog

1.0.1

2020-07-08

ADDEDMtcToken.getTokenRequestorConsumerFacingEntityName() method.

1.0.0

2020-04-01

First stable version of Mea Token Control (MTC) SDK for Android.

On this page