Help test jME3 on your android phone!

Thank you for your quick reply. If you could just tell me where to look for where the flipping happens, I would try to look for that by myself. The texture problem is somehow solved, it was probably an inconsistent project state on my machine. Clean build and it was gone… Anyway, apart from the font issue my biggest problem is that during material rendering the material technique FixedFunc is not found. I did not find any reference in the sources concerning FixedFunc, it's just mentioned in the material files. Or am I missing a definition file?



Please don't see this as a request to fix that. I really like to work on it by myself but I just need a hint where to look at. If you could just name the classes to look at or shortly outline what mechanism seems to be broken. That would be so cool.

One of the material definitions you're trying to use doesn't have a FixedFunc technique. The FixedFunc technique is required for the JOGL renderer on desktop and the OglEs renderer on Android.

For most techniques it is easy to add a FixedFunc technique, just put

Technique FixedFunc {

}



after all other techniques in the matdef. However if alpha blending or lighting is needed you'll have to add a few statements inside it.



For flipping, you'll need to request the texture to be flipped after loading by editing the TextureKey you pass to the AssetManager, use the call TextureKey.setFlipped (or similar).

Yes, that helped. Materials are loaded without error now but their color is not rendered - it's always white. Flipping also helped and the the text is readable now but the alpha blending seems to be missing - the background of the letters is always black. Thank you very much but looks like when I solve one problem then something new is coming up. Looks like the recent changes to the code base make it quite hard for the existing android code. Of course this is normal when you refactor a code base substantially. Anyway I'll try my best and I would like to ask you again if I really cannot make it by myself. By the way: did the model loading of OBJ files ever work for android? It always wants to create such huge arrays for the mesh data, that their creation is rejected although the models are rather simple.



What do you think? Should I commit my changes to the repo? It's only changes to the android code. I would like to be a contributor. I am a very experienced java dev who just recently started with android and unfortunately without any experience with open gl.



Thank you very much for your help.

I am fixing the Android part, hopefully I'll have it fully functional soon.

I saw your changes to the android code. Basically it's the same I had done. To do the flipping you should also uncomment Lines 81-91 in com.jme3.texture.plugins.AndroidImageLoader.

olafgeibig said:
(...) What do you think? Should I commit my changes to the repo? It's only changes to the android code. I would like to be a contributor. I am a very experienced java dev who just recently started with android and unfortunately without any experience with open gl.
Sorry to see a slight duplication of efforts here. Next time just post your changes to the contribution depot and if you keep committing we'll see about giving you commit access :) Thanks for the help thus far.

Hi,



I've tested your app on my android device,  Acer Liquid on android 2.1, and on a nexus one (2.1 update 1). I have the same problem on both of these devices :  no textures except for the fps.

On a Samsung galaxy (i7500) , android 1.5, : no textures at all, only white rectangles for "Fps : xx", and white balls.

On a HTC G1 (android 1.6) and HTC hero (android 1.5 and android 2.1 custom), there is no problem, your app works fine.





By the way, I'm an android developer, interested in evaluating jme3 for this platform. For now, I don't understand how to use correctly jme3_android package.

Is your app fully based on this package ?

Do I have to wait for a short or long time to correctly evaluate the package ?



I don't understand what "R.string.jme3_appclass" should refers to in "AndroidHarness.java".



Thanks.

There is no complete android project in the repo now, so lot's of things are missing. there is only the needed source code for an android app but not the infrastructure. Here is what I did:


  1. check out the jme3 sources from http://jmonkeyengine.googlecode.com/svn/branches/jme3
  2. create an android project in eclipse. Mine is called android-jme3. In the wizard use the package name com.jme3.app and the app name should be  AndroidHarness
  3. copy or symlink the basic source packages from jme3/src to android-jme3/src. If you are on linux like me you can just symlink these dirs:

      - android

      - core

      - core-plugins
  4. go back to eclipse and refresh the project. Add the copied/symlinked source folders to the build path
  5. edit res/values/strings.xml and add the key jme3_appclass where the value should be the app class you want to execute. You can use the existing tests here. Mine looks like this:

<resources>
    <string name="hello">Hello World, jme!</string>
    <string name="app_name">android-jme3</string>
    <string name="jme3_appclass">jme3test.android.Test</string>
</resources>


