The Bazaarvoice Mobile SDKs provide access to most of the core products Bazaarvoice offers. To learn more, go to the Mobile SDK documentation home page.

Contents

(+ show- hide)

This guide shows you how to install and import the Bazaarvoice Mobile SDK into your Android app.

Prerequisites

  • Signed Data Usage Amendment, if not already in place
  • Minimum Android deployment target of 4.1.0 (API Level 16)
  • Android Studio
  • Your Client ID
  • API key(s) for Bazaarvoice products you have enabled

Versioning

The Mobile SDK for Android is versioned so that we can release new features, bug fixes and improvements without compromising the stability of applications using older versions.

This table summerizes the major version releases. For more information refer to the Mobile SDK for Android Github repo.

Version Release Date Status
1 Jul 26, 2012 Deprecated
2 Jan 31, 2013 Deprecated
3 Mar 8, 2016 Deprecated
4 May 4, 2016 Deprecated
5 Oct 31, 2016 Supported
6 Jan 23, 2017 Supported
7 June 18, 2018 Supported
8 October 1st, 2018 Latest
Deprecated
These versions should not be expected to return data and/or may experience service degradation. Documentation specific to these versions may no longer be available. These versions should not be used by any applications.
Supported
Supported versions continue to receive security and bug fixes, but applications using these versions should be upgraded to the latest version when possible to take advantage of new features. New applications should not use these versions.
Latest
This is newest version. New applications SHOULD use the most recent release of this version.

Installing with Gradle

For manual installation using archive builds (.aar), use the latest archive version on the BVSDK Maven repository.

Add the following dependencies to include the Maven Central repository and add Bazaarvoice Mobile SDK modules. You only need to add the dependencies for the products you have an API key for.

dependencies {
  implementation 'com.bazaarvoice.bvandroidsdk:analytics:{BV_SDK_VERSION}.+'
  implementation 'com.bazaarvoice.bvandroidsdk:auth-iovation:{BV_SDK_VERSION}.+'
  implementation 'com.bazaarvoice.bvandroidsdk:conversations:{BV_SDK_VERSION}.+'
  implementation 'com.bazaarvoice.bvandroidsdk:curations:{BV_SDK_VERSION}.+'
  implementation 'com.bazaarvoice.bvandroidsdk:curations-ui:{BV_SDK_VERSION}.+'
  implementation 'com.bazaarvoice.bvandroidsdk:location:{BV_SDK_VERSION}.+'
  implementation 'com.bazaarvoice.bvandroidsdk:recommendations:{BV_SDK_VERSION}.+'
  implementation 'com.bazaarvoice.bvandroidsdk:store-notifications:{BV_SDK_VERSION}.+'
}
repositories {
  mavenCentral()
}

Replace the {tokens}, including brackets, with the appropriate values. Refer to the Installation guide for {BV_SDK_VERSION}.

Downloading the iovation SDK

Refer to the Device Fingerprinting topic to download and add the iovation SDK to your project. This SDK is required to ensure authenticity in user-generated content.

Configuring the BVSDK

Once you have installed the source code for the SDK, you are now ready to initialize the BVSDK with your API key(s) and envrionment (staging versus production).

The table below will generate a configution file for your SDK. The values you set will generate the necessary script and Mobile SDK intialization code to get you up and running quickly.

Each client application should have its own API key. If you need to generate a new key for Conversations please see Conversations Requesting API Keys.

For all other API keys or if you don't know your client ID, contact Bazaarvoice Support or your implementation team.

Products Production Staging
Curations
Conversations
Conversations for Stores
Product Recommendations & Advertising
Analytics Locale

Enter your Client ID and at least one API key.

Create a class that extends android.app.Application, and initialize the Mobile SDK using its builder.

You can find a full list of build options in BVSDK.java.

          public class MyApplication extends Application {
            @Override
            public void onCreate(){
              super.onCreate();
              // BazaarEnvironment.PRODUCTION reads from bvsdk_config_prod.json
              // BazaarEnvironment.STAGING reads from bvsdk_config_staging.json
              BVSDK.builder(application, BazaarEnvironment.PRODUCTION)
                .logLevel(BVLogLevel.VERBOSE) // Optional: Set the log level. Default level is ERROR.
                .dryRunAnalytics(false)       // Optional: Set analytics to log only, not make a network request. Default is false.
                .okHttpClient(okHttpClient)   // Optional: Use you own okHttpClient instance
                .build();
            }
          }
        

App manifest file

Add the following to your AndroidManifest.xml file.

  
  <application
    android:name=".MyApplication">
  </application>

Bazaarvoice SDK dependencies

In case your app and our SDK use different versions of the same dependencies, we have compiled a list of the depedencies each of our modules has below to help debug.

If your app pulls in any com.android.support, com.google.android.gms, or com.gimbal.android.v2 modules, it would be best for you to look at the specific modules that we request from those packages below. Redeclare them in your build.gradle with the explicit version you would like. This will avoid any 'duplicate class' issues while compiling.

  • Analytics

          implementation "com.squareup.okhttp3:okhttp:3.10.0"
          implementation "com.google.android.gms:play-services-ads:15.0.0"
          implementation "com.android.support:support-annotations:27.0.0"
        
  • Common

    Inherits from analytics, and adds:

          implementation "com.google.code.gson:gson:2.8.5"
          implementation "com.android.support:recyclerview-v7:27.0.0"
        
  • Advertising

    Inherits from common, no additional dependencies.

  • Auth-Iovation

    Inherits from conversations, and adds:

          implementation('com.iovation.fraudforce.lib.FraudForce:fraudforce-lib-release-3.0.1:3.0.1@aar')
        
  • Conversations

    Inherits from common, no additional dependencies.

  • Curations

    Inherits from common, no additional dependencies.

  • Location

    Inherits from common, and adds:

          implementation "com.gimbal.android.v2:gimbal-sdk:2.72"
          implementation "com.gimbal.android.v2:gimbal-slf4j-impl:2.72"
          implementation "com.android.support:appcompat-v7:27.0.0"
        
  • Notifications

    Inherits from common, and adds:

          implementation "com.android.support:appcompat-v7:27.0.0"
        
  • Recommendations

    Inherits from common, no additional dependencies.

  • Store notifications

    Inherits from location, notifications, and conversations. No additional dependencies.

Completing installation

After you've completed the above steps, the Bazaarvoice Mobile SDK should be configured and installed. If you encounter difficulties, contact Bazaarvoice Support or your implementation team.

Next