To install development dependencies:
  sudo apt install make default-jre-headless clang aapt zip zipalign apksigner

You will need a keystore to sign your apk. To generate keystore:
  mkdir -p ~/.android
  keytool -genkeypair -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 14000

You will need android.jar for function prototypes (26 MiB). To download android.jar:
  mkdir -p ~/.android
  wget -O platform.zip https://dl.google.com/android/repository/platform-34-ext7_r03.zip
  unzip -p platform.zip android-34/android.jar > ~/.android/android-34.jar
  rm platform.zip

To link C code, you will need header files in Android NDK (2.4 GiB; this is not needed if your project doesn't use C). To download Android NDK:
  mkdir -p ~/.android
  wget -O android-ndk.zip https://dl.google.com/android/repository/android-ndk-r29-linux.zip
  unzip -d android-ndk android-ndk.zip
  rm android-ndk.zip
  mv -t ~/.android android-ndk/android-ndk-r29
  rmdir android-ndk

Now you can compile with:
  make

The compiled package is now in app.apk. You can install it using your favorite app. Alternatively, you can sideload it:
  adb install app.apk

You can start the app normally from the launcher. Alternatively:
  adb shell am start -n org.trosos.android.nativehello/android.app.NativeActivity

To inspect logs:
  adb logcat -s HelloNative

You can uninstall the app the usual way. Alternatively:
  adb uninstall org.trosos.android.nativehello
