Build and Run sample applications

Prerequisites:

You should finish setting up the following to build the demos.

  1. ADB setup: https://developer.android.com/studio/command-line/adb
  2. Download and install Android Studio.
  3. Download and set up Android NDK Version r25c.
  4. Download and install Android SDK (SDK version 23 and build tools version 23.0.2)
  5. Either Caffe, Caffe2, ONNX, PyTorch, TensorFlow or TFLite.
  6. Ensure Android SDK, and NDK environmental variables are properly set.

Once you have set up all software requirements for the Android application development environment, you can load the demo project in Android Studio, compile the project into an APK, and run the demo. You will need the following to run the demo:

  • Qualcomm Neural Processing SDK release binary
  • Model binaries are not included with source code. Steps to generate model binary are provided with individual sample app documentation.
  1. Launch Android Studio. Select File > Open Project and select a project. Click OK.

  2. From the Android Studio menu, select Build > Build APK.
    The output APK Is generated at/app/build/outputs/apk/debug.
  3. Install the APK on the development kit: adb install
  4. Run the application from the Android UI.
    For an overview of how the demos should look, refer to the Individual readme pages on GitHub. A demo GIF is given for each demo, for reference.

Rebuild a sample app with a newer version of the Qualcomm Neural Processing SDK

Current APKs are built and verified with SDK release version 2.10.x. To rebuild, and run the APK with a newer SDK release:

  • Verify whether the DLC model works with newer SDK version. If not, re-convert the model binary to DLC using the newer SDK.
  • Update the SDK release AAR binary file in the APK source path.
  • For an application to work properly, use a single version of the SDK and copy the SDK AAR from the said release to the application source path. Use this SDK version to convert model to DLC.
    If the DLC was converted with a different SDK version (other than the SDK AAR binary) – results are unpredictable.


Snapdragon and Qualcomm branded products are products of Qualcomm Technologies, Inc. and/or its subsidiaries.