menu arrow_back close search On Github


  1. Home
  2. Android SDK integration
  3. Setup

Add dependencies

The binaries are included on JCenter, so the SDK can be added by including a line in your build.gradle file for your app.

dependencies {
    // ...
    implementation 'com.telenor.connect:connect-android-sdk:<latest-version>' // add this line

Find latest version here:

You may have to add JCenter as a repository on your top-level build.gradle file if this isn’t done already:

allprojects {
    repositories {

Before using the SDK some entries have to be added to AndroidManifest.xml. See instructions below. The example app also contains a full example of a valid AndroidManifest.xml.

Add client ID and redirect URI

The CONNECT ID integration requires a client ID and a redirect URI to work. You should receive these when registering your application. See Required registration details.

Add the client ID, and redirect URI and scheme to your strings.xml file:

<string name="connect_client_id">telenordigital-connectexample-android</string>
<string name="connect_redirect_uri">telenordigital-connectexample-android://oauth2callback</string>
<string name="connect_redirect_uri_scheme">telenordigital-connectexample-android</string>

Add meta-data entries to the application section of the manifest.

                android:value="@string/connect_client_id" />
                android:value="@string/connect_redirect_uri" />

Register and handle redirect URI

Register redirect URI in Android

Note: If you do not wish to use the Chrome Custom Tabs feature do not add this to the manifest.

For your app to respond to calls to the redirect URI you need to add an intent-filter to your Activity to register this in the Android system. This will allow the Chrome Custom Tab used by ConnectLoginButton and external browsers to get back to your app.

<activity android:name=".SignInActivity" >
        <data android:scheme="@string/connect_redirect_uri_scheme" />
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

Handle redirect URI

You need an Activity that calls ConnectSdk.handleRedirectUriCallIfPresent, as in the sign in example.

If the app is not using the Chrome Custom Tab feature you only need to override the onActivityResult(…), also as in the sign in example.

Add ConnectActivity for sign in

The ConnectActivity needs to be added to the manifest in order for the SDK to work on devices not using the Chrome Custom Tab feature. Also if the intent-filter is missing the SDK will fall back to use this Activity. Add it to the application section.

        android:theme="@android:style/Theme.Holo.Light.NoActionBar" />

Add networkSecurityConfig to application

<manifest ... >
    // add this line ⬆️
    ... >

Your app’s AndroidManifest.xml file.

You can safely ignore the warning about unused tag in API levels lower than 24.

This is needed for the SDK to work as expected on Android Pie and newer.

If you have your own networkSecurityConfig make sure the entries from network_security_config_connect_id are included.

(Optional) Enable prompt for automatic sign-in

To allow the SDK to prompt users to turn on mobile data so they can instantly sign in, add the following meta-data element to your AndroidManifest.xml file:

<application ... >
    android:value="true" />

(Optional) Enable SMS PIN autofill

You can optionally enable the feature for automatically filling in verification PIN codes received on SMS.

  1. Calculate the app hash.
  2. Send the 11 base64-encoded characters to us at (note There will be one hash for the development version (staging) and one for the production version).
Edit this page