Installing The SDK

The Android SDK can be downloaded from SDK Downloads.

The SDK is currently distributed as an aar bundle. Follow the steps below to include the SDK in your Android project as a dependency:

  1. In Android Studio select File -> New Module.
  2. Select Import .JAR/.AAR Package.
  3. Select the .aar bundle.
    1. Note the Subproject name must match the name of the .aar bundle (excluding the .aar extension).
  4. In the project explorer, right click on your app and open the Module Settings.
  5. Make sure your app module is selected and switch to the dependencies tab.
  6. Add the VoiceLayerSDK module as a Module Dependency.
  7. In your application's build.gradle file add the following dependencies:
compile 'com.google.code.gson:gson:2.6.2'
compile 'org.slf4j:slf4j-api:1.7.5'
compile 'io.jsonwebtoken:jjwt:0.5.1'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
  1. In your application's manifest add the following permissions if not already present:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

You should now be able to build and run your application with full use of the VoiceLayer SDK.