Android Studios Setup

Hi I am wondering how to setup Android Studios so I can use the JM3 SDK in Android Studios or if thats is even possible.I downloaded one jar file of the engine and it only contains tester classes while I downloaded another and it was a directory with a series of c files.

I am pretty sure that you can’t do that!

Why not using the SDK for development? What are the advantages of using AndroidStudio instead of in your point of view?

Well I just didn’t know. My initial goal was to make a dice simulation for D&D dice. Originaly I just wanted to use a hashing algorithm with a random number generator and an animation. Then it mutated to using a physics engine to simulate the dice itself with an alternate function that can use that hashing algorithm with numbers printing out. If I can develop outside of android studios and then insert the creation in android I may just do that.

Howdy Friend,

I have gotten an Android Application to run in Android studio and it is quite a chore.

The only pro to Android Studio development is the fact you have more control over the Android part of your project (As it’s your entire project.)

The JME SDK (The Custom NetBeans IDE) has a feature to allow for easy pc and android deployment.

If you’d like a basic application to work in the JME SDK Simply:

  1. New Project → Basic Game
  2. Download the Android SDK
  3. Tools → Plugins → Download Android Plugins
  4. Libraries → Add Library → JME Android Libraries
  5. Properties → Compile → Uncheck “Compile on Save”
  6. Properties → Android → Select SDK Folder
  7. Properties → Android → Select Target
  8. Clean and Build

Now under your configuration options you have the ability to test on an “Android Device”

Pressing run will run the device on the local AVD (Android Virtual Device), or by simply plugging in an Android device via USB that has “Developer Mode” enabled in the device’s settings.

Android Studio:

1. Create New Project and add All needed Libraries
2. Place the JME Android Harness in the project's files.
3. Have your MainActivity extend Android Harness
4. In the constructor set the MainActivity "appClass" to your projects Main Java (eg. appClass = "mygame.Main";)
5. Build

It has been over 2 years since I've attempted the Android Studio thing. It may take some further trouble shooting and much more work on your part. You'll also have to edit the Android Manifest to name the MainActivity.

In short, your Android Manifest will point to your MainActivity which will have extended Android Harness. Set this Objects appClass to your project’s Main in the Constructor of the MainActivity.

Assuming I haven’t forgotten everything and it’s correct, it should work in Android Studio.

I still suggest the JME SDK.

Thanks for reading

3 Likes

Hello
I am confused where to get the libraries for Android Studio. Could you elaborate it a little more?

here you have a sample project working with android studio

HEre you have a lot of example of JME applications on android

thanks to @iwgeric

1 Like

not working Android says framework detected. Clicking on the message it gives error. And ask to install missing platform and sync it but doing so it gives same platform missing error.

the example is using platform v23.
If you don’t have it you can either download it (though android studio allows you to do that), or you can change the version of the platform in the app/build.gradle

First of all, apologies for resurrecting the thread but I think it fits perfectly for the situation.

I have fetched the example projects mentioned by nehon and everything seems fine and working. However, I find one thing missing, namely – the separation of the “core” (or “desktop”) and “android” parts of the application, which I found to be so much of comfort when I was developing for android under Eclipse with JME some time ago. The separation made it possible to launch the application on desktop, without the hassle with the android emulator or device since the application itself was written in the platform-agnostic manner (providing I abode in the limitations for Android, but that was never nearly an issue). The provided projects, however, enforce to use an emulator.

If some one is also going the AndroidStudio way, could you please share some advice on how to better organize the same structure in it? I could try inventing something, but I am not a regular user of IntelliJ IDEA or Gradle, and may be unaware of customs and practices for it, so I’d appreciate an insight from someone who knows how to do this the best way.

Namely, what I want to be able to do – is to launch the application in the desktop mode for the most part of development and debug.

PS: for some super-awkward reason, adding the “main” function to the main class of the app and starting it as usual, simply does not do anything :confused: the build passes, the debugger shows that the execution follows the steps, but then it simple ends, no application is ever opened :confused:

1 Like

Well I missed the exact same thing when I tried it. I tried to launch the app the regular way and hit some snag too. I didn’t dig too much though. There must be a way.

Ah, right! Well, I figured it at the end :smiley: Found some info in some article. Here’s the GitHub repo with the working thing: