Skip to content

Android SDK guide

Priyatham edited this page Aug 19, 2022 · 2 revisions

Installation

The tools that we need from Android SDK to create an Android app using PythonFMXBuider are:

  • Command-line Tools

  • Platform Tools which provides:

    • Android Debug Bridge (adb)
  • Build Tools which provides:

    • Android Asset Packaging Tool (aapt)
    • apksigner
    • zipalign
  • SDK Platform API

Command-line Tools

We can install all of the above tools using Android sdkmanager which is provided as part of the "command line tools only" package. Let's download the Android command line tools from the Android Studio downloads page. Currently, we provide PythonFMXBuilder application binaries for Windows platform only. We have plans to extend our application to macOS and Linux platforms.

Now, after downloading the command line tools, unzip the folder. Then we install command line tools using the following shell command in the command prompt:

>path\to\sdkmanager --install "cmdline-tools;latest" --sdk_root=path\to\android_sdk

For example, in my case:

C:\Users\Priyatham>C:\Users\Priyatham\Downloads\commandlinetools-win-8512546_latest\cmdline-tools\bin\sdkmanager.bat --install "cmdline-tools;latest" --sdk_root=C:\Users\Priyatham\Documents\android_sdk

The sdk_root is optional where we can manually provide the desired installation path of android_sdk folder.

Platform Tools, Build Tools, SDK Platform API

Now that we have command-line tools, we shall install all other tools. This time we shall use the sdkmanager from the newly installed command-line tools of the android_sdk. We can do this using the following shell command in the command prompt:

>\path\to\android_sdk\cmdline-tools\latest\bin\sdkmanager "platform-tools" "build-tools;32.0.0" "platforms;android-32"

For example, in my case:

C:\Users\Priyatham>C:\Users\Priyatham\Documents\android_sdk\cmdline-tools\latest\bin\sdkmanager "platform-tools" "build-tools;32.0.0" "platforms;android-32"

To get the latest version numbers of build-tools and SDK-API - plaforms;android, please check the list of all the packages using;

>\path\to\android_sdk\cmdline-tools\latest\bin\sdkmanager --list

After installing all the necessary tools of Android-SDK, you can check the list of installed packages using;

>\path\to\android_sdk\cmdline-tools\latest\bin\sdkmanager --list_installed

This should output something like;

image

Usage of Android SDK in PythonFMXBuilder

Now we can provide the path of android_sdk folder as a base path to extract all other tools automatically. The steps to follow are:

  • Run/Open the PythonFMXBuilder application
  • Set up the Environment using Tools > Update Environment or the Environment set up button; PythonFMXBuilderGUI_Update_env
  • A new slider window will appear from the right side. Please clear/delete all the paths in the SDK Settings
  • Then please provide the android_sdk path in the SDK base path in the SDK Settings. Then press the Tab button or just press on any other path placeholder boxes. This will trigger an automatic loading of all other paths in the SDK Settings

Here, in my case;

PythonFMXBuilderGUI_SDK_Settings