After recognizing a series of common problems in developing Android applications I’ve decided to sum up my knowledge and hopefully address most of the Android specific problems related to Jmonkey engine.
Pretty much all of my programming experience comes from making Android applications in Jmonkeyengine and have experienced many of the problems I’ve seen myself. And trust me I have spent agonizing days and hours on trying to solve everything from black textures and terrain to getting those darn google advertisements to work.
Hopefully this thread will help beginners have the confidence to try their hand at an android application and people who are experienced maybe find a solution to that long time problem or even contribute some of their knowledge.
The hopeful goal of this thread is to create the beginning for more complete Android wiki as it is slightly outdated and doesn’t cover as many as the issues that users have trouble with, and rather than go changing the wiki, use the forums as a place to identify which issues are relevant and the best practice in which to approach them.
1. How do I make my project an Android Application?
2. My project is now an Android Project. How can I test it?
First you must download the Android SDK for the Jmonkey IDE. https://developer.android.com/sdk/index.html?hl=i Download the suggested packages (Also the google-play-services if you plan on adding advertisements etc.) Make sure to "Download for an Existing IDE" if you plan on using it for the Jmonkey SDK By editing your projects properties by setting a custom configuration 1. Disable compiling on save Build->Compiling and unchecking the box. 2. Enable Android Deployment and Click okay If it is your first time it will ask you for the Android SDK Folder. Simply navigate to the proper folder in the file browser that will pop-up Now when you build your project you will have an "APK" in your dist folder and you can now test your project on an android device (assuming it is connected to your pc). While any project can be deployed whether or not it will work is a different story. Unsurprisingly Android is not as forgiving as pc on file size and fps so scenes and textures must be kept simple and most importantly controls must be made with a touch screen in mind.
Setting the project configuration to "Android Device" at the top the SDk. *Common Issues for this step* "My game is launching normally in PC even though it says 'Android Device' please help!" <em>You do not have "Compile on Save Disabled" Disable it in the Project Properties.</em> "My game crashes instantly cause I get **** error!" <em>See will be covered in next post</em>
3. My Project Is Perfect! How do I create a “signed” version for release?
Once your project is perfect and ready to go and you’re ready to sign it and release it to the world you first must create a “keystore.”
To create a keystore (I assume Java programmers have the SDK on call via an environment variable) simply open your command prompt and type
<em>keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000</em>
Once your keystore is created you you must edit your project properties to reflect the location and alias you used when you created your keystore.
These properties can be found in the “Important Files” package that is created automatically when you enable Android Deployment for your project.
It will now prompt you for the password you used when you created it. Type in the password and you will now have a “release APK” in the “dist” folder of your project.
You are now ready to upload your project to the Google Play Store!
“I want to add game saving and Ads and my own Icon and loading screen!”
“I’m still having bugs with xxxx and am not ready to deploy”
The next post will cover common bugs, the advertisements and loading screens and icons.