Skip to content

frslabs/atlas-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

ATLAS SDK (ANDROID)

android version

ATLAS SDK is used to capture all types of location, document, face, aadhaar, data, video, email, phone, consent, video declaration.

You can find the latest changelog at Changelog.

Table Of Content

Set Up Atlas SDK

Requirements

Make sure that your project meets these requirements:

  • Uses API Level 21 or above as Minimum SDK Version
  • Uses Gradle 7.3 or later
  • Uses Jetpack (AndroidX)

Download Atlas SDK

Add the following code to your project level build.gradle file

allprojects {
    repositories {

        //Maven credentials for the Atlas SDK
        ['atlas-sdk-android'].each { value->
            maven {
                url "https://www.repo2.frslabs.space/repository/${value}/"
                credentials {
                    username '<YOUR_USERNAME>' 
                    password '<YOUR_PASSOWRD>' 
                }
            }
        }
    }
}

Importing Atlas SDK

Add the following code to your app-level build.gradle file

android {

    // ...

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    // ...

}

And then, add the dependencies

// ...

dependencies {
    
    /*
     * Android Dependencies used by Atlas SDK
     */
    implementation 'androidx.appcompat:appcompat:<latest verison>'
    implementation 'com.google.android.material:material:<latest verison>' 
    implementation 'androidx.constraintlayout:constraintlayout:<latest verison>'

    /*
     * Atlas SDK Core Dependency
     */
    implementation 'com.frslabs.android.sdk:atlas:<latest version>'
}

Quick Start

Initialise and run the Atlas SDK

Initialize an instance of Atlas with the appropriate parameters, and call start() to invoke the Atlas SDK. Refer Atlas SDK API for more information regarding the individual APIs.

Given below is the fully configured Atlas SDK invokation.

  class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_main)
      callAtlasSdk()
    }
  
    private fun callAtlasSdk() {
    val atlasConfig = AtlasConfig.Builder()
                .setCheckId("<CHECK_ID>")
                .setUrlId(AtlasUrlType.STAGING) // OPTIONAL: Set environments
                .build()
  
      val atlas = Atlas(atlasConfig)
  
      atlas.start(this, object : AtlasResultCallback {
        override fun onSuccess(atlasResult: String) {
          //CAPTURE SUCCESSFULLY
        }
  
        override fun onFailure(code: Int, message: String) {
          Toast.makeText(this@MainActivity,"Failure",Toast.LENGTH_LONG).show()
        }
      })
    }
  }

Atlas Error Codes

Following error codes will be returned on the onError method of the callback

CODE DESCRIPTION
506 No internet connection
507 Failed to retrieve data
508 Invalid settings
509 Permission denied

Atlas SDK API

See the below table for the public APIs of Atlas SDK,

Atlas
Method/Constructor Comments
Atlas(AtlasConfig atlasConfig) Instantiates the Atlas Object
start(Context activityContext, AtlasResultCallback atlasResultCallback) Starts the Atlas SDK
AtlasConfig

AtlasConfig.Builder() allows to instantiate the AtlasConfig object with customisable features. AtlasConfig is to be set when instantiating Atlas object , See Atlas

Method Default Required Comments
setCheckId(String checkId) NULL Yes Sets the check id needed for Atlas SDK
setUrlId(AtlasUrlType atlasUrlType) AtlasUrlType.PRODUCTION Optional If it is STAGING then it'll use STAGING base url
build() - - Builds AtlasConfig Instance

Help

For any queries/feedback , contact us at [email protected]

About

Mobile solution for Altas flows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published