jme3 android helloworld

hi there

i was trying to make a small app to test jme on android



i created a new project under eclipse with these settings:



project name:  helloWorld

build target: android 2.2

application name: test

package name: com.jme3.app

create activity: helloWorld



the project got created… then in the buildpath i added  jMonkeyEngine3.jar

and finally i’ve choosen one of the jme3 test:  i  copied the content of  jmonkey/source/jme3test/collision/TestSimpleCollision.java

into my newly created project helloWorld.java source file…



when i tryed to run it, i got and error from AndroidManifest.xml saying:

com.jme3.app.helloWorld does not extend android.app.Activity AndroidManifest.xml /helloWorld

line 8 Android XML Content Problem



looking at the source, indeed, i can see it extends SimpleApplication instead of Activity

what am i doing wrong ?

could someone help and show how to create a jme-helloworld for android ?

just so we can see how things need to be setup ?

tnx






The Android package is a bit out of date with jME3 currently (we'll be working on this very soon) but one simple idea might be to try extending Application and then just instancing SimpleApplication's derived class from within main()

thanks for the quick reply!

though, i was wondering if you could elaborate just a little bit more?

like, how using "extends Application {…} will resolve the manifest problem, it's complaining about the app not using "extends Activity {…} " ?

and what SimpleApplication's derived class are you refering to ?



tnx




Nah, if you just downloaded the normal version of jme3 it wont work. Atm, for android support you have to compile jme3 yourself, adding the android packages and removing the desktop packages.

freeaks said:

thanks for the quick reply!
though, i was wondering if you could elaborate just a little bit more?
like, how using "extends Application {..} will resolve the manifest problem, it's complaining about the app not using "extends Activity {...} " ?
and what SimpleApplication's derived class are you refering to ?

tnx


Pro Tip:  Don't post when you're very tired :D  I meant to say extending Activity, but no.. that wouldn't solve the manifest problem.  The SimpleApplication derived class is essentially what you already have there (its the thing in your screenshot extending SimpleApplication!)

All that said though, Normen is right.  I do think the android sources are a little out of sync at the moment, but normen or momoko should be able to clear this up

I've actually gotten the android package to compile last night with the latest sources. So, it won't be long until its up to date.

@all

thanks for the replies



so i take it i'd need a specific version of jme compiled for android ?

momoko_fan, any chance you're making available your updated build  ?



another question:

my goal for using jme on android is to make a 2d platformer with accelerated graphics,

so i'd need jme collision detection and image,sprites,animations handling features…

maybe there a way i could already use only some bits of jme without requiring a full jme-android port ?

would you think that would be possible ?



anyway congrats for all the hard work and jme3 alpha release :slight_smile:

Yes, the jme part will be basically the same on deskrop and android so you can start coding right away :slight_smile:

great

i'll start working on it then…

tnx