The Amp Devcenter Test Developer Hub

Welcome to the Amp Devcenter Test developer hub. You'll find comprehensive guides and documentation to help you start working with Amp Devcenter Test as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Android

Amplitude Android SDK Installation & Quick Start

Maven CentralMaven Central

SDK Installation

1. Add dependencies

  • We assume you're using Android Studio as your IDE and gradle to manage dependencies.
  • In build.gradle file, please add following dependencies. Okhttp is needed because our SDK depends on it.
dependencies {
  implementation 'com.amplitude:android-sdk:2.25.2'
  implementation 'com.squareup.okhttp3:okhttp:4.2.2'
}
  • Make sure you run gradle sync.

2. Add permissions

  • To report events to Amplitude, you need to add the INTERNET permission.
  • Please make sure you have following permission to your AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET" />

3. Google advertising ID (Optional)

Please refer to this.

4. Carrier information (Optional)

Please refer to this.

5. API Compatibility

Please refer to this.

SDK Usage

1. Import package/class

import com.amplitude.api.Amplitude;
import com.amplitude.api.Amplitude

2. Quick start example

// Initialize
Amplitude.getInstance().initialize(context, "YOUR_API_KEY");

// Enable COPPA (Turning off sensitive data tracking)  
Amplitude.getInstance().enableCoppaControl();

// Log event
Amplitude.getInstance().logEvent("app resumed");
// Initialize
Amplitude.getInstance().initialize(context, "YOUR_API_KEY")

// Enable COPPA (Turning off sensitive data tracking)  
Amplitude.getInstance().enableCoppaControl()
  
// Log event
Amplitude.getInstance().logEvent("an event")

Usage & Examples

Please see the SDK Usage & Examples page.

Need Help?

If you have any problems or issues over our SDK, feel free to create a github issue or submit a request on Amplitude Help.

Updated 27 days ago


Android


Amplitude Android SDK Installation & Quick Start

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.