6. copy some of the needed resources to the assets directory. You can find them amoung the checked out jme3 sources in src/core-data and src/test-data. Essential is: cooper.fnt, cooper_00.png, font2d.j3md, plain_texture.j3md
7. As the texture used in Test.java is not checked in use just a suitable jpg file, copy it to assests and load this jpg in line where the texture is loaded: manager.loadTexture(...
8. build the project, fix the wrong package names/class names in some source files
9. uncomment Lines 81-91 in com.jme3.texture.plugins.AndroidImageLoader.
now you should be able to run it.

I hope I didn't forget anything.

Thanks for your reply olafgeibig.



I forgot to add some  data in my project, I will fix it as soon as possible :slight_smile:

Hello Momoko_Fan.



I received a message from Erlend to join jME team developing the Android abstraction layer.

First of all let me introduce myself. I'm the developer of project Angle (http://code.google.com/p/angle/). I have a lot of experience in middleware and I think I have wined all the fights with EGL Android problems.



Let me notice you some common problems you have in your code:

1.-The GC is calling every N frames.

2.-There are some multitrhead issues:

04-29 12:47:16.070: WARN/dalvikvm(25995): threadid=15: thread exiting with uncaught exception (group=0x4001e2e8)
04-29 12:47:16.070: WARN/System.err(25995): java.lang.NullPointerException
04-29 12:47:16.100: WARN/System.err(25995):    at com.g3d.system.android.OGLESContext.deinitInThread(OGLESContext.java:84)
04-29 12:47:16.100: WARN/System.err(25995):    at com.g3d.system.android.OGLESContext.onDrawFrame(OGLESContext.java:151)
04-29 12:47:16.100: WARN/System.err(25995):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1125)
04-29 12:47:16.100: WARN/System.err(25995):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:977)

3.-There is no way to suspend the device and wake it again without crashing the application
4.-You can't go to desktop (with home key) and return to application
...


But don't worry. I already solved all this issues.  :wink:

I hope you can release a stable and performance optimized version of jME with my help.

Keep working...

Works well on T-Mobile pulse with MoDaCo custom ROM, Android 1.5. FPS around 30, but it may be device limit, I don't know.

olafgeibig said:

There is no complete android project in the repo now, so lot's of things are missing. there is only the needed source code for an android app but not the infrastructure. Here is what I did:

1. check out the jme3 sources from http://jmonkeyengine.googlecode.com/svn/branches/jme3
2. create an android project in eclipse. Mine is called android-jme3. In the wizard use the package name com.jme3.app and the app name should be  AndroidHarness
3. copy or symlink the basic source packages from jme3/src to android-jme3/src. If you are on linux like me you can just symlink these dirs:
   - android
   - core
   - core-plugins
4. go back to eclipse and refresh the project. Add the copied/symlinked source folders to the build path
5. edit res/values/strings.xml and add the key jme3_appclass where the value should be the app class you want to execute. You can use the existing tests here. Mine looks like this:

<resources>
    <string name="hello">Hello World, jme!</string>
    <string name="app_name">android-jme3</string>
    <string name="jme3_appclass">jme3test.android.Test</string>
</resources>


6. copy some of the needed resources to the assets directory. You can find them amoung the checked out jme3 sources in src/core-data and src/test-data. Essential is: cooper.fnt, cooper_00.png, font2d.j3md, plain_texture.j3md
7. As the texture used in Test.java is not checked in use just a suitable jpg file, copy it to assests and load this jpg in line where the texture is loaded: manager.loadTexture(...
8. build the project, fix the wrong package names/class names in some source files
9. uncomment Lines 81-91 in com.jme3.texture.plugins.AndroidImageLoader.
now you should be able to run it.

I hope I didn't forget anything.


I got lost on step 6. I couldnt find those essential files. Also the program has a lot of errors. One of them is missing buildimporter. do you have any idea what could be wrong?

             Why they can't complete the android project? Is this project difficult? I know its hard I'm just excited what will be the result of this project.

The main reason why its not worked on anymore is because none of the developers have an Android phone to test it on (except for Skye, doesn't know how to use it), and because the emulator does not support OpenGL ES 2.0 which is intended as the minimum requirement for jME3 to run.

Momoko_Fan said:

The main reason why its not worked on anymore is because none of the developers have an Android phone to test it on (except for Skye, doesn't know how to use it), and because the emulator does not support OpenGL ES 2.0 which is intended as the minimum requirement for jME3 to run.


Well, I have an idea about how to use it, but no time to divert towards it ;)

49-60 FPS on Galaxy S Pro – Epic4G



Keyboard controls worked as expected.

using the current jme3-branch (rev 5787) I have updated the code to work with the current jme framework & test resources.  Unfortunately there are visual artifacts – black and white only.  I'll have to look at the diffs between the original posting and current to figure out what could have happened.



Shaders maybe?

hazmat said:

using the current jme3-branch (rev 5787) I have updated the code to work with the current jme framework & test resources.  Unfortunately there are visual artifacts -- black and white only.  I'll have to look at the diffs between the original posting and current to figure out what could have happened.

Shaders maybe?

Its fine that it is black and white. The OpenGL1 renderer is just not fully developed yet, and from the look of things, it might never be.
We have plans to integrate jME3 with OpenGL 2 ES (Android 2.2) though.

Well I'm up s**t creek until Samsung rolls out 2.2.  Until then I can continue porting my other app to jME3.



Attached is the diff  from /jme3-branch/src to bring the android interfaces up to current.

hazmat said:

Well I'm up s**t creek until Samsung rolls out 2.2.  Until then I can continue porting my other app to jME3.

Attached is the diff  from /jme3-branch/src to bring the android interfaces up to current.

Thanks, I'll try this diff.