requst for newbie overview tutorial on porting options

It would be nice to have in one place a tutorial on the current porting options (java to android, java to ios).

I’m seeing, for example, in going from Java to ios:

  • hand write code yourself (maybe not a terrible option, given Obj-C has a fair bit structurally in common with Java due to SmallTalk roots, but of course depends on the scale of the game and the use of libraries)
  • Avian
  • RoboVM
  • LibGDX
  • java2objc
  • multistep sort of thing: java to javascript/android, then javascript to obj-c as there are possibly more JavaScript to iOS options than from Java?

But for a Newbie, there is a lot of issues and steps involved that aren’t immediately made clear by going to the various home pages for these resources. For example, if an embeddable VM has a reduced set of Java implemented, how are graphics and other IO (sound, mouse, touchpads, etc.) dealt with in each option?

Just an overview would be good, no need to get too detailed.

I’d write it myself if I were capable, but I don’t have the needed knowledge. I’m pretty sure there are folks here that are well acquainted with the options and pros & cons of each.

I can guarantee I’d be one of the first to “appreciate” this if it were available. (Maybe there is already link at JGO I’ve overlooked?)

Hey philfrei,

Check out Codename One:

You write your code in Java using the Codename One API:

Then it converts the code to NATIVE code on each device! :slight_smile: They support Android, iOS, Windows Phone, Blackberry, J2ME, and JavaSE…hopefully I’m not forgetting anything. lol

Best part, IT’S FREE and Open Source! For building you upload your code to their servers and they build it and then send it back to you. They do limit the number of builds per month to avoid abuse of the servers. Paid accounts have unlimited builds, so that’s an option too.

There are some things Codename One doesn’t support like some low level java API’s (such as low level audio) but they do allow you to write your own interfaces where you can write native code for each device and include it in your program. In this case you would have to write native for every device you want to support, but the code would only be a small fraction of re-writing your entire program native.

Check it out, that’s what I plan on using for my phone app unless I’m able to find something better…which is unlikely as I’ve looked at some other options already. Codename One looks really great!

Also, I should say that I haven’t really used Codename One yet. I’m still developing my prototype with Java before going mobile. But I’ve watched most of the demo and tutorial videos they have on youtube and I’ve posted a few questions on their forum where the creator of Codename One (Shai Almong) is extremely active and helpful there and can pretty much answer any question you have…seriously, the guy is a super genius! 8)

@tekkerue

I’m probably at fault here, but why codenameone sounds very phishy. Free? Open source? Sounds like they are trying to get a lot of developers to depend on them, and then make everything not open source and not free. Wouldn’t it be easier and better to let developers download the compiler and build the code themselves? (You know, like all the other most used compilers)

Feel free to educate me, this is just my opinion.

trollwarrior1,

They say it will always be free. :slight_smile:

“Our client side product is 100% free and open source and will always remain as such. We also offer free & community accounts for basic usage, this free account can be used to create commercial royalty free/ad free applications.”

I have found some blogs from searching google where they walked you through how to do offline builds with Codename One, at least on Android and iOS. But Codename One says they don’t give support for offline builds because they are difficult to do.

I’m not sure why this is so different from other mobile dev tools. Codename One is certainly doing a lot more by developing for every mobile platform, but as to HOW they compile and all that…I don’t know. That would be a good question for their forum.

I just don’t see how it’s better than libGDX.

BurntPizza,

Interesting…libGDX, was not one of the options I looked into. I will have to look into that more and see. Looks quite promising after an uber fast google search.

How is the building process? Having to upload/download builds to/from the Codename One servers was really the only issue I had from looking into Codename One. But I haven’t spent any time actually working with it yet screwing around with their GUI builder…which is pretty slick! :slight_smile:

You can do libGDX the old way, downloading a zip of the libs srcs, etc. or you can be cool and use gradle which handles everything for you. Either way there is also a project setup gui which is basically idiot proof.

:clue: ??? :clue: ??? :clue:
Ok, I understand that using LibGDX requires the use of graphics commands that are unique to LibGDX, that are built upon OpenGL. Correct? Now, if you have already written graphics via Java2D in a “core-Java” game, the rewriting for the graphics is kind of a big deal, due to the fact that OpenGL is not exactly object-oriented. There are structural differences. Correct?

If you use Avian as an embedded VM, does anyone know how graphics are done? Avian does not include Java2D. I’m sorry if this is a totally noob question, but I am new to the concept of embedding VMs.

Similarly, several have mentioned RoboVM. Is that also a VM? I got confused and thought that I could use it to crank out code that I could then deliver to an Obj-C programmer. Is it actually a VM that runs Java? The mention there is a Java-to-ObjC bridge, so does that mean one will be required to rewrite the graphics to make use of the graphics commands provided by that bridge? If so, how does that compare to rewriting to LibGDX/OpenGL?

My immediate concern is simple 2D stuff, no 3D.

I don’t know about Avian, but I do know that RoboVM isn’t a VM, but is a tool for compiling java bytecode into iOS natives (via xcode). It’s what libGDX uses to target iOS.
Yes, you have to write your graphics using the frameworks’s paradigm. For libGDX that’s often lots of Sprites, shaders if you need them, etc.

Looking through the libGDX api, I see what you mean about the graphics being very different philfrei.

Codename One maybe a better option then, it uses the standard Java graphics options.
https://codenameone.googlecode.com/svn/trunk/CodenameOne/javadoc/com/codename1/ui/Graphics.html

I’ve tried to find some comparisons between these two, but not much luck on a detailed feature comparison. A basic platform difference is Codename One supports Windows Phones where libGDX doesn’t, and libGDX supports HTML5 where Codename One doesn’t. Other than that I did find a brief mention that libGDX is geared towards “games” and Codename One is geared towards “applications”. Unfortunately, there wasn’t any more information given than that…so I’m not exactly sure what specific differences that includes.

For me, I’ll probably stick with my original plan of using Codename One. I’m very new to the graphics end of things and I’d rather not have to start over and learn an entirely new platform once I get my basic Java prototype finished. I’ll just have to deal with the inconvenience of having to upload/download builds to their server.