Unfortunately,
I have a problem but this time with Nifty api always about loading an image ( I decidedly do not have luck 
the way in my xml file is good, and I apply the same procedure as you said for png files, I copied my png file in the asset folder of the mobile folder that corresponds to my file path, but it do not always want to work, I clean and build and I AssetNotFoundException on android , for against AC works perfectly for other textures on 3D objects and when I test a sample that does not charge a png image with the xml file, example a button with nifty , ca works perfectly.
my xml file:
<? xml version = “1.0” encoding = “UTF -8” ? >
< nifty xmlns = " http://nifty-gui.sourceforge.net/nifty-1.3.xsd "
xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance "
xsi: schemaLocation = " http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd ">
<screen id=“start” controller=“mygame.Main”>
<layer id=“layer” childLayout=“center”>
<image filename=“Interface/fong.png”> < / image >
</ layer >
</ screen>
</ nifty >
Java code :
public class Main extends SimpleApplication implements ScreenController {
private TerrainQuad terrain;
Material matRock;
Material matWire;
boolean wireframe = false;
boolean triPlanar = false;
protected BitmapText hintText;
PointLight pl;
Geometry lightMdl;
private float grassScale = 64;
private float dirtScale = 16;
private float rockScale = 128;
private Nifty nifty;
public static void main(String[] args) {
Main app = new Main();
app.setPauseOnLostFocus(false);
app.start();
}
@Override
public void initialize() {
super.initialize();
loadHintText();
}
@Override
public void simpleInitApp() {
setupKeys();
// First, we load up our textures and the heightmap texture for the terrain
// TERRAIN TEXTURE material
matRock = new Material(assetManager, "Common/MatDefs/Terrain/Terrain.j3md");
matRock.setBoolean("useTriPlanarMapping", false);
// ALPHA map (for splat textures)
matRock.setTexture("Alpha", assetManager.loadTexture("Textures/Terrain/splat/alphamap.png"));
// HEIGHTMAP image (for the terrain heightmap)
Texture heightMapImage = assetManager.loadTexture("Textures/Terrain/splat/mountains512.png");
// GRASS texture
Texture grass = assetManager.loadTexture("Textures/Terrain/splat/grass.jpg");
grass.setWrap(Texture.WrapMode.Repeat);
matRock.setTexture("Tex1", grass);
matRock.setFloat("Tex1Scale", grassScale);
// DIRT texture
Texture dirt = assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg");
dirt.setWrap(Texture.WrapMode.Repeat);
matRock.setTexture("Tex2", dirt);
matRock.setFloat("Tex2Scale", dirtScale);
// ROCK texture
Texture rock = assetManager.loadTexture("Textures/Terrain/splat/road.jpg");
rock.setWrap(Texture.WrapMode.Repeat);
matRock.setTexture("Tex3", rock);
matRock.setFloat("Tex3Scale", rockScale);
// WIREFRAME material
matWire = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
matWire.getAdditionalRenderState().setWireframe(true);
matWire.setColor("Color", ColorRGBA.Green);
// CREATE HEIGHTMAP
AbstractHeightMap heightmap = null;
try {
//heightmap = new HillHeightMap(1025, 1000, 50, 100, (byte) 3);
heightmap = new ImageBasedHeightMap(heightMapImage.getImage(), 1f);
heightmap.load();
} catch (Exception e) {
e.printStackTrace();
}
/*
* Here we create the actual terrain. The tiles will be 65x65, and the total size of the
* terrain will be 513x513. It uses the heightmap we created to generate the height values.
*/
/**
* Optimal terrain patch size is 65 (64x64).
* The total size is up to you. At 1025 it ran fine for me (200+FPS), however at
* size=2049, it got really slow. But that is a jump from 2 million to 8 million triangles...
*/
terrain = new TerrainQuad("terrain", 65, 513, heightmap.getHeightMap());
TerrainLodControl control = new TerrainLodControl(terrain, getCamera());
control.setLodCalculator( new DistanceLodCalculator(65, 2.7f) ); // patch size, and a multiplier
terrain.addControl(control);
terrain.setMaterial(matRock);
terrain.setLocalTranslation(0, -100, 0);
terrain.setLocalScale(2f, 0.5f, 2f);
rootNode.attachChild(terrain);
DirectionalLight light = new DirectionalLight();
light.setDirection((new Vector3f(-0.5f, -1f, -0.5f)).normalize());
rootNode.addLight(light);
cam.setLocation(new Vector3f(0, 10, -10));
cam.lookAtDirection(new Vector3f(0, -1.5f, -1).normalizeLocal(), Vector3f.UNIT_Y);
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
inputManager,
audioRenderer,
guiViewPort);
nifty = niftyDisplay.getNifty();
nifty.fromXml("Interface/welcome.xml", "start", this);
// attach the nifty display to the gui view port as a processor
guiViewPort.addProcessor(niftyDisplay);
// disable the fly cam
// flyCam.setEnabled(false);
flyCam.setDragToRotate(true);
inputManager.setCursorVisible(true);
}
public void bind(Nifty nifty, Screen screen) {
System.out.println("bind( " + screen.getScreenId() + ")");
}
public void onStartScreen() {
System.out.println("onStartScreen");
}
public void onEndScreen() {
System.out.println("onEndScreen");
}
public void quit(){
nifty.gotoScreen("end");
}
public void loadHintText() {
hintText = new BitmapText(guiFont, false);
hintText.setSize(guiFont.getCharSet().getRenderedSize());
hintText.setLocalTranslation(0, getCamera().getHeight(), 0);
hintText.setText("Hit T to switch to wireframe, P to switch to tri-planar texturing");
guiNode.attachChild(hintText);
}
private void setupKeys() {
flyCam.setMoveSpeed(50);
inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T));
inputManager.addListener(actionListener, "wireframe");
inputManager.addMapping("triPlanar", new KeyTrigger(KeyInput.KEY_P));
inputManager.addListener(actionListener, "triPlanar");
}
private ActionListener actionListener = new ActionListener() {
public void onAction(String name, boolean pressed, float tpf) {
if (name.equals("wireframe") && !pressed) {
wireframe = !wireframe;
if (!wireframe) {
terrain.setMaterial(matWire);
} else {
terrain.setMaterial(matRock);
}
} else if (name.equals("triPlanar") && !pressed) {
triPlanar = !triPlanar;
if (triPlanar) {
matRock.setBoolean("useTriPlanarMapping", true);
// planar textures don't use the mesh's texture coordinates but real world coordinates,
// so we need to convert these texture coordinate scales into real world scales so it looks
// the same when we switch to/from tr-planar mode
matRock.setFloat("Tex1Scale", 1f / (float) (512f / grassScale));
matRock.setFloat("Tex2Scale", 1f / (float) (512f / dirtScale));
matRock.setFloat("Tex3Scale", 1f / (float) (512f / rockScale));
} else {
matRock.setBoolean("useTriPlanarMapping", false);
matRock.setFloat("Tex1Scale", grassScale);
matRock.setFloat("Tex2Scale", dirtScale);
matRock.setFloat("Tex3Scale", rockScale);
}
}
}
};
}
Thank you in advance, because I read the manual and look nifty on the forum and nobody seems to have this problem to load a png image 