Jme programming: arm + opengl es?

Hi,

id like to use a tablet (android) for programming with jme. I do know that using android for programming is no good idea but ive seen former android tablets running linux distros like ubuntu. I was looking for a comfortable mobile device to read and code on and a tablet is arguably more appealing than a notebook. Id like to wait for tegra3 and install ubuntu or suse. Are there arm builds of jme ? Since its opensource: How much trouble is it, to create one ? And finally : Does jme run on opengl es hardware ?



Please dont misunderstand me: I know that a tablet is -at least today- not as fast as a notebook and that the most convenient solution would not be a tablet. However I can stand a few fixes and some startup trouble. Id just like to know if its possible, and if yes, if I can be productive with it.



Thanks in advance.

Well, remember there are two parts of JME3 - the SDK and the engine.



The SDK is based on Netbeans - as there is no version of Netbeans that runs on Android, there is no JME3 SDK that runs on Android.



Yes, in theory given an Android text editor and a compiler you could still develop on Android. However, I suspect that the way Android handles per-app file system permissions would leave you unable to do much useful - I stand to be corrected however. If you wanted to do this, you would in for the long haul!



JME3 itself, the engine, runs on Android just fine.



If you havent bought the tablet yet, I would consider looking at a netbook such as the Asus 1215B. Not only will it be faster than any existing tablet, it also has a non Intel integrated graphics chip, meaning JME3 will actually run (hopefully) without any issues. I would think it is still small enough to be used on your lap.



Just curious - how would you plan to develop, if you were able to develop using a tablet? Lying in bed? Sitting on the couch?



EDIT: Nevermind, I didnt understand your post properly. You want to run Ubuntu on a tablet and develop on that. So what you need is Netbeans compiled for the ARM CPU architecture and Linux platform. To my knowledge, I am pretty sure there is no JME3 SDK for that combination. A brief search didnt turn up any hits for Netbeans running on ARM either - however I think the bulk of Netbeans is written in Java, so you might be lucky. As long as there is an ARM JVM, it shouldnt be too much trouble. depending on how much native code Netbeans uses.

JamVM is a VM for arm, what you would have to do is write a renderer for OpenGLES (probably you can copy the android renderer pretty much 1:1), the SDK, yeah… It needs much more than just a processor and a gpu ^^ If you have a proper desktop environment with JDK, swing etc etc its no problem, but no arm platform supports that afaik.

The only obstacle I see is the native libraries which are only compiled for x86/x64 currently. LWJGL recently added support for ARM and OpenGL ES, however jME3 only supports regular OpenGL on desktop. You will need to port the Android OpenGL ES implementation to desktop OpenGL ES which should be (from what I see) just changing the imports.

1 Like

@Momoko_Fan that sounds good though I don’t exactly understood what I’m to do. Do I only have to change the imports of my project or do I have to dig deeper ?

@zwillenguru said:
@Momoko_Fan that sounds good though I don't exactly understood what I'm to do. Do I only have to change the imports of my project or do I have to dig deeper ?

Deeper, yeah. You'll have to 100% understand the engine and what a renderer is supposed to do and then implement that.. Or just install android on that ARM device and use the SDK to deploy there.

You will definitely need to know what you’re doing. You will need to compile LWJGL for arm and you will need to port the android renderer to LWJGL’s OpenGL ES implementation which is probably more different than I mentioned in my previous post

Hm, that’s settled then. Sadly I definitely don’t have the knowledge to get that to work.

Is support for arm in the pipeline ? I think this will come in handy in the future as more arm devices get the performance. At least when windows 8 with arm support is published. The future is interesting: arm with tegra4, etc or x84/x64 with ivy bridge and -in due time- haswell… I don’t think tablets will leave us soon.

Wow, let’s assume that jme3 would run on your tablet! Could you describe your setup and how you would want to code on your tablet?

Yeah, it runs fine on arm, Tegra or what have you… On ANDROID!

I like the methods being discussed here and think it’s worth perusing …

