Noob not only to Android Development but to JME3. But not to Java.
So far so good, have completed tutorials and ready to start developing project for uni.
We have our HelloTutorials displaying and running well on our Android phone, however APK file is 40mb. Is this normal?
Also, a build for each project (again, the builds are only of simple HelloTutorial apps) takes about 90 seconds, before Console prompts to connect Android via usb. Is this normal? Youtube demo shows a rapid build.
Finally, we are trying to fool around with Touch capabilities, there is limited documentation for TouchEvent.get(delta)X/Y, so we are looking for output from Android on touchEvents. However, there is massive amount of logger output from the Android. Is there a way to limit this output, so we can only see what we want to output ie, if we use System.out.println? However we donât believe System.out.println is appropriate, so what would be appropriate?
Great SDK, we are having a lot of fun, thank you for the help.
Iâve not played a lot with android yet.
I did a simple project with Eclipse âstandardâ ADT plugin, and a very quick port of some demo I had in JME to android.
It seems so much more difficult in Netbeans! For example, ADT has a feature to filter out the logs sent by the device. Or the emulator.
As I told before, Iâm very young with Android development (2 weeks or soâŚ) so maybe Iâve not configured/installed JMP correctly yet for Android development.
Any advice on this is welcome.
You probably have the test-data.jar packaged with the apk, itâs around 40mb and youâll probably wonât need it so for a starter remove it.
Then as @zarch said, jme is split in several jars so you can bundle only the ones you really need. You can remove jme-effect as itâs the lib containing post process filters, and they are not supported on android. If you donât use terrain, jme-terrain can be removed and so on.
Anyway the build is kind of long, whatever you do, there is a pre-dexing operation that should be done once (the first time you build) and then only when the jars change, but an issue in android SDK make them pre-dexed at each build. @iwgeric is watching for this issue, on the android sdk issue tracker, and weâll be warned when itâs fixed.
Once itâs fixed it should make the build a lot faster (knock on wood).
About the logging part you ahve several options.
You can install nbAndroid netbeans plugin http://www.nbandroid.org/p/installation.html to get access to the adb-logcat view which is very convenient. Youâll have a window where you can filter according to the name of the logger (youâll have to use standard java logging no system.out). I recommend this option as itâs straght forward.
You can configure whatâs logged in the console in the mobile-impl.xml in the nbproject folder. line 110 the adb logcat is launched with default log filtering options, you can change them to suit your needs
see this doc to know hw the filtering works http://developer.android.com/tools/debugging/debugging-log.html
I have installed NBAndroid, under Installed Plugins I have Android version 1.90 installed.
However, there is no options under tools to utilize NBAndroid or LogCat. To utilize NBAndroid do I have to create New Project -> Android ? Or can I use NBAndroid from basic Simple JMonkey game? How do I use the features of NBAndroid?
once installed you should have access to adb logcat from the menu Window/Output/ADB log
also when you create a JME project and enable mobile deployement, it will create a mobile folder inthe project (you can see it in the file explorer). This mobile folder is an android project and you can open it as a project with nbandroid.
We are having more issues. We are trying to minimize librariess as best as we can to assemble a smaller APK file, as well as trying to take full experience of Android capabilities.
Basically, we are trying to run âwaterâ on Android. We have created âsimple waterâ, and tried to deploy it on Android. However we had a huge APK file that wouldnât fit. Therefore Properties -> Libraries and edited jme3-libraries.jar. We removed every inside package except jme3 effects, to try and find which package was necessary to deploy âsimplewaterâ. Then we removed jme3-effects just for kicks. Now there are no packages in jme3-libraries!!! We have removed it and added it, and there are none left in the Jar file!
When we try to run ANYTHING we have a lot of errors. This is the console when we try to run the default main (helloWorld) in the âmygameâ package.
This is for the which should be the computer, not the Android, I am not sure why I am getting issues about Android.
INFO JmeAndroidSystem 3:39:56 PM Running on jMonkeyEngine 3.0.0 Beta
Exception in thread âmainâ java.lang.NoClassDefFoundError: android/opengl/GLSurfaceView$Renderer
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.jme3.system.android.JmeAndroidSystem.newContext(JmeAndroidSystem.java:100)
at com.jme3.system.JmeSystem.newContext(JmeSystem.java:128)
at com.jme3.app.Application.start(Application.java:387)
at com.jme3.app.Application.start(Application.java:368)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:130)
at Main.main(Main.java:26)
Caused by: java.lang.ClassNotFoundException: android.opengl.GLSurfaceView$Renderer
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
⌠18 more
Java Result: 1
Then this is the error I get when I try to run on Android.
Mar 14, 2013 3:47:25 PM com.jme3.system.JmeSystem checkDelegate
SEVERE: Failed to find a JmeSystem delegate!
Ensure either desktop or android jME3 jar is in the classpath.
Exception in thread âmainâ java.lang.NullPointerException
at com.jme3.system.JmeSystem.showSettingsDialog(JmeSystem.java:118)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:124)
at mygame.Main.main(Main.java:32)
no please donât change whatâs in the jme3-libraries.
If you need something lighter, just make another lib and add jars to it.
however you may have issues with simple water , the reflection and refraction might not work (might even crash at some point)
to have a proper setting, just take all the libs that are in jme3-libs, then remove what you obviously donât need. JME-testdata is the biggest one, and you rpobably donât need it.
then if you donât use terrain remove JME-terrain,
If you donât use nifty , remove all nifty* jars (there are some dependencies to nifty too but start by that)
donât remove desktop, or lwjgl related jars, because youâll need them to test your app on desktop and they wonât be copied over to the android bundled apk.
Just put all the libs that are in your Users/yourUserName/AppData/Roaming/.jmonkeyplatform\3.0RC2\libs
Donât pick the ones that have sources or javadoc in the name though, and donât go in the sub folders.
Thanks. I figured there was some type of preferences folder that needed to be trashed to execute a full Uninstall. When I originally trashed all my Libs jar, I tried to uninstall, and when I reinstalled, I still had the same issue.
The solution was to trash the folder that is referenced in the the âtroubleshootingâ URL normen has reffered me to, After you uninstall JME. Then I reinstalled JME and my Libs jar is back to normal. Now that my Libs jar is back to normal, I can see the path of all the Jars it needs.
For reference, on Mac, the âlibsâ path that Nehon is referring to on Mac default install is:
Thanks again. I gotta reinstall NBAndroid and Android SDK, Iâll be back later in the week with more questions. This topic resolved, thanks for all of your help.