1. Create a new application with Android Studio. For instructions, see the Android Developers Guide.

  2. Ensure that the Digi API extensions are installed in your Android SDK. To learn how to install them, see the instructions in Step 4.1: Install the software.

  3. Once the project is created, configure your project to use the Digi API extensions instead of the standard Android SDK.

    You can do this in one of two ways:

    • Use the Project Structure dialog:

      1. Click File > Project Structure. The Project Structure dialog appears.

      2. Select Modules from the list on the left to display module configuration options.

      3. Select the app module in the Modules list.

      4. In the Compile SDK Version choose Digi International:Digi SDK Add-on for Embedded:30:

        image

      5. Click OK to close the dialog and apply the changes.

    • Or edit the app/build.gradle file and set Digi International:Digi SDK Add-on for Embedded:30 as compileSdkVersion value:

      image

  4. Configure your project to use the Gradle plugin version 7.0.3. To do so, follow these steps:

    1. Right-click your Android project and select Open Module Settings. The Project Structure dialog appears.

    2. In the left list, select Project to display the Gradle project configuration.

    3. Set the Android Gradle Plugin Version combo box value to 7.0.3.

      image

    4. Click OK to close the dialog and apply the changes.

After configuring the project to use Digi SDK Add-on, the following error is displayed:

Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly.

When this occurs, Gradle cannot locate the SDK platform and Digi API extensions are not properly detected. To fix this:

  1. Close the project (File > Close Project) or exit from Android Studio (File > Exit).

  2. Open the project (File > Open Recent) or launch Android Studio again.

  3. Update your project model to match the contents of the Gradle files with File > Sync Project with Gradle Files.