Quick Start
Requirements
- Android OS version: v5.0 (API v21) or higher.
- compileSdkVersion: 31
- targetSdkVersion: 31
- Kotlin: 1.6.21 or higher.
- Android SDK download size ~ 3.5 MB
Important❗
The Metamap SDK uses libraries and in order to avoid any potential production crashes you should use the same versions of the libraries if they exist in your project. The list of the libraries used by each version of MetaMap SDK can be found in the Maven POM File here.
Setup
In your root-level (project-level) Gradle file (/build.gradle),
-
add the reference to the following repository:
buildscript { //.. repositories { //.. mavenCentral() } }
In your module (app-level) Gradle file (usually //build.gradle)
-
enable Java 1.8 source compatibility.
android { //.. compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } //.. }
-
add the dependencie
dependencies { //... implementation ('com.metamap:android-sdk:3.41.2') }
Then sync your project with the gradle files.
Go to your Activity simply call MetamapSdk.startFlow(...)
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main);
//..
MetamapSdk.startFlow(this,"YOUR_CLIENT_ID", "YOUR_FLOW_ID")
}
}
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//..
MetamapSdk.INSTANCE.createFlowIntent(this,"YOUR_CLIENT_ID", "YOUR_FLOW_ID", null, null);
}
}
In order to make this work you need to set your own CLIENT_ID
and FLOW_ID
. You can find them in the Metamap Dashboard, for more details please check this section.
Updated 4 months ago
Now we are ready to call the Metamap SDK in order to do our first verification. There are two options to call the Metamap SDK