Skip to content
Get Help

Android SDK Overview

SDK Stats ​

Open Source Github Repo: https://github.com/BranchMetrics/android-branch-deep-linking

SDK Size: 187kb

Speed: Median 80ms to 250ms

Minimum OS Version: API Level 21+

Android Demo App ​

Want to take our technology for a test drive before implementing it?

Download the Branch Monster Factory app to practice creating Branch Links, generating Branch QR Codes, and tracking Branch Events all while leveling up your Branch monster!

Want to dive into the code directly?

View the Branch Monster Factory app in GitHub

Basic Integration ​

Integrating the Branch Android SDK is required for the following features:

  • Ads
  • Email
  • Journeys

Integrate the Branch Android SDK

Advanced Features ​

On top of the basic integration, you can implement the following features:

  • Create content reference
  • Create deep link
  • Share deep link
  • Read deep link
  • Navigate to content
  • Display content
  • Track content
  • Track users
  • Handle push notifications
  • Handle links in your own app

Implement Advanced Features

Testing ​

Test your Branch integration before your app goes live.

Test your Branch Android SDK integration

Troubleshooting ​

Running into issues? Browse our troubleshooting section to find a solution.

Search solutions to common Branch Android SDK issues

Version History ​

View past versions of the Branch SDK for Android including changes.

View Branch Android SDK version history

Full Reference ​

The information presented here serves as a reference manual for our Android SDK.

View Branch Android SDK full reference

FAQ ​

Why do we recommend initializing the SDK in onStart() versus onCreate() in Android?

onCreate() is called when the Activity is first created and not when the activity is backgrounded. The Branch SDK is to be initialized every time the activity is foregrounded. If the activity is backgrounded and then foregrounded, this callback is not guaranteed to be called and hence the SDK will not be initialized.

The recommended way to initialize the Branch SDK is in onStart(). This is where you need to initialize the SDK since this callback is triggered every time the app is started whether from a cold start or a warm start. This is the callback that makes the activity visible to the user.

Why does my Android app call Branch multiple times when resuming?

This behavior is often a consequence of the launchMode parameter in the Android manifest being set incorrectly. Make sure that launchMode in the manifest is set as follows:

android:launchMode='singleTask'

When this is not set, or is set incorrectly, the activity may fire twice.

Why did Google Play remove my app from the store?

In older versions of the Branch Android SDK (1.2.6 to 2.11.0) calls were made to https://api.branch.io/v1/applist endpoint. We disabled and deprecated this endpoint in 2015, but it seems that it is not enough. We believe a recent update to the Google Play Store policies prompted these new violations. In response, Branch has removed all the potentially hostile code from our Android SDK and released an updated version on 8/14/17. This was limited to our Android SDK and our latest SDK complies with the privacy policies of the Play Store.

Please update your Android app to use the latest version (v 2.11.1) of the Branch SDK and re-submit it to the Play Store.

How does Charles Proxy relate to my Android app?

Since Android N, you are not able to proxy to apps unless it is your own app. What this means is:

  1. You need to download the .apk.
  2. Add the code in the instructions​.
  3. Recompile it.
How do I stop collecting the SSAID (android_id)?

The SSAID or android_id is a persistent hardware identifier that is “common between apps signed by the same developer signing key.” Branch utilizes this for many use cases such as Fraud and to provide the best user experience across different apps. If you wish for Branch not to collect the SSAID, you can call Branch.disableDeviceIDFetch() within onCreate() of your Application Class.

When this method is enabled, the SDK will fall back to generating a UUID as a hardware id.

Why does my app not open directly when it gives an option to choose between browser and app?

On Android, if the App Links are enabled correctly, they should never show the dialog box to choose between a browser and the app as mentioned in the Android documentation.

Troubleshooting Steps ​

  1. Confirm the device browser is NOT the default handler for xx.app.link domain.

    • Android App Links sets the app as the default handler for a domain (i.e., xx.app.link). If a user clicks a link before App Links is enabled, they’ll have the option to open in browser or in-app. If the browser is selected with “always”, that domain will never open the app.
    • Reset browser defaults: Settings → Apps → select the browser → Defaults → “Clear Defaults”.
  2. If one domain is failing verification, App Links is disabled for every other domain too.

    • Every domain & subdomain in Manifest must host a DAL file at: https://[domain]/.well-known/assetlinks.json
    • Even if autoVerify="true" is not in all intent filters, Android will scrape every domain.
  3. Confirm Branch dashboard & all other DAL files contain the correct SHA 256 fingerprint.

  4. Confirm app’s compileSdkVersion in build.gradle is 23+.

  5. All link domains must be publicly accessible (not behind firewall/vpn) and accessible by Google's bots.

  6. Validate App Links: Install app > connect device to Android Studio > ./adb shell dumpsys package d.


Successful verification


Failed verification

How do I continue accessing GAID after Android 12?

Google will implement some changes to GAID access beginning in April 2022. If your app targets Android 13, you will need to declare new AD_ID permission to continue collecting GAIDs for users on Android 13.

To ensure your Branch attribution data remains reliable and complete, please take either of the following actions before April 2022:

  1. Confirm that your Google Mobile Ads SDK (play-services-ads-identifier) SDK is version 17.1.0+ (released September 2021). Versions 17.1.0 and above of this SDK automatically merge the AD_ID permission, allowing your app to continue properly ingesting the GAID.
    OR
  2. If you prefer not to update your Google Mobile Ads SDK at this time, you may explicitly declare the new AD_ID permission () in your app's manifest file. More information on how to do this is available here.
Will the GAID changes impact our attribution on Branch?

Since the introduction of zeroed out GAIDs is the same feature as Limit Ad Tracking and Limit Ad Tracking has been available on Android for years, we do not expect a sudden decrease in Attribution or heavily impact our Attribution reporting. This is primarily because Branch does not collect the GAID when Limit Ad Tracking is enabled by the end-user.

With that said, many Ad Networks are implementing alternative parameters and methodologies to provide accurate attribution reporting even with Limit Ad Tracking enabled. Please evaluate the matrix below.

Impact on Sources when GAID is Zeroed and Limit Ad Tracking is Enabled ​

SourceAlternate Param/IDInstallOpenDownstream Events
MetaMeta Install ReferrerYesYesYes
GoogleMarket Referrer GCLIDYesYesYes
TwitterUnknownNoNoNo
SnapProbabilistic Attribution for AndroidYesYesYes
Non-SANsNo changes as Branch Links are used.YesYesYes
Other Branch FeaturesPREMYesYesYes