Install Layer

Layer is distributed as a source code package or compiled bundle, and can be easily integrated into a new app or an existing codebase with standard tooling.

The Layer Android XDK is built and designed to be used with Android Studio. The XDK is available as an AAR file hosted on GitHub. It is recommended to add this to your project via Maven, though it is possible to use the AAR locally or include the repository as a submodule.

Note

Google has deprecated Android tooling for Eclipse, and as a result we no longer provide support for Eclipse-based workflows.

Maven setup

Navigate to your build.grade file at the app level (not project level) and add the following maven paths:

repositories {
    maven { url "https://raw.githubusercontent.com/layerhq/releases-android/master/releases/" }
    maven { url "https://raw.githubusercontent.com/layerhq/Android-XDK/master/releases/" }
}

Now add the following dependency to your project’s build.gradle file:

dependencies {
    compile 'com.layer.xdk:layer-xdk:4.0.7'
}

Permissions in AndroidManifest.xml

The Layer Android XDK requires some permissions from your app’s AndroidManifest.xml file. These permissions allow the XDK to monitor network state and send debugging info.

<!-- Standard permissions -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<!-- LayerClient.sendLogs() permissions -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_LOGS"/>

ProGuard support

The ProGuard rules are exported via the consumerProguardFiles Gradle property so no additional configuration should be required.

Verifying installation

To verify that everything is working, connect the client, then build and run your app.

Getting Started Connecting