Androidharness not working

well the issue is. that it doesnt start its internal activity when i extend that class, when i run the debugger the activity is still set to null. ive read though the tutorials and nothing explains this issue, or im missing something. ive imported the jmonkeyengien3.jar and JME3-android.jar into the project.

It seems you missed somethink start it like i did :wink:

I give u a link in a sec, are you writing code with sdk or other ide?

Try this:
how to with eclipse

If you prefer to do catch something from your android system (Activity) in your game:
You need to do this

If you make a terrain with terrain editor dont forget that:
correct the black texture

If this post was helpful, rate it :wink:

i tried with eclipse at first just importing the jmonkey jar and the jmonkey android jar. dunno but some jars you can import and some it will not work. now im trying the jmonkeyplatform but that is giving me issues with the android imports. also if i use the jmonkeyplatform i cant use the avd emulator right?
the error i get is a classnotfound error when i run the project in the emulator after

this is the error i get now from the jmonkey ide
[java]
/home/toor/Desktop/Jmonkey/JME3Android/nbproject/mobile-impl.xml:10: The following error occurred while executing this line:
/home/toor/Desktop/eclipse/android-sdk-linux/tools/ant/build.xml:962: The following error occurred while executing this line:
/home/toor/Desktop/eclipse/android-sdk-linux/tools/ant/build.xml:973: The following error occurred while executing this line:
/home/toor/Desktop/eclipse/android-sdk-linux/tools/ant/build.xml:312: [/java]

but thanks i will try out your links and see what happens

You don’t need to import jME3-Android.jar to the project, read the manual on deployment. Just make a normal BasicGame project and check the Android checkbox in the project preferences.

okay, but still is it possible to test it out on a android emulator or do i need to install the apk on my phone every time i want to run a demo?

and why wouldnt this work. simple and easy to use. still gives me

[java]
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
startActivity(new Intent(this, GameActivity.class));
}
[/java]
[java]
public class GameActivity extends AndroidHarness {
Game game;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
game = new Game(this);
game.start();
}
public GameActivity () {
appClass = com.example.jmonkey.Game.class.getName();
screenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
}
}
[/java]
[java]
public class Game extends SimpleApplication {
private Context mActivity;

public Game(Context activity){
    mActivity=activity;
}
@Override
public void simpleInitApp() {
	
}

}
[/java]

[java]
09-19 06:20:35.220: E/AndroidRuntime(1093): FATAL EXCEPTION: main
09-19 06:20:35.220: E/AndroidRuntime(1093): Process: com.example.jmonkey, PID: 1093
09-19 06:20:35.220: E/AndroidRuntime(1093): java.lang.NoClassDefFoundError: com.example.jmonkey.GameActivity
09-19 06:20:35.220: E/AndroidRuntime(1093): at com.example.jmonkey.MainActivity.onCreate(MainActivity.java:15)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.app.Activity.performCreate(Activity.java:5231)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.app.ActivityThread.access$800(ActivityThread.java:135)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.os.Handler.dispatchMessage(Handler.java:102)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.os.Looper.loop(Looper.java:136)
09-19 06:20:35.220: E/AndroidRuntime(1093): at android.app.ActivityThread.main(ActivityThread.java:5017)
09-19 06:20:35.220: E/AndroidRuntime(1093): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 06:20:35.220: E/AndroidRuntime(1093): at java.lang.reflect.Method.invoke(Method.java:515)
09-19 06:20:35.220: E/AndroidRuntime(1093): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
09-19 06:20:35.220: E/AndroidRuntime(1093): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
09-19 06:20:35.220: E/AndroidRuntime(1093): at dalvik.system.NativeStart.main(Native Method)

[/java]

Please, do read the manual on android deployment: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:android

You just press the “run” button the the SDK to run the project on your phone (or emulator if no phone is connected). Its advised to use a phone for testing though as the emulator doesn’t work well for 3D applications.

yah i have read that and dont think ive missed anything. when i press my run button it opens the normal gameview with the JVM and not the AVD. i cant use usb to connect to my phone since the android sdk doesnt support that on linux. ive done pure opengles programming and have not noticed any problems with the emulator yet.

but im not able to install the android plugin

“The Plugin Installer found problem timeout of loading Android Project[org.netbeans.modules.android.project/1.249] while install the following plugins:”

Maybe read again, you have to select the “Android Device” profile next to the run button…

Why do you have to install any plugin? Its installed by default.

yes i have done all that, im not a total loser.

and the tutorial mentioned a android plugin in that link you posted

screenshot

also is there a jmonkey api reference page? where you can see all classes?

My question was why do you have to install the plugin, everything you need is installed in the 3.0 SDK distribution. The NBAndroid is an OPTIONAL addition to get code completion for the android part of the files and its not maintained by us.

The SDK allows you to see the javadoc of the engine, see Help->Javadoc References or just press Ctrl-Space when you have your cursor on a class name in the editor.

“Activating the nbandroid plugin in the jMonkeyEngine SDK is optional, but recommended. You do not need the nbandroid plugin for Android support to work, however nbandroid will not interfere and will in fact allow you to edit the android source files and project more conveniently. To be able to edit, extend and code android-specific code in Android projects, install NBAndroid from the update center”

still the AVD doesnt come up, i have the correct path to my sdk i can open the sdk manager from the jmonkey sdk but when i run it its still the JVM that starts

And you did select the “Android Device” entry in the dropdown? And use the run button?

yes, check the screenshot

I can’t see from that how you run the application but if you use the run button then I don’t know what the issue is in your setup. Make sure the default device or emulator is set in the AVD, try running the android run targets directly by right-clicking the build.xml. Good luck.

thanks, i had some premission errors. im at “Waiting for device to be ready… Connect your device now if its not connected yet.” now in the execution. now its waiting for my damn phone and still no avd. do you have to change the build config to find the avd or something, you said it would find it if no phone was connected

ahhhhhhhh, okay think this might work. thanks dude^^

java.lang.UnsupportedOperationException: OpenGL ES 2.0 is not supported on this device…
i know for a fact it does support it, ive added permission in the manifest. ive tried opengles 3.0 on the same device and it worked

Never had this problem. Do you use a device now?