C:\>SRCHARCH.EXE "android"

Cuttlefish Engine Update

| August 14th, 2009

I posted a lengthy Q & A about my upcoming Cuttlefish Engine – a cross platform cell phone game engine for iPhone, Android, and Blackberry – over on the Cuttlefish Industries blog, for all you cell phone game makers.

So I’m toying with the idea of writing a game – I’ve got a pretty good idea that, more importantly, has remained a pretty good idea for the last few weeks. Simple to implement, fun to make, fun to play. I should be happy, but I’m not.

I’m tearing myself apart trying to decide which platform(s) to create it for. For starters, there’s the obvious: the iPhone. Tons of free engines and code samples make creating a game for the iPhone a no-brainer. Unfortunately, that means there are thousands upon thousands of them, and getting any sort of attention in that crowded market would require more work to market and publicize than it would take to actually create the game.

Then there’s the G1 – its hardware is on par with iPhone, yet it has a much smaller user base. This is a blessing and a curse – less users means fewer sales but less competition. Same deal with Blackberry – I don’t have the numbers to back this up but my hunch is that the number of iPhone users dwarves both the number of G1 and Blackberry users. At any rate, Don’t Dial iPhone is outselling Don’t Dial G1 by at least a 10:1 ratio (but, that’s with a very iPhone-centric marketing effort). Maybe with some G1 exclusive marketing I can get that to 5:1.

The Blackberry has in its court a much less crowded market, and a push for quality (RIM has explicitly said they’re not going to tolerate the crap apps that Apple does). Also, I’d be a fool to sell my game for anything above $1 on Apple’s app store, but I could sell for $3, maybe $5 on Blackberry and remain competitive. G1 is probably the same story, but muted slightly due to the number of free apps, as well as the G1’s open source spirit, which attracts a user base that’s a bit less comfortable with paying for apps.

The really discouraging thing is that technically, the three platforms couldn’t be farther from each other. Don’t Dial has taught me that getting any meaningful code sharing across all three platforms is difficult if not impossible. I’ve toyed with the idea of building a cross-platform metalanguage that would “compile” down to ObjC or Java code, but doing that is a lot of work, and then you have to abstract all the functionality of the APIs you need.

Someone, somewhere, is doing this, or will be soon, so there’s that too – should I develop my own abstraction, or wait until one gets released? The phonegap guys are making good progress, but they’re all Javascript, which makes sense for web apps, but for games is a harder sell.

Lots of questions, very little answers.

More Android Morsels

| January 11th, 2009

Finishing off my port now! Once it’s done I’ll do the whole “Android vs. iPhone” breakdown, but for now here’s just a few more gotchyas you may hit:

  • If you want to start an activity, remember that you have to add it to your app’s XML manifest file. Don’t worry, it only takes you a few iterations on “run, get exception, wonder why, remember” until you mind remembers to do this. It’s be great if some Java guy could integrate this into Eclipse so that when you created a new class you could have it automatically insert it.
  • URIs are not strings. To get from a URI to a string, use toString(). To go the other way, use parse().
  • Want to pop up a message box? In Android the class you need is AlertDialog. Here’s some sweet sample code:
    new AlertDialog.Builder(this).setTitle("Title").
    setMessage("Yo").setPositiveButton("OK",
    new DialogInterface.OnClickListener()
    { /* whatever */ } ).show();
    

    I found that code on the anddev forums. Message boxes were tricky to figure out because there used to be a different way to show them that was removed as the SDK matured. Also check out how the click listener method is specified via anonymous delegate.

Hello, Android!

| January 5th, 2009

I’ve started porting my iPhone app to Android/G1 in anticipation of Google’s market for paid apps launching later this quarter (I want to be in on the ground floor!) Java is very C# (actually, that’s incorrect, since most of the awesome stuff in C# was blatantly ripped off from Java, which had it years if not decades before but ANYWAY) – Here’s how I’ve started on Android and how others might want to start:

  1. go to code.google.com/android and go through all 4 steps of the getting started. Pay your $25 and if you can stomach it, plop down another $400 for the Android Dev Phone, which is an unlocked G1 with a cool skin.
  2. Download and integrate into Eclipse a package called CDT – C++ Development Tools. It comes with a DevStudio keyboard configuration that’ll save you some sanity; Eclipse is huge, and the keyboard shortcuts aren’t intuitive. For example, Ctrl+Tab and Ctrl+Shift+Tab don’t cycle between windows (which is what finally led me to find out about CDT).
  3. download DroidDraw, which is the best GUI drawing tool (like Interface Builder or the Design View of C#) that I’ve found. That isn’t saying a lot though, this tool is still young and cantankerous, but at least it gives you a graphical view of the XML files that Android uses for UIs.
  4. This site (www.androidph.com) has lots of code snippets to look at. Also check out AndDev, which has some cool tutorials and a good community going.
  5. Tell me about other things you find! :)