Help, tutorial3 on android donsn’t work fine





Hi.



I have interested using JME on Android Plaform.



I installed JME3 Beta and setting mobile developement and then tried tutorial 1,2,3 on PC and my Android



Phone,samsung Galaxy s2 Android 2.3.1.



Tutorial 1,2 work well on PC and Phone



but tutorial 3 doesn’t work well on my Phone.



Teapot and brickwall looks good but I can see only ninja’s outline.



I think that xml models are not suppotted in my phone.



so I convert them j3o but they show same result.



I am newbie and starter. I think that I did something do wrong but I don’t know what is wrong.



Please give me some comment,or URL for help.



Sorry my bad english,I am not native.



Thank you.



Here are full code.It works well on PC


package mygame;

import com.jme3.app.SimpleApplication;
import com.jme3.font.BitmapText;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;
import com.jme3.math.ColorRGBA;

/** Sample 3 - how to load an OBJ model, and OgreXML model,
* a material/texture, or text. */

public class Main extends SimpleApplication {

public static void main(String[] args) {
Main app = new Main();
app.start();
}

@Override
public void simpleInitApp() {

viewPort.setBackgroundColor(ColorRGBA.Blue);

Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
Material mat_default = new Material(
assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
teapot.setMaterial(mat_default);
rootNode.attachChild(teapot);

// Create a wall with a simple texture from test_data
Box box = new Box(Vector3f.ZERO, 2.5f,2.5f,1.0f);
Spatial wall = new Geometry("Box", box );
Material mat_brick = new Material(
assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat_brick.setTexture("ColorMap",
assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg"));
wall.setMaterial(mat_brick);
wall.setLocalTranslation(2.0f,-2.5f,0.0f);
rootNode.attachChild(wall);

// Display a line of text with a default font
guiNode.detachAllChildren();
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
BitmapText helloText = new BitmapText(guiFont, false);
helloText.setSize(guiFont.getCharSet().getRenderedSize());
helloText.setText("Hello World");
helloText.setLocalTranslation(300, helloText.getLineHeight(), 0);
guiNode.attachChild(helloText);

// Load a model from test_data (OgreXML + material + texture)
Spatial ninja = assetManager.loadModel("Models/Nin/Ninja.j3o");
ninja.scale(0.05f, 0.05f, 0.05f);
ninja.rotate(0.0f, -3.0f, 0.0f);
ninja.setLocalTranslation(0.0f, -5.0f, -2.0f);
rootNode.attachChild(ninja);
// You must add a light to make the model visible
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
rootNode.addLight(sun);

}
}

Looks weird. Are there any errors in the log?

There are no error messages while building this project and sending to phone but few warnings are shown.

I don’t know why only ninja’s textures are not shown. It is related these warning? oops…


Importing rules file: toolsantmain_rules.xml
Creating output directories if needed...
Compiling aidl files into Java classes...
Compiling RenderScript files into Java classes and RenderScript bytecode...
Generating R.java / Manifest.java from the resources...
MyGame.compile:
Compiling 1 source file to C:ProjectsBasicGamemobilebinclasses
Converting compiled files and external libraries into C:ProjectsBasicGamemobilebinclasses.dex...
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xmlpull.v1.builder.impl.XmlDocumentImpl$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xmlpull.v1.builder.impl.XmlElementImpl$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xmlpull.v1.builder.impl.XmlElementImpl$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.xmlpull.v1.builder.impl.XmlElementImpl$3) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

When I mean log, I mean the log from the application as it is running on the Android device

Unfortunately there is no log for my phone when I was running tutorial.

But when I did capability test in phone test shows only [GLSL100].



Is it normal?



When i did graphic test in my computer test shows many result:

[FrameBuffer, FrameBufferMRT, OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120, VertexTextureFetch, FloatTexture, FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer, NonPowerOfTwoTextures, MeshInstancing, VertexBufferArray]



I guess that galaxy s2 graphic capablility is locked or unusable.

Hi rygui,



If you connect your phone via USB with USB debugging turned on on your phone, you can use the adb program from the android-sdk platform tools to view the log as you run the app.



Just run:



adb logcat



and it will show you a running log from your phone.


  • Damyon
damyon said:
Hi rygui,

If you connect your phone via USB with USB debugging turned on on your phone, you can use the adb program from the android-sdk platform tools to view the log as you run the app.

Just run:

adb logcat

and it will show you a running log from your phone.

- Damyon



Just a note on this, you'll want to filter by System.out as well to see the jME logging
1 Like

Hy Guys… I’m having a problem when run my aplication in android. These error reports shown when i execute.

/Model/rei.obj: com,jme3.asset.AssetNotFoundExeption

Exeptino thrown in Thread[GLThread12,5,main]:

at com.jme3.asset.DesktopAssetMAnage.loadAsset(239)

at com.jme3.asset.DesktopAssetMAnage.loadModel(376)

at com.jme3.asset.DesktopAssetMAnage.loadModel(386)

at com.jme3.app.SimpleApplication.initialize(230)

at com.jme3systerm.android.OGLSEContext,initInThread(266)

at com.jme3systerm.android.OGLSEContext.onSursfaceCreated(217)

at android.opengl.GLSurfaceView$GLThread. guardedRun(1317)

at android.opengl.GLSurfaceView$GLThread. run(1116)

@luancomputacao said:
Hy Guys.... I'm having a problem when run my aplication in android. These error reports shown when i execute.
> /Model/rei.obj: com,jme3.asset.AssetNotFoundExeption
Exeptino thrown in Thread[GLThread12,5,main]:
at com.jme3.asset.DesktopAssetMAnage.loadAsset(239)
at com.jme3.asset.DesktopAssetMAnage.loadModel(376)
at com.jme3.asset.DesktopAssetMAnage.loadModel(386)
at com.jme3.app.SimpleApplication.initialize(230)
at com.jme3systerm.android.OGLSEContext,initInThread(266)
at com.jme3systerm.android.OGLSEContext.onSursfaceCreated(217)
at android.opengl.GLSurfaceView$GLThread. guardedRun(1317)
at android.opengl.GLSurfaceView$GLThread. run(1116)


This is quite a different question than was asked in this thread. Please create a new thread and post your code as this should be easily fixable.

Have the same problems with this tutorial like ryugj.

(My Phone Galaxy S2 Android 2.3.3)



When I built and run the third tutorial then I only see the lil wall. No Ninja, no Teapot.

http://i.imgur.com/VXy7V.jpg

(Sorry for bad quality)



When I capture a screenshot via jMonkey IDE then I get the following:

http://i.imgur.com/HGoB9.png



On Desktop-run-config everything works perfectly.



hmmm, any idea why there are such graphic-issues?



By the way for the game I want to develope I need some Terrain.

But neither the terrain tutorial (tutorial no. 10) nor the jmeTest.apk from the market worked correctly.



Terrain tutorial:

http://i.imgur.com/uqq0h.png



Market jmeTest.apk subapplication helloworld.HelloTerrain :

black screen



Also the demo JME Test > light.TestLightRadius does not show any lights.

Maybe the terrain, the teapot and the Ninja aren’t visible because the “lightsource” didn’t work correctly on SGS2.

What do you think?

I got the same problem using Lighting.j3md based materials on other Galaxy S2 phones.

Regular Unshaded.j3md materials work just fine.