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

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.

    Import Sample Wizard 1

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

    Import Sample Wizard 2

  4. Click Finish to import the example. It opens in a new Android Studio window.

    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.

    Update gradle plugin

    Click Update and Android Studio performs the update.

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

Android Studio does not automatically update examples to the latest version. Examples may need to be modified to work with newer versions of Android Studio than the one tested with this release.