I updated the source found in the src/android directory to make it work with the latest jme3 alpha and Android 2.2.
I've done some testing on a Nexus One and here are some issues I've run across.
- Drawing text is _really_ slow. In the "9-spheres" test the difference between disabling the StatsView or not is about 40 fps down to 10 fps. (I kept only the FPS text). I suspect the texture switching is not very optimized.
- OBJLoader takes about 20 minutes to load the Utah teapot in the TestSimpleLighting test. The garbage collector runs furiously during the time. Inspecting the continuous /data/anr/traces.txt dumps I can see it trashes around in the RegEx compiler. The lighting effect is not very impressive either, and for some reason the rotating light source dot is white instead of red.
Any thoughts on this? Anyone else who have done performance investigations or have done Android work.
I'm going to continue working on completing the Android port, adding GL ES 2.0 support as well, since I need it myself.
/bs
I have some more findings that may be of interest:
- onPause in AndroidHarness.java is always called before onDestroy when the Android app closes down. The inverse is not always true though. If your app just loses focus, most commonly by the screen saver kicking in getting you to the lock screen when trying to resume, you'll just get a call to onPause. All textures are lost when this happens however and you'll just get white primitives when continuing! The code from onDestroy should be moved to onPause to get the same behavior as when you get an orientation change for instance (which is handled correctly).
- Dalvik (Android VM) has a pretty inefficient garbage collector, and avoiding having it run is almost mandatory to get a smooth experience. JME3 has a tendency to create unnecessary transient garbage objects in certain situations, like when handling input events (MouseMotionEvent etc). To work well on an Android device, some memory profiling will be needed to see where the bottlenecks are.
/bs