It requires someone familiar with these programs_Eclipse + jME3 + Android + JNI/NDK.
If you can help you do not need to know anything about the wiki or asciidoctor. Just post your changes here in plain text and I can take it from there.
Also note that Android Studio isn’t Eclipse based anymore but IntelliJ, so a guide for IntelliJ (if not already in place, don’t know) would also be nice
Well I do know all of the above and am just now looking at the link, and will see what I can do and will update you on that with the caveat that I “absolutely” (no offence to anyone) can not stand eclipse though have been forced to use it in contracts so I’ll give it a try but no promises…
If this needs to be changed into a different page altogether that’s ok to. We have a eclipse page for building the engine, but nothing for Android so that would be intellij?
Edit: That would mean this page is completely worthless now then?
The SDK currently only works partially, due to bugs in Netbeans which aren’t resolved yet and I also think the folks using Gradle, because the “NBAndroid” (Netbeans Android Integration Plugin) might be using Ant, could not build for Android either.
So in the short term the way to go is using the SDK for a project and then importing/converting it to Android Studio to deploy.
We have the SDK part here but I would think its not correct either based off what @Darkchaos is saying.
A intellij specific page would be perfect and I can make it wiki usable for you if you want to just write the text for it. Can either message me on it or post it here.
I think the community would be glad to have both based on the popularity of Android the amount of posts I have seen.
Sure. I’ll write it here and we can go from there. In android studio it’s just a matter of invoking an android harness class as opposed to a main(string… args) static method. Its actually really simple. Ill write it. Oh. Reminder to self. Xml files.
Well, my point was you were essentially complaining about having to use Eclipse to help… but you don’t have to use Eclipse to help since Eclipse isn’t used anymore.
I just figure maybe you misunderstood.
At least, that’s how I interpreted this:
Which is fine because you won’t need to use Eclipse.
Steps to create a working environment for Jmonkey in Android Studio.
Steps:
Create a class that extends SimpleApplication
Create a class that extends com.jme3.app.AndroidHarness and reference our SimpleApplicaton extended class in the provided protected fields.
Declare the class that extended AndroidHarness in AndroidManifest.xml
An example class that extends SimpleApplication. Note that we have no static void main(String[] args) but we can still use the noArgs class constructor.
package com.jayfella.motorunner;
public class JmeGame extends SimpleApplication {
public JmeGame() {
// super(new AppState[0]);
}
@Override
public void simpleInitApp() {
// 0, 0, 0 reference
Box box = new Box(1, 1, 1);
Geometry geom = new Geometry("box", box);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
rootNode.attachChild(geom);
}
}
An example file that extends AndroidHarness. Note that we reference our SimpleApplication extended class here and use protected fields to set any AppSettings.
package com.jayfella.motorunner;
import android.os.Bundle;
import com.jme3.app.AndroidHarness;
import java.util.logging.Level;
import java.util.logging.LogManager;
/**
* Created by James on 12/01/2018.
*/
public class JmeHarness extends AndroidHarness {
public JmeHarness() {
// Set the desired EGL configuration
eglBitsPerPixel = 24;
eglAlphaBits = 0;
eglDepthBits = 16;
eglSamples = 0;
eglStencilBits = 0;
// Set the maximum framerate
// (default = -1 for unlimited)
frameRate = -1;
// Set main project class (fully qualified path)
// the class that extends SimpleApplication
appClass = "com.jayfella.motorunner.JmeGame";
// Set input configuration settings
joystickEventsEnabled = true;
keyEventsEnabled = true;
mouseEventsEnabled = true;
// Set application exit settings
finishOnAppStop = true;
handleExitHook = true;
exitDialogTitle = "Do you want to exit?";
exitDialogMessage = "Use your home key to bring this app into the background or exit to terminate it.";
// Set splash screen resource id, if used
// (default = 0, no splash screen)
// For example, if the image file name is "splash"...
// splashPicID = R.drawable.splash;
splashPicID = 0;
// splashPicID = R.drawable.jme_white;
// Set the default logging level (default=Level.INFO, Level.ALL=All Debug Info)
LogManager.getLogManager().getLogger("").setLevel(Level.INFO);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
}
Declare the class to launch on start in ./manifests/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jayfella.motorunner">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
// the entry point class that extends com.jme3.app.AndroidHarness
<activity
android:name="com.jayfella.motorunner.JmeHarness"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<!-- Tell the system that you need ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
</manifest>
The XML file is essentially the start point for all android applications. The XML file launches the JmeHarness class that you provided. The JmeHarness class sets AppSettings and states the class that extends SimpleApplication. The SimpleApplication class is then invoked with the given settings. Game on.