Import a Digi sample application

Digi provides sample projects that demonstrate how to use the API extensions to access hardware interfaces available in your device.

Note Ensure that the Digi plugin is installed. To learn how to install it, see the instructions for "Digi Extensions for Android Studio" in Step 4.1: Install the software.

To import a Digi sample application:

  1. Open the Import Digi Sample wizard by doing one of the following:
    • Select Import a Digi Android code sample on the Welcome screen.
    • Select File > New > Import Digi Sample from the menu.
  2. On the Browse Samples page of the wizard, select one of the available Digi samples and click Next.

  3. On the Sample Setup page of the wizard, configure the Application name and the Project location.

  4. Click Finish to import the example. It opens in a new Android Studio window.
  5. Android Studio will likely recommend that you update the Android Gradle plugin when you import an example. Development on the Android Gradle plugin is ongoing, but Digi samples are configured with a specific Gradle version.

    Click Update and Android Studio performs the update.

  1. Wait a few seconds while the compiler is working and click the Run button to launch the application on the device.

Note Android Studio for 32bits version 2.2 or newer has a known issue when trying to build with Gradle. To fix the issue, change the JDK for your project. See known Android Studio issues for instructions.

Note The following Gradle synchronization error is due to a known Android Studio issue: