Your thoughts on a plan

For discussions about game development that does not fit in any of the other topics.
Post Reply
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Your thoughts on a plan

Post by Jackolantern »

Ok, due to time constraints coming up in the next couple of months, I decided to put a Node.js-based MUD engine on the back-burner for right now. I still love the idea but I won't have the time to complete even half of the features to make it competitive against established MUD engines.

I decided to go back to an old stand-by with mobile development, in particular Android. But now what has been frazzling my brain is whether to use the regular Java path, or an HTML5 path. Since I don't plan on making any 3D games for quite some time, OpenGL ES and native C/C++ code is of no importance. But basically here is how I break both down:

Java for Android:

Pros:
* The most supported, obviously.
* Access to all native and Google APIs, for things such as location services, Google Maps, etc.
* Access to all hardware functionality, such as GPS, accelerometer, NFS, and more.
* Possibly better performance.

Cons:
* Sometimes dealing with poor design decisions (more on that below).
* Performance out of Java may not be much be much better than HTML5, since best performance is with OpenGL in C.
* Poor porting path to other platforms. Basically stuck as Java for Android.

HTML5 for Android:

Pros:
* Most apps and games do not need more than HTML5 provides.
* App Mobi tools claim to bridge the gap to native functionality.
* Much better path to being cross-platform. iOS, WP7, Blackberry versions and others will in some cases be a button click away.
* Future platforms are aiming square at HTML5, such as Windows 8 and Firefox Mobile OS.
* Apps can be posted to the web with the same code.
* Simpler development.

Cons:
* Less support and community. Whether using App Mobi or Phone Gap, that is basically your entire community.
* Access to native and Google APIs may be limited.
* Access to some hardware beyond the touch screen will be limited.
* Potential for slightly lower performance.

When I mentioned occasional poor design choices, check out this Dalvik Java code:

Code: Select all

@Override
protected Dialog onCreateDialog(int id) {
      switch (id) {
      case 0:
         return new AlertDialog.Builder(this)
         .setIcon(R.drawable.ic_launcher)
         .setTitle(“This is a dialog with some simple text...”)
         .setPositiveButton(“OK”,
             new DialogInterface.OnClickListener() {
                 public void onClick(DialogInterface dialog, int whichButton)
                 {
                      Toast.makeText(getBaseContext(),
                      “OK clicked!”, Toast.LENGTH_SHORT).show();
                 }
              }
          )
         .setNegativeButton(“Cancel”,
             new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int whichButton)
                  {
                        Toast.makeText(getBaseContext(),
                        “Cancel clicked!”, Toast.LENGTH_SHORT).show();
                   }
              }
          )
          .setMultiChoiceItems(items, itemsChecked,
               new DialogInterface.OnMultiChoiceClickListener() {
                     public void onClick(DialogInterface dialog,
                     int which, boolean isChecked) {
                          Toast.makeText(getBaseContext(),
                                items[which] + (isChecked ? “ checked!”:” unchecked!”),
                                Toast.LENGTH_SHORT).show();
                           }
                      }
             ).create();

            }
            return null;
       }
}
The astute Java or C# devs out there probably can spot that this is creating XML from a mile away. You may have even picked up on what it is for. You know what it does?

It is displaying a dialog box with 3 strings and a radio group. Yes, I am serious. Basically the same dialog you can create in .NET in 2 lines of code takes this whole ugly garbled mess in Android because the UI is completely made of XML. Wow, I wish JSON had come first so we didn't have to deal with XML. In HTML5 the same results could be done so much more cleanly in about 1/3 the lines or less.

Anyway, does anyone have any input on the Android app path? I am really leaning more towards HTML5 at the moment. I already own Impact and an App Mobi XDK account, so either way I go is no cost to me. It just seems like things are easier the HTML5 way, plus the added bonus of extremely cross-platform compatibility with 1 set of code. 8-)
The indelible lord of tl;dr
User avatar
Ark
Posts: 427
Joined: Wed Jun 01, 2011 10:25 pm

Re: Your thoughts on a plan

Post by Ark »

For me HTML5 is the way to go. You can also use CocoonJS to make an .apk file for android. Right now CocoonJS can only make files for android, and not for IOS.

*By the way you can download bio lab distaster on the play store which used CocoonJS. It also supports multitouch on the screen!
Orgullo Catracho
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Your thoughts on a plan

Post by Jackolantern »

Thanks! Interesting, as I had never heard of CacoonJS. It seems to be a competitor to App Mobi :)
The indelible lord of tl;dr
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Your thoughts on a plan

Post by OldRod »

I think at this point, HTML5 is the way to go. I'm not that familiar with app mobi or cocoonJS, but from everything I've seen lately, HTML5 is growing in support
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Your thoughts on a plan

Post by Jackolantern »

Yeah, I think HTML5 is the way for me, too. There are so many other pluses to it, such as cross-platform deployment and of course, deployment to the web :) Thanks guys!
The indelible lord of tl;dr
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

Re: Your thoughts on a plan

Post by Xaleph »

Well, I agree the code looks quite messy, and I wouldn`t want to write that code that way. I would use the built-in drag-n-drop tools for eclipse. It delivers the code. However, I too would go for HTML5 if you want to deploy cross platform. However, if you would only do some Android work, i`d recomend Java. Simply because everything is already out there for devs to use. If you did want to create some graphics-accelerated works, do it in C++.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Your thoughts on a plan

Post by Jackolantern »

Very true. And to be honest about Dalvik Java, that code is for programmatically creating a dialog box. The parts of the UI (views) you can make as part of a layout are quite easy and the ADT plugin for Android development in Eclipse is awesome, and head-and-shoulders above what any other platform has for native app development (even more so than Visual Studio for Windows Phone 7). However, there is no way to create that code ahead of time because the idea is that you will build it with runtime data. You are stuck with that monstrosity.

The idea is that I started wanting to specifically go after Android since that is my main device at the moment (an Asus Eee Pad Transformer tablet), but making apps cross-platform and being able to use the same codebase in multiple app stores has quite a nice ring to it ;) I have an iPod Touch to test on, but not a Mac to compile native iOS apps. That is hopefully where App Mobi's cloud compilation services will come into play. Being able to spread apps on both app stores surely couldn't be a bad thing!

I may come back to accelerated OpenGL Android development down the line, or perhaps even Unity for Android for 3D games. There is definitely something to be said about the raw power in both approaches.

I think I am going to go the HTML5 way. I have been refreshing on the Impact documentation today, and have a basic game idea that is not too complex to try first. I will be fleshing it out over the next week or so 8-)
The indelible lord of tl;dr
Post Reply

Return to “General Development”