Skip to main content

Android Integration

This guide will help you configure your Android app for ChottuLink Dynamic Links. You can complete this setup either during the initial onboarding or later from your project settings.

🛠 Prerequisites​

Before integrating ChottuLink into your Android app, ensure you have the following:

Development Environment​

  • Install or update Android Studio to its latest version

Project Requirements​

  • Make sure that your project meets these requirements:
    • Targets API level 21 (Lollipop) or higher
    • Uses Android 5.0 or higher

Testing Requirements​

  • Set up a physical device or use an emulator to run your app

Start by configuring the ChottuLink Dashboard for your application. This step is typically completed during the onboarding process after registration.

To ensure proper redirection, configure the default fallback URL for your app in the Project Settings section of the ChottuLink Dashboard.

settings-default-fallback.png

1. Enable Android App​

  1. Navigate to your project settings ChottuLink Dashboard
  2. Check the "I have an Android App" checkbox
  3. Fill in the required Android app information

settings-android.png

2. Package Name​

The Package Name is your app's unique identifier in the Android ecosystem. It's required for app signing and Play Store listing.

How to find your Package Name:​

  1. Open your project in Android Studio
  2. Open your app's build.gradle file
  3. Look for the applicationId field under defaultConfig
    • Format: com.yourcompany.appname
    • Example: com.example.myapp

Alternatively, you can find it in your AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.example.myapp">

Turn on App Links to support deeplink handling in your Android app.

  1. In the ChottuLink Console, check the "Enable App Links" checkbox
  2. Add your SHA-256 fingerprint

How to get your SHA-256 fingerprint:​

  1. Open Android Studio
  2. Open the Gradle panel (View > Tool Windows > Gradle)
  3. Navigate to YourApp > Tasks > android
  4. Double-click on signingReport
  5. Look for the SHA-256 values in the Run window

Alternatively, you can get the fingerprint using the command line:

# For debug keystore
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

# For release keystore
keytool -list -v -keystore path/to/your/keystore.jks -alias your-key-alias

📦 Installation​

1. Add the SDK to Your Android App​

You need to tell your Android project to use the ChottuLink SDK. Open the build.gradle file that's for your app (not the project-level one). Add this line inside the dependencies section:

dependencies {
// ... any other dependencies you have
implementation 'com.chottulink:android-sdk:1.1.2' // IMP: Change '1.1.2' to the newest SDK version!
}

2. Update Your App's Manifest File​

Your app's AndroidManifest.xml file needs a couple of things:

  1. The internet permission (if you haven't added it already).
  2. To know which part of your app should open when a ChottuLink URL is clicked.

Here's how it might look. Make sure to change the highlighted parts!

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.yourapp">
<uses-permission android:name="android.permission.INTERNET" />

<application
... >
<!-- This part tells Android which Activity opens your links -->
<activity
android:name=".YourDeepLinkActivity" // <-- Change this to your Activity that handles links
android:exported="true">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<!-- Change "yourapp.chottu.link" to the special domain you set up for your ChottuLink URLs -->
<data android:host="yourapp.chottu.link"/>
</intent-filter>
</activity>
...
</application>
</manifest>
tip

Remember to change:

  • .YourDeepLinkActivity to the name of your app's screen (Activity) that will open when these links are clicked.
  • yourapp.chottu.link to the domain you've set up on ChottuLink Dashboard for your app's links.

You need to "turn on" or initialize the ChottuLink SDK when your app starts. A good place to do this is in your Application class.

You can get the mobile SDK API KEY from ChottuLink Dashboard API Keys section

If you don't have one, you can create a Java class like this:

import android.app.Application;
import com.chottulink.lib.ChottuLink;

public class YourApplication extends Application {

@Override
public void onCreate() {
super.onCreate();

// Initialize the ChottuLink SDK!
// IMPORTANT: Replace "YOUR_API_KEY" with your real API Key from your ChottuLink dashboard Keys section.
ChottuLink.init(this, "YOUR_API_KEY");
}
}

Then, tell your AndroidManifest.xml to use this YourApplication class:

<application
android:name=".YourApplication" <!-- Like this! -->
... >
...
</application>

✅ Next Steps​

After completing the Android setup:

  1. Create your first Dynamic Link
  2. Receive Dynamic Link