Compiling for Android
First Time Setup
Android devices are pretty popular these days. GLBasic is able to compile for Android targets running 2.2 (Froyo) or higher, since GLBasic V10 release version. In order to build for Android follow these steps:
-Install the GLBasic setup
-Install a Java JDK, 32 bit (Java TM Platform, Standard Edition Development Kit (JDK TM)). !! 32 BIT !!
-Add an environment variable in windows control center: JAVA_HOME=C:\program Files (x86)\Java\jdk1.x.x_xx (where your Java is installed)
-Make a project of your choice
-Set platform options for Android in menu "Project/Options"
-Plug the device in
-Make sure the drivers are installed. (You might need to install the Android SDK for that?)
-Build for android
GLBasic will copy the "Media" directory to the distribute/Android/assets directory, pack the App and install it right on your device.
Alternatively you can run the emulator from the SDK and test on it.
In order to sign your code for releasing software on the Android Market, you need a developer key, that you can create like:
> cd /D "%JAVA_HOME%\bin"
> keytool.exe" -genkey -alias android_developer.keystore -keyalg RSA -validity 20000 -keystore android_developer.keystore
With this file you can now code-sign GLBasic product with these lines:
> cd /D "%GLB_PROJ_DIR%\distribute\Android"
> set ANDROID_SDK=C:\program Files (x86)\GLBasic\compiler\platform\Android\android-sdk-windows
> "%JAVA_HOME%\bin\jarsigner.exe" -verbose -keystore "%USERPROFILE%\Downloads\android_developer.keystore" -signedjar bin\glbasic-release-signed.apk bin\glbasic-release-unsigned.apk android_developer.keystore
> "%ANDROIDSDK%\tools\zipalign.exe" -v 4 "%GLB_PROJ_PATH%\bin\glbasic-release-signed.apk" "%GLB_PROJ_PATH%\bin\glbasic-release-for-market.apk"