How to Integrate SAWO SDK to an Android app

Related tags

SDK SAWO-SDK
Overview

How to Integrate SAWO SDK to an Android app

  1. Add following line to root build.gradle repositories block

    maven { url 'https://jitpack.io' }
  2. Add this to your app level build.gradle android block

       compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    
        kotlinOptions {
            jvmTarget = '1.8'
        }
  3. Add this to your app level build.gradle dependencies block

        implementation 'com.github.sawolabs:Android-SDK:0.1.8'
  4. Sync your project

  5. Go to https://dev.sawolabs.com and create a project and copy the api key and api key secret

  6. Create an Activity in Android Studio to get login success response for this example lets assume it is CallbackActivity

  7. In your MainActivity add a button to login and add following code to its onclick handle

    Java

    import com.sawolabs.androidsdk.Sawo;
    
    public void onClickLogin(View view) {
        new Sawo(
                    this, 
                    "", // your api key
     	   "" // your api key secret
                    ).login(
                    "email", // can be one of 'email' or 'phone_number_sms'
                    CallbackActivity.class.getName()  // Callback class name
            );
    }

    Kotlin

    import com.sawolabs.androidsdk.Sawo
    
    fun onClickLogin(view: View) {
            Sawo(
                this,
                "", // your api key
                "" // your api key secret
            ).login(
                "email", // can be one of 'email' or 'phone_number_sms'
                CallbackActivity::class.java.name // Callback class name
            )
        }
  8. Get the response payload in the CallbackActivity

    Java

    import com.sawolabs.androidsdk.ConstantsKt;
    
    Intent intent = getIntent();
    String message = intent.getStringExtra(ConstantsKt.LOGIN_SUCCESS_MESSAGE);
    
    // continue with your implementation

    Kotlin

    import com.sawolabs.androidsdk.LOGIN_SUCCESS_MESSAGE
    
    val message = intent.getStringExtra(LOGIN_SUCCESS_MESSAGE)
    // continue with your implementation
  9. Recommended: Verify the payload sent by sdk from your backend

    We have created a POST request method with the endpoint:

    https://api.sawolabs.com/api/v1/userverify/
    

    The body of this POST request would have two key-value pairs. The sample is shown below:

    {
       "user_id" : "a0aca1a0-7460-4e8e-8e46-3baf2c92423d",
       "verification_token" : "ADdHrvkgi407qNfnAyrIVqokm3OWdKUCdj8y"
    }
    

    Once the user is verified in our server and if the user is valid it would return the following response with response 200:

    {
       "user_valid": true
    }
    

    if the user is not valid it would return the following response with response 400:

    {
       "user_valid": true
    }
    

    if the user is not found it would return the following response with response 404:

    "User not Found"
    
You might also like...
Android Real Time Chat & Messaging SDK
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Evernote SDK for Android

Evernote SDK for Android version 2.0.0-RC4 Evernote API version 1.25 Overview This SDK wraps the Evernote Cloud API and provides OAuth authentication

Air Native Extension (iOS and Android) for the Facebook mobile SDK

Air Native Extension for Facebook (iOS + Android) This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by Fr

Android Chat SDK built on Firebase
Android Chat SDK built on Firebase

Chat21 is the core of the open source live chat platform Tiledesk.com. Chat21 SDK Documentation Features With Chat21 Android SDK you can: Send a direc

Liquid SDK (Android)

Liquid Android SDK Quick Start to Liquid SDK for Android This document is just a quick start introduction to Liquid SDK for Android. We recommend you

AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

新浪微博 Android SDK

ReadMe 公告: 鉴于线上服务器出现问题,推荐下载本地aar后上传到自己公司的服务器,保证后续服务稳定, 我们也将尽快重新提供一个稳定的地址供大家使用。 新包地址:https://github.com/sinaweibosdk/weibo_android_sdk/tree/master/2019

Official Appwrite Android SDK 💚  🤖
Official Appwrite Android SDK 💚 🤖

Appwrite Android SDK This SDK is compatible with Appwrite server version 0.8.x. For older versions, please check previous releases. Appwrite is an ope

Trackingplan for Android SDK
Trackingplan for Android SDK

With Trackingplan for Android you can make sure that your tracking is going as you planned without changing your current analytics stack or code.

Releases(0.1.10)
Owner
Latiful Mousom
Android Developer
Latiful Mousom
Segmenkt - The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment

SegmenKT Kotlin SDK The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment. I

UNiDAYS 0 Nov 25, 2022
Frogo SDK - SDK Core for Easy Development

SDK for anything your problem to make easier developing android apps

Frogobox 10 Dec 15, 2022
HubSpot Kotlin SDK 🧺 Implementation of HubSpot API for Java/Kotlin in tiny SDK

HubSpot Kotlin SDK ?? Implementation of HubSpot API for Java/Kotlin in tiny SDK

BOOM 3 Oct 27, 2022
This App is sending Face capture data over network, built around the latest Android Arcore SDK.

AndroidArcoreFacesStreaming From any Android phone ArCore compatible, using this app will send over TCP 5680 bytes messages: The first 5616 bytes is a

Maxime Dupart 30 Nov 16, 2022
A sample project of implementing Liveness Detection and Identity OCR on Android app using Kredibel Vision SDK

Vision Sample (Android) A sample project of implementing Liveness Detection and Identity OCR on Android app using Kredibel Vision SDK. You can checkou

null 10 Nov 27, 2022
Android SDK for eyeson video service incl. demo app

eyeson Android SDK Android SDK for eyeson video service incl. demo app Prerequisites A webservice to host and maintain eyeson meetings is required. Th

eyeson 3 Nov 16, 2022
Free forever Marketing SDK with a dashboard for in-app SplashScreen banners with built-in analytics

AdaptivePlus Android SDK AdaptivePlus is the control center for marketing campaigns in mobile applications Requirements minSdkVersion 16 Examples prov

Adaptive.Plus 16 Dec 14, 2021
Its measurement app made using kotlin with sceneform sdk by google

ARCORE MEASUREMENT This app is build using sceneform sdk for android using kotlin language It helps you measure the distance between multiple points i

Kashif Mehmood 39 Dec 9, 2022
AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

AWS Amplify 976 Dec 29, 2022
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Countly Team 648 Dec 23, 2022