Want to Build a Simple Android app with ‘Login/Register and Social Connects’ using Identity Network API? Here’s How!

Building an Android application and launching it into the market might take a lot of time, and if you are a first timer at building an app, it might take even longer. Have you ever wondered if there was a solution simpler and more effective? If you have, we have some news for you! You can quickly set up user registration along with user authentication on your Android app using our pre-built SDK. With WaveLabs IDN(Identity Network), we intend to solve the pain of integrating social logins and the traditional email-password logins.

Even for a pro, it takes around 12 hours or more to integrate Facebook login, and to be honest, half of the time goes into comprehending the documentation. Similarly, for Google, Twitter and other social logins too, it takes the same amount of time. With no proper or reliable results, our turmoil only increases.

We have pre-built SDKs for iOS, Android, Angular, PHP, and Ruby on Rails. Right now, we support the traditional login along with Facebook, Google, Instagram, LinkedIn, AccountKit and all of them in one SDK only. This tutorial is a technical walkthrough to integrate our IDN with your Android app.

To get started with building an Android application using our starter code, simply do the following steps:

1. Git clone your project.

2. Import your project into the Android Studio.

3. Use res/values/strings.xml file to replace the existing the tenant with your own tenant or use the existing sample tenant to try it out.

4. Run your project.

If you have a tenant of your own, you could play around with our SDKs. Here’s how:

Our Android SDK is a client library that can be imported in Android Apps for building an app. Without using the database, you can manage login, registration, authentication, authorization and many more features.

Pre-requisite

Android Studio >= 2.1.3
JDK >= 1.8

Take a look at the couple of steps that you’ll need to integrate

1. Import the SDK library

2. Configure the application

3. Initialize the SDK

4. Launch your application

1. Import SDK Library

The SDK is available both in Maven Central and JCenter. To start using it, add the following lines to your build.gradle dependencies file.

compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'in.wavelabs.idn:idn:0.2.8'

2. Configure the Application

Login to nbos.in/app  and get the client id and secret for your app (aka App of Tenant).
Place those credentials in AndroidManifest.xml inside the application tag.

<meta-data android:name="in.wavelabs.idn.WAVELABS_CLIENT_ID"
android:value="@string/wavelabs_app_id" />
<meta-data android:name="in.wavelabs.idn.WAVELABS_CLIENT_SECRET"
android:value="@string/wavelabs_app_secret" />

In strings.xml

<string name="wavelabs_app_id">[REPLACE_WITH_YOUR_WAVELABS_APP_ID]</string>
<string name="wavelabs_app_secret">[REPLACE_WITH_YOUR_WAVELABS_APP_SECRET]</string>

In Manifest file

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

In assets/config.properties

configure your hosts for your tenant modules

module.identity.host=http://api.qa1.nbos.in/
module.media.host=http://api.qa1.nbos.in/

3. Initialize the SDK

^377BE3EE33B1E968D82D25F1C8421B086BECFED300D4A9E69F^pimgpsh_fullsize_distr

Add the following code in the Activity or Application class

^0F9C7A26BEFC0FA897E75BB32C05483EB55CF02D646BDDBF99^pimgpsh_fullsize_distr

StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
AndroidApiContext.initialize(getApplicationContext());
Screenshot_1468504144

Also, our sample code for the starter application is available at https://gitlab.com/wavelabs/idn-app-android

Feel free to play around with it!

That’s it! You are all set to launch your Android app into the market. Attract customers, generate profits, and more importantly, create a space that is uniquely yours. The possibilities are simply endless!

If you have any questions about it, please feel free to get in touch with me.