However for the original question of running jMonkey on Android tablets or phones I can say that “it’s been solved” yep, I’ve been working in the shadows for many a moon on porting jMonkey onto mobile without losing compatibility with developing on a PC and I can tell you all that so far I’ve booted jMonkey on two rooted Android phones (an Epic 4G and a myTouch 3g) with two different Java JDK’s to solve the dependencies.

I’ve two methods that work; both requre that you have an Android (rooted) with Linux installed properly on it (I use Debian Kit after years of searching and testing)
Method one involves OpenJDK installed through apt-get; is manual; you the user inputs all the commands to install everything, then it’s a happy dev experiences

Method two involves Java’s JDK for ARM; is “automatic”; you the user downloads a tar.gz file (Java source file) and a script, then you run the script I wrote and have not only a happy dev experience but also the JDK from Java runs the jMonkey’s processes a little quicker

Links to how I Solved it and how you can too

http://hub.jmonkeyengine.org/forum/topic/raspberry-pi/
and here (guide to installing Linux on Android ((hint: use Debain Kit)) for beguiners and masters alike)

and here (if you’ve got Java’s JDK “tar.gz” file downloaded on your sdcard ((raspberry pi or android)) and Linux then run this script under a “normal user” account with “sudo” permissions)

~~ Hint for running script; hit “y” or “yes” the first time (when the script asks to unpack itself) , then hit “n” or “no” to abort the “auto-run” , then check out the components , make changes if you need to or want to , then run “Script_Runner” to run the modified version back in “auto-mode” , this can also be useful if you are interpreted for some reason and wish to “pick up” where it left off

---

That may be all well and fine in text to say but wait I've got more :-D
Screen caps of what it looks like to connect into a rooted Android phone running Linux and then running jMonkey on top of that

jMonkey_ARM_Starting
https://docs.google.com/file/d/0B46yVbeWkbYKZXViZGMzeUVBVWc/edit?usp=sharing

jMonkey_ARM_Started
https://docs.google.com/file/d/0B46yVbeWkbYKTFgwdE0wMjRRQWs/edit?usp=sharing

Note: the system runs just fine on the devices' screen too, I just find it's easier to do the RDP thing to do the screen caps; RDP is one of the benefits of running a full desktop in ones' pocket because you can connect locally or remotely with "ok" to little latency. 

...
and yes I've posted that it's likely to be "solved" for running on Pi as well. This is because the versions of Linux that I'm running on my Android are nearly 100% cross compatible; meaning that I have yet to find anything that a Pi owner can do that I can't then do on Android after a little wile ;-) and the same is so far true in the revere.

Happy hacking and modding all, I'll be back from time to time if anyone has questions related to this content and you all can contact me through XDA (S0AndS0) or Google (Michael NA) too if it's really important.
6 Likes

@SoAndSo Thank you for the tips. It would be probably easier to run JME3 SDK under Android with some real JavaSE support (not just Dalvik). zwillenguru seemed to look for a solution to use this SDK under a Linux distro supporting ARM.

I have to clarify an aspect. The addition of some OpenGL-ES support in JOGL started in 2008 and JOGL 2.0 has supported it very well for about 4 years but I don’t remember whether I added the JARs for ARM into JMonkeyEngine 3. If someone needs to use the renderer based on JOGL 2.0 with this architecture, let me know.

<cite>@gouessej said:</cite> @SoAndSo Thank you for the tips. It would be probably easier to run JME3 SDK under Android with some real JavaSE support (not just Dalvik). zwillenguru seemed to look for a solution to use this SDK under a Linux distro supporting ARM.

I have to clarify an aspect. The addition of some OpenGL-ES support in JOGL started in 2008 and JOGL 2.0 has supported it very well for about 4 years but I don’t remember whether I added the JARs for ARM into JMonkeyEngine 3. If someone needs to use the renderer based on JOGL 2.0 with this architecture, let me know.

Very welcome :smiley:
You are correct; it is far easier to run with full Java support.
The solutions that I offer are spicifficly for zwillenguru and anyone else that wants jMonkey and Java on their ARM Version of Linux… android or pi. Check the script out, there be links directly to where to download the JDK from orical :wink:

Yeah I’m pretty sure jMonkey 3 (the one that my script will download and install) has support for making projects that can then be run on android as an App. I’ll be linking in and editing up the Google doc guide to include some of the steps to start your first project, save it and or export and then run it all on the device that it was compiled on, and how to easily transfer your projects from the mobile device to a PC for those that work in a team.

I have been and will continue to work hard on making this as easy as possible for new mobile developer. Thanks for the comments and I hope I was able to clarify some of this for ya too :slight_smile: I’ll be back after work if there’s any follow up needed

1 Like

fyi, @DragonEagle did something slightly similar to this already:
https://play.google.com/store/apps/details?id=com.firethorn.pocketgamestudio
http://hub.jmonkeyengine.org/forum/topic/an-early-look-at-pocket-game-studio/

So how is this different from the standard deploy to android? The fact that it’s running in a full JVM with all the stuff google left out?

<cite>@erlend_sh said:</cite> fyi, @DragonEagle did something slightly similar to this already: https://play.google.com/store/apps/details?id=com.firethorn.pocketgamestudio http://hub.jmonkeyengine.org/forum/topic/an-early-look-at-pocket-game-studio/

And us looking for someone to take it over so I can focus on school.

<cite>@zarch said:</cite> So how is this different from the standard deploy to android? The fact that it's running in a full JVM with all the stuff google left out?

it actually doesn’t run in a full JVM. It runs in Dalvik using beanshell with some rather interesting stubs for the user code.

I’m trying to understand the selling point. What’s the gain here over the standard android deployment from the SDK? Why/when would someone use this instead?

Basically so you can develop directly on the android. I came up with the idea when I was stuck in a hospital bed for 4 days with nothing on me but my phone and I kind of got… well… bored.

@erlend_sh
Wish that I had known about that app. Though it looks like there are differences in how the App and how jMonkey gets to a “result” and I’m wondering now about compatibility of the project files; can they be trasnfered back and forth without having to run some kind of conversion so that PC and Android development is seamless? I ask because currently the system I use and have documented to develop jMonkey projects while mobile or on a PC there is no issues with transfering project files between devices and would not want to give that up.

@zarch
There should be no difference in running jMonkey on PC or Android with my method. The JDK from Java is designed for the ARM processors, the script installs “Java 7u21 soft float ARM JDK for Linux” and then installs Java dependent software, all of the software “believes” that is processes are running on a PC even though they are not on a PC anymore :wink: this is kinda like an emulator and rom setup in the way the we are tricking software to run where it wasn’t intented but not like an emulator because we’re not emulating any hardware to get the job done… its a bit confusing when one “zooms in” on what’s going on to make the magic happen… I’ll try to outline it


Android device (rooted)
~ Android OS
~~ Android services and apps

~ Linux OS
~~ Linux services and apps
~~~ full desktop GUI, ssh, RDP, all the benefits of a home PC
____________________________________________________________

These two separate OS's share space and resorcess on one device at the same time (you can hit your "home" button and still get back to text, email, and such) and if you've got a device with better than 1 ghz you shouldn't experience any major lag on either OS (I've tested this as low as a 600MHz processor and still had everything "functioning" for the most part) furthermore, when near a PC you can RDP into Linux running on Android and "dual-screen" it up ;-) which is how I took the screen shots displaying that jMonkey's dev kit works on Android for developing on the go ... this is the key point, running the kit not the things that it builds because I know that jMonkey already is great at outputting software for other platforms to run but to run the kit on anything other than normal PC processors natively and fully up until recently hadn't been done as far as I can find. Note with the method I use everything is as "native" to the mobile hardware as possible. I started with "full emulation" using QEMU but found the power drain and slowness of running every (yes every) process first through emulation was just not "cost effective" after months of testing the new system I'm running with which doesn't use emulation; I can say that power drain is minimal and responiveness is almost up to expectations.

Pocket game studio is not project-compatible to the jME SDK, no.