Wednesday, May 30, 2012

Which thing to use: phonegap or codename one?

I have been puttering around with Phonegap and then I stumbled upon CodenameOne. Both are frameworks for making applications for mobile devices and will run on Netbeans (although Android support for Netbeans could be better). So which leads us to the question of the moment: which thing to use?

Let's start with what's common with the two:

1. One code base for almost all mobile platforms: IOS, Android, Blackberry and Windows Phone. PhoneGap is the only one that (right now) supports Windows 7. CodenameOne promises to support it soon. CodenameOne now supports Windows Phone.

2. Both use the pay for building app model. Assuming that you are using the free account; With Phonegap you are limited to 1 app/1 collaborator while CodenameOne limits you to 100 build credits every month and 1 app at the time.

PhoneGap Codename One
IDE Support Optimal on Eclipse; Can be used on Netbeans but stifled because of Netbean's weak support for Android. Has an excellent plugin for both Eclipse and Netbeans
Tooling HTML5, CSS and JavaScript Just Java
Supports IOS, Android, BlackBerry, WebOS, Symbian, Windows Phone IOS, Android, BlackBerry, J2ME, Windows Phone
Documentation Excellent Also excellent
Feels like ...making a website; lots of JavaScript ...old school Swing desktop development

So which one to use? Truth be told, that depends on what you are comfortable with. If you're an old hand with Java and you want to make mobile applications then (I suggest that you) go with Codename One but if started out as a web developer then you might want to go with PhoneGap.

Although both fill the mobile development niche, but have different approach vectors. Different strokes for different folks.

Sunday, May 20, 2012

Be a game programmer they said

Be a games programmer they said. It's going to be fun they said.

Making games from scratch 10 years ago was hard. Try reading Tricks of the 3D Game Programming Gurus-Advanced 3D Graphics and Rasterization by Andrew LaMothe. The Math alone will make you cry, I did. I thought making a game for Android will be equally as hard. Glad to know there's AndEngine.

AndEngine is a framework for building games on the Android platform. It provides a lot of abstractions so as a programmer you don't have to deal with the low-level details. I particularly like the AndEngine physics extension - rolling your own physics engine is no walk in the park.

A few pointers on getting started with AndEngine:

1. You'll need an actual phone for this. The AndEngine examples can't run on the virtual devices since they can't support the OpenGL stuff.
2. AndEngine is designed for 2D not 3D.
3. As for the turtorial, when done you will get errors. Don't just give up, troubleshoot it. Giving up? What's the fun in that?
4. AndEngine is open-source.

Now, what game should I be making? Any suggestions?


Friday, May 4, 2012

My week of Sproutcore and Netbeans

After running around with knockout, I decided to try out sproutcore for a week. The first task was getting it installed. My dev maching is running the lastest from Ubuntu (I think its 12.04 LTS). My install experience wasn't exactly pleasant. I followed the Sproutcore's install guide to the letter and it resulted is a dozen or so of can't compiles and missing libs - I did fix the errors eventually.

With my Sproutcore running, I started following the tutorials and by the "TodosThree" part I was writing a fair amount of JavaScript. I need an IDE for this work - Netbeans.

Sproutcore and Netbeans

Netbeans doesn't officially support Sproutcore but that isn't really a problem. Sproutcore is like 95% JavaScript and Netbeans has excellent JavaScript support. It's just a matter of "creative" use of Netbeans. The trick is to create a "PHP Application with Existing Source" and point it to your Sproutcore project folder. Here's the procedure:

  1. New Project > PHP Application with Existing Source
  2. Sources Folder should point to your Sproutcore project folder (not the apps folder)
  3. Change the Project URL to https://localhost:4020 also remove the index file
  4. And your done!
As for the rest like running the "sproutcore gen app" commands. You'll have to run that outside Netbeans and on the terminal. Its not really a big deal. 

BTW, code intellesense amazingly also works, I didn't expect it to work but it does. BONUS!