How to build and install an SDK for Android

Stable: 15.02.2021 - 12:27 / Revision: 10.02.2021 - 14:09

I am here to prevent the first-page-empty bug!

This article explains how to integrate the custom Android™ SDK for Android Studio.

1 Prerequisites

One of the following environments must be installed:

Android Studio must be installed.

Information about Android API Levels is available in the Android SDK page[1].

For Developer Package users go directly to section Install SDK in Android Studio.

2 Build SDK for distribution

2.1 Set environment

The Android™ SDK has to be generated in the eng build environment, select the right case when using the lunch command.

2.2 SDK for Linux®

Execute the following build commands to generate the SDK

 make sdk

The result is in the path out/host/linux-x86/sdk/<BoardId>/android-sdk_eng.<login>_<linux-x86>/platforms/android-<Version>/android.jar.

2.3 SDK for Windows®

For Windows®, a specific Ubuntu® package needs to be installed to build the Android™ SDK for Windows®, add the unix2dos command:

 sudo apt-get install tofrodos

Execute the following build commands to generate the SDK:

 make win_sdk

The result is in path out/host/windows/sdk/<BoardId>/android-sdk_eng.<login>_<windows>/platforms/android-<Version>/android.jar.

Info white.png Information
Both Linux® and Windows® SDKs are generated when win_sdk is used.

3 Install SDK in Android Studio

The information below applies to both Linux® Ubuntu® and Windows® environments. (It is assumed that Android Studio is already installed.)

  • Open Android Studio
  • Open Settings in the File Menu
  • In the Settings pop-up select Appearance & Behavior --> System Settings --> Android SDK
    • Check the path of the SDK as highlighted in Red in the picture below.
    • Check for the correct SDK API selected, as highlighted in Blue in the picture below.

Android SDK.png

  • Copy the android.jar file provided with the developer package or the custom version with the distribution, to the Android Studio SDK path : <YourAndroidStudio_SDKPath>/platforms/android-<APILevel>/
  • Restart Android Studio
  • To check for new API availability in Android Studio, search for new Class/Symbol through the Navigate menu.

4 References


IMPORTANT NOTICE – READ CAREFULLY
STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgment.

Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of purchasers’ products.

No license, express or implied, to any intellectual property right is granted by ST herein.

Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.

ST and the ST logo are trademarks of ST. For additional information about ST trademarks, refer to www.st.com/trademarks. All other product or service names are the property of their respective owners.

Information in this document supersedes and replaces information previously supplied in any prior versions of this document.