Integration
Getting Started
The purpose of this section is to explain the components of the ACTV8me Android SDK and to help you configure it for use with an existing Android app or project.
SDK Library Information
The ACTV8me Android SDK uses one core library and three auxiliary libraries:
- actv8me-core-sdk.aar: handles all the core functionality, including authentication with ACTV8me servers via RESTful API.
- actv8me-audio-sdk.aar: handles the detection and delivery of content for the audio fingerprint and watermark triggers.
- actv8me-beacon-sdk.aar: handles the detection and delivery of content for the beacon triggers.
- actv8me-geofence-sdk: handles the detection and delivery of content for geofence triggers.
Additional External Libraries (Required)
implementation 'com.google.code.gson:gson:+'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'bz.tsung.android:objectify:2.0'
Bluetooth Beacon Libraries (Required for Bluetooth Beacons)
implementation 'com.kontaktio:sdk:3.3.3'
Installation
Installation Steps
To install the ACTV8me Android SDK, please follow these steps:
-
Copy all 4 downloaded files (provided by ACTV8me upon registration), and paste them into the “libs” directory in your application.
-
Include the following code snippet in the project-level (External) build.gradle file:
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
google()
}
}
- Include the following code snipped in the "dependencies" section of the app-level (Internal)
build.gradle file:
implementation(name:'actv8me-core-sdk', ext:'aar')
implementation(name:'actv8me-audio-sdk', ext:'aar')
implementation(name:'actv8me-beacon-sdk', ext:'aar')
implementation(name:'actv8me-geofence-sdk', ext:'aar')
- Sync and rebuild your project and start using the ACTV8me Android SDK.
Permissions
Based on the SDK configuration, certain permissions are required. You’ll need to add those permissions in your manifest (AndroidManifest.xml):
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.c2dm.permission.REGISTER"/>
If you want to use the Audio detection technology in the SDK and your “targetSdkVersion” is set API level 23 OR above, then you will need to request below permissions:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
If you want to use the Beacon detection technology in the SDKand your “targetSdkVersion” is set API level 23 OR more, then you will need to request below permissions:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
If you want to use the Geofence detection technology int the SDK and your “targetSdkVersion” is set API level 23 OR more, then you will need to request below permissions:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Dont forget to ask run-time permissions, otherwise the SDK will not work properly. It is mandatory since Android-6 (Marshmallow) API-Level-23.
Also, make sure to change “allowBackup” flag to “false” in tag in your manifest file. By default, this flag is “true”. See below code for more details--
<application>
android:allowBackup="false"
.
.
.
</application>
Note: If you keep this flag true, you will get “ERROR: Manifest merger failed with multiple errors, see logs” error.
Demo Project
If you are interested in using our Android Studio Demo Project, please reach out to [email protected]
Updated over 4 years ago