Example Projects

This page provides example projects to get you up-and-running quickly with the Bazaarvoice Mobile SDK for Android.

The BV Conversations sample app contains simple examples for displaying and submitting reviews.

🚧

If you are running on an emulator, the examples require that you have Google Play Services installed.

Setup

  1. Clone the BVSDK repository:

    $ git clone https://github.com/bazaarvoice/bv-android-sdk-conversations-example.git

  2. In Android Studio select Open an existing Android Studio Project, or File > Open.

  1. Navigate to the root directory of the project, and click OK.
  1. Add your BV generated config files to the demo apps asset directory.
  1. Modify the productId in the Constants.java file to be an existing product in your catalog.





πŸ“˜

When running the Conversations API demo, you can set your own test product Ids in the DemoConversationsAPIFragment.java file.

Running

  1. Run the app.
  1. You should now see the option to view reviews, or submit a review.
  1. Display Reviews will look something like.
  1. Submit Reviews could show errors because of network failure/etc.
  1. Submit Reviews could show errors because of failure to include Form Fields required by your config.
  1. You can go into the SubmitReviewsActivity.java file to modify the submission request to have the necessary Form Fields.
  1. And once they have all been addressed, you should see success.
  1. Make sure that when you want to actually submit, that you use the Action.Submit action parameter for your Submission requests.





The BV API app contains simple minimal code examples for each of the products and how to set up the API calls for specific use cases.

πŸ“˜

If you are running on an emulator, the examples require that you have Google Play Services installed.

Setup

  1. Clone the BVSDK repository:

    git clone https://github.com/bazaarvoice/bv-android-sdk.git

  2. In Android Studio select Open an existing Android Studio Project, or File > Open.

  1. Navigate to the root directory of the project, and click OK.
  1. Add your BV generated config files to the demo apps asset directory.
  1. To set the environment (production versus staging configuation), set the public static final BazaarEnvironment ENVIRONMENT value in the DemoConstants.java project file.

πŸ“˜

When running the Conversations API demo, you can set your own test product Ids in the DemoConversationsAPIFragment.java file.


Running

  1. Right click the DemoMainActivity.java file, and select Run.
  1. On your device, you should see a home page like this. This app can be used to view example implementations of the different parts of the BVSDK.
  1. There will be a drawer with simple code example for each of the products.
  1. To see your own data in this app, tap the settings cog to go to the settings page, then tap "Select Preloaded Profile". You will be presented with the choice to chance the data source between "Mock Endurance Cycles" (which is a Bazaarvoice demo source), and your BV generated config. The BV generated config will automatically display the environment chosen in the DemoConstants.java file.