Cross-platform mobile app development

I’m going to set aside a little time each week to blog about my experiences with developing Pintley. This is the first in hopefully a long-running series 🙂

Not long ago, I chose a platform for Pintley Mobile 2.0. I had some specific criteria, and not all of these apply to everyone.

  • Must be a native app-store app
  • Must use native-looking UI controls. An iPhone app needs to look like one, and an Android app needs to not look like an iPhone port. Nobody wants to be using the ported version, and reinventing the UI wheel isn’t for me. If you are trying to make your app hire one of these mobile application development companies.
  • Must perform, even last-gen phones
  • Must support at least iPhone & Android, possibly Blackberry, Palm, Win7

I spoke to an app developer about it and he suggested I looked into writing the app in HTML, and then just putting a “native” wrapper around it. I took a hard look at other apps that do this, and realized two things. First off, the performance just wasn’t quite there. These things responded like web pages, and that just wasn’t what I was looking for. The second problem I realized was that because it was HTML for multiple platforms, I would be facing the same headaches as HTML on the desktop… browser standards compliance & implementation. There are a couple platforms out there, like jQuery Mobile and Sencha Touch, but both platforms are not quite there yet, and would require heavy CSS trickery to “look” like native apps.

I took a look at Flex 4.5 & AIR Mobile, but the UI controls look like Flex controls, not native. Also, there’s no public info on if or when the iPhone Packager will be updated to support Flex 4.5.

Building both the iPhone and Android apps in their native languages and then maintaining both versions was cost-prohibitive.

I eventually settled on Titanium from Appcelerator. This neat little platform lets me build applications in their javascript-based language, which then gets compiled to a native application. It’s similar to how Flex works, in that you write your MXML, which is converted to Actionscript, and then compiled to a SWF. Titanium compiles the .js files to platform-native code (ObjC or Java), and then uses that platform’s SDK to compile to a native app. Yes, that means that there’s an abstracted framework sitting inbetween your code and the final compiled product. Yes, I’m sure that comes at a performance penalty. However, I really didn’t run into any big performance issues. The abstracted framework is there, but remember that framework is written in the platform’s native language.

Titanium’s SDK has been a breeze to pick up. My knowledge of Actionscript/Javascript really comes in handy, and if you’ve done a decent amount of work with jQuery you’ll feel right at home with Titanium. My main complaint is with the documentation… it’s a little inconsistent at times. For example, there are UI components in the main UI namespace (Titanium.UI) that are iPhone-only. Other iPhone-only UI components are in the iPhone namespace (Titanium.UI.iPhone or Titanium.UI.iOS). The documentation also fails to mention that these components are iPhone only… You don’t find out until you build it for Android and it crashes. The Kitchen Sink example project, however, is kept pretty up-to-date, and provides you with real working samples of how to get things accomplished.

Titanium’s IDE is exactly like whatever you currently use to modify javascript…. Mostly because they don’t have their own IDE. I have chosen to use Aptana Studio with an autocomplete header file. There’s also a bundle for TextMate.

The basic process for mobile app development is this:

  1. Install the iOS and/or Android SDK’s, and Titanium
  2. Create a new project, or import their Kitchen Sink Example
  3. Edit the .js code in your IDE of choice
  4. Hit the compile button in the Titanium Desktop application. This compiles the app and installs/runs it on your simulator or device.

The Titanium SDK is free and open-source. I, however, opted for the $200/mo professional option. The main reason is this option gives, among other things, access to their Appcelerator-moderated Helpdesk section, which has a two-business-day turnaround. I’ve easily saved $200 worth of time & headaches with my questions there, and you probably could, too. I don’t know if I’ll maintain the subscription past the launch of Pintley Mobile 2.0, but we’ll see.

So, follow me into my journey into building Pintley Mobile 2.0 for iPhone and Android.

Apple’d and loving it

I’ve just realized that over the past 12 months I’ve gone Apple. It started innocently enough with a Juniper iTunes credit card and an iPhone on launch day last June. Then an Apple TV found it’s way into my home. Eventually, a MacBook and a Mac Pro followed suit.

