Skip to content

Android APK Setup

ReactX edited this page Dec 12, 2024 · 1 revision

Prerequisites

  • Adobe Air SDK
  • Java 11
  • Android Studio
  • Android SDK version 33 (android "tiramisu")

Setup

  1. To begin, you will need to install the Adobe Air SDK. Accept their terms & conditions, and download "AIR SDK for Flex Developers"

  1. Once downloaded, you can navigate to your installation directory and look inside the bin folder, where you will find a adt binary. Add this to your Environment Variables PATH, and restart any terminals you have open.

  1. It is important to note, that you must have the SWF file bymr-android.swf inside the apk directory at this point. It must go in here so that it can be bundled into the APK when you run the following commands.

  1. To generate a keystore, navigate into the root project directory of the Backyard Monsters Refitted repo, and run the following command:
keytool -genkeypair -v -keystore android/bymr.keystore -keyalg RSA -keysize 2048 -validity 138920 -alias my-key-alias\n

You will then be prompted to create a new password and register some basic information for your bundle. If completed successfully, you will see that a bymr.keystore file was generated.


  1. Finally, generate your Android APK using the following command:
adt -package -target apk-captive-runtime -arch armv8 -storetype pkcs12 -keystore android/bymr.keystore android/apk/BYMRefitted.apk android/bym-refitted.xml android/apk/bymr-android.swf android/icons/icon36.png android/icons/icon48.png android/icons/icon72.png

If successful, a working APK should be generated in the android/apk/ directory.

Note: We are currently targeting arm64-v8a devices.

image


Troubleshooting

This setup is very specific and therefore any version mismatches in the prerequisites outlined, can cause compilation errors. Ideally, you should have Java 11 installed and configured correctly, your paths setup correctly, and ensure that you have installed Android 13 (33) via the SDK Manager in Android Studio. This discussion here may help with troubleshooting.


Compatibility

Feature ARMv8 (ARM64) x64 (x86-64)
Architecture RISC (Reduced Instruction Set Computing) CISC (Complex Instruction Set Computing)
Instruction Set ARMv8-A (AArch64) x86-64
Performance Highly optimized for low power and mobile devices High performance for desktops and servers but less power efficient
Energy Efficiency More energy efficient, designed for mobile devices Generally less efficient in mobile devices but powerful
Adoption in Android Predominant, most Android devices use ARM64 Niche, mainly used in emulators and select Intel devices
Binary Compatibility Uses arm64-v8a ABI Uses x86_64 ABI
Support Wide support in modern Android devices Limited support in Android (mostly older Intel devices and emulators)