I have to say I’m impressed with all my Apple products. Here’s a quick review roundup:

My iPhone gets plenty of use at home and on the go, and if the next version only adds in 3G and GPS, I won’t even be all that tempted to upgrade. It’s so much better than any previous phone I’ve owned, and AT&T’s customer service isn’t nearly as bad as it was in the Ameritech/SBC days. I can’t wait till the API is finally released and the 2.0 software comes out. I’m sure my wallet will take a beating that month. Interestingly, I use the iPod functionality less than I did my old iPod.

My Apple TV probably gets the least use of all my gadgets. We have ditched out Netflix subscription (kept forgetting to send movies back), and decided to put that money towards rentals & tv shows. Between the Apple TV and my Xbox 360, we could get pretty much anything except Smallville and NBC shows. Combine this with the rewards my Juniper iTunes card gets for just paying monthly bills with it, and we get quite a deal.

My MacBook is the surprise of the bunch. For many years, I’ve only had 17″ laptops. Unfortunately, the $2,800 Macbook Pro was out of my price range, and there were some great deals on MacBook refurbs, so I picked one up. I was pleasantly surprised that the screen size wasn’t that big of an issue. The real surprise was how quick and light, and long lasting this thing is. Sure, I’m not going to get any modern 3D game to run on it, but it’s almost half the weight of my previous laptop, and the battery life is amazing. I guess the LED backlighting really paid off. I was also able to improve laptop gaming performance on my new laptop. Having a lot of computer geeks friends who love Apple products I can say that the Mac Pro is, well, awesome. It’s great to run three virtual machines, plus all my development servers and software, email and still not break a sweat. It’s replaced three physical machines (dev/file server, photo server, and workstation), so I’m saving on electricity and space. The keyboard is surprisingly awesome to type on, though the Mighty Mouse doesn’t like to always tell the difference between a left and right click.

What’s left to be assimilated? Well, I want to upgrade my wireless network to N, and the likely candidates are an AirPort Extreme and AirPort Express to bridge some HD-capable streaming to my Xbox. My wife likely won’t be switching anytime soon, and is plenty powerful with XP for the internet/email/light web dev she does. Our daughter, however, will probably inherit this MacBook in a few years and eventually get an iPod.

Big Fat iPhone SDK “gotcha”

So I had an idea for a great iPhone app that now appears will never happen.

Why, you ask? Because Apple wants to have super-strict control of the user experience. The problem is hidden in the documentation… A nice little limitation that gets but a paragraph mention.

The iPhone will only allow a single 3rd party application to run at a time, and they also disable the ability to run an app in the background. My idea required an app that would run whenever the phone was on. Guess if I wanted to do anything, I’ll have to jailbreak my iPhone after all.

How does this impact the average user? This means no (useful versions of) instant messangers, listeners for push-based services, rss notifications, or anything else that the user would like to happen when they’re not actively using the application. This more or less limits the iPhone SDK to games and a few business applications.

Flash on the iPhone?

First time I’ve heard rumors that Flash was actually on it’s way to the iPhone.

I have faith that this will happen, even if it has to wait till Adobe gets access to the SDK along with the rest of the world. Let’s hope it’s already done, and they’re just testing it.

iPhone Google Maps using outdated data!

So, I was going to a party this past weekend, and I forgot to grab directions. No problem, I’ll just pop the address into my TomTom Go 700. Uh oh, the address can’t be found. Well, that’s ok… I saw the house on Google Maps online, I’ll just look it up on my iPhone.

Except when I looked it up, the Maps application couldn’t find it. I eventually figured out that it wasn’t me, it was Google Maps.

I tried again today, using the 1.1.3 iPhone update with the new Maps application, and still no dice. Eventually, I figured out that the iPhone’s Google Maps phone is outdated.

Check out this link in on you computer:

Elkhorn, WI

Now check it out on you iPhone. Sure enough, there’s an entire subdivision that’s missing. Now why would Google even bother keeping two sets of data? Wouldn’t the far better idea be to just use an internal API to reference the master data?

How incredibly frustrating.