Introducing BugTender: mobile Bugzilla frontend

I’ve been looking for a good solution to catching up on bug reports on my morning commute. The regular Bugzilla user interface doesn’t scale down well to mobile, and using the regular web interface is too flaky when connectivity goes in and out.

Enter BugTender: a preliminary HTML web app with a mobile-friendly interface to browse (and later, comment on & triage) your bugs.

Using HTML and jQuery Mobile lets the app run on multiple platforms and browsers — it won’t be tied to just WebKit, and works in a regular desktop browser as well. Wrapping that in PhoneGap for a ‘native app’ will allow further integration, such as access to the camera and photo gallery on iOS and older versions of Android — think uploading screenshots straight from your phone about problems in the browser!

Anyway, that’s how I spent chunks of my Thanksgiving weekend… more to come. :)

 

Canvas game tweaks

A few weeks ago I threw together a quick demo HTML canvas game ‘FlatRoller’; I’ve updated it this weekend to add a few things:

  • touch controls now work on IE 10 in Windows 8 Developer Preview on a multitouch device. Microsoft is adding yet another touch event model alongside the classic mouse & iOS-style touch events. Urgh!
  • full window is now used for the canvas; the directions and touch controls overlay it
  • visual feedback on the touch controls
  • the directions switch from showing ‘left/right’ to showing ‘jump’ as appropriate when another touch would trigger jump

It’s a little sluggish on my first-gen iPad, but runs very nice in Metro IE 10 on my Dell Inspiron Duo tablet/notebook convertible. Yay!

20111120-144301.jpg

I’ve also tried it out on my Android phone (Nexus One) and tablet (Kindle Fire), both running Android 2.3. Unfortunately both run pretty slow in both the stock browsers and Firefox, and only appear to pick up a single finger’s worth of touch events so the jump control doesn’t work.

Find source on github or play the game in browser.

 

Apple’s pricing still winning the tablet war, mostly

Apple’s long had a reputation for high prices, and certainly there have been times and product lines where that’s very true. But there are a lot of places where Apple’s prices are actually quite competitive, especially where they have a huge lead in market share.

Everybody and their brother have been gearing up for the last year to launch their “iPad-killers”; so far Apple’s iPad is pretty much the only tablet-factor computer to ever sell well in the mass market (despite — or perhaps in part because of — the iOS platform’s many odd limitations). The only one to actually reach market yet with a tablet-optimized operating system is Motorola’s Xoom which recently launched running Android 3.0 “Honeycomb”; tech specs of this and another upcoming tablets are pretty similar to Apple’s just-announced iPad 2, available March 11 at the same pricing as last year’s models.

There’s been much hoopla about price, with no high-end competitor yet coming close to Apple’s entry-level pricing. The lowest-end iPad rocks in at $499, just under the $500 “wow that’s closer to $1000 than to free!” price point.

The Xoom so far has only a single 3G+Wifi-capable model, which retails for $799 standalone. This actually isn’t insanely awful — Apple’s 3G+Wifi models can run up to $729 or $829 with larger built-in storage, while the Xoom can have storage added with an SD card, so the gap is less than that initially visible $300 if you’re going for the beefier models.

Verizon also offers a $200 subsidy for a 2-year contract, making pricing more comparable to the unsubsidized $629 base 3G+Wifi iPad. But… let’s be honest, we all have phones with 3G or 4G data plans already. Do we really need to shell out for another cellular radio and another data plan?

Which tablet will actually cost you more will depend on which one you buy and on which data plan you get, if any. For those of us who want to pass on paying for a third (or fourth …) Internet connection every month when we can already use our phones as a wifi hotspot, any data plan is a huge expense, and subsidized pricing doesn’t make up for it:

  • iPad 2 Wifi-only: $499
  • Xoom 3G+Wifi w/ 2 years contracted data plan (sticker price only): $599 (pay extra $100, but you really pay more…)
  • iPad 2 3G+Wifi w/o data plan: $629 (pay extra $130)
  • Xoom 3G+Wifi w/o data plan: $799 (pay extra $300… but Best Buy ads say you actually need to buy a month of service to activate it…)
  • iPad 2 3G+Wifi w/ 2 years month-by-month $15/mo data plan: $989-$1229 depending on taxes/fees? (pay extra $400-$600):
  • Xoom 3G+Wifi w/ 2 years contracted $20/mo data plan: $1080-$1300 depending on taxes/fees? (pay extra $500-$700; plus another $350 if you terminate contract early)

Bigger badder data plans will let either brand leapfrog the other in price, depending on where you pick em… The cheapest thing is to buy a Wifi-only iPad and donate a few hundred bucks to your favorite Free Software-related charity. :P

The most important thing to remember is that for devices that incur a monthly data plan fee, the costs of the data plan can dwarf the original purchase price. This is why so many phones are insanely cheap or “free” — carriers have spent years playing an arms race to the bottom on your initial buy-in price to make way, way more money from you in the long term.

Update 2010-03-21: Motorola has announced a wifi-only Xoom model at $599; still above the iPad 2 entry price point but MUCH cheaper than getting anything with a data plan. I’ve placed a pre-order and hope to be trying it out by the end of the month!

Release late, release rarely?

Apple’s iPhone & iPad platforms are pretty and delicious, and still miles ahead of the competition in smooth, attractive user interfaces.

But there are plenty of things to irk you as well. For web applications and Open Source developers like me, the most irksome are the limitations Apple places on software development and distribution.

Developers in the FOSS community have long lived by the motto “release early, release often”. Getting your programs into a lot of peoples’ hands early gives more opportunity for feedback; that includes direct code contributions, but bug reports and UX feedback are just as important even for people who aren’t sharing their source code! Releasing updates often gets bug fixes and new features into peoples’ hands quickly, which encourages the feedback cycle and makes for happy users.

Web developers have had the additional advantage of being able to roll out many software upgrades near-instantly to all their users: update the files on your servers and *poof* everyone using your app (“visiting your web page”) is using the latest code. If something went wrong and you introduced a bug, you can update to a fixed version or roll back to the last-good version just as quickly.

When you start pushing apps out for iPhone or iPad though… these doors are closed to you. A small fraction of users will have jailbroken the system so they can run arbitrary apps (and bully for them!) but to reach a general audience, you need to go through Apple as a middleman. To run any program on your phone, it either has to be obtained through their online store, or you need to jump through hoops with special limited-access development keys.

Aside from the ethical issues of whether it’s ok for one company to interfere in independent commerce between customers and developers, it also breaks FOSS and web-style development processes badly.

The pre-1.0 cycle becomes less useful because it’s harder to get people involved in testing and bug fixing during your early stages. You can’t even test a program on your own phone without paying Apple for access to the code-signing system, and having other people test it who aren’t also registered iPhone developers requires obtaining their device IDs ahead of each new release.

When you’re ready to push out to the App Store for wide distribution, you have to wait an arbitrary amount of time for review. That’s generally about a week of waiting, then an Apple reviewer pokes at your app for an hour or two. If you’re lucky, the reviewer confirms it looks ok and pushes it up for sale. If you’re unlucky, the nice Apple employee tells you there’s something you need to fix, and you fix it and wait another week.

If you’re extra unlucky, the nice Apple employee looks at it, decides it’s ok, and pushes it up for distribution… but it turns out you actually introduced a horrible bug that breaks the app completely for actual users. (Whoops!)

Until the fixed version gets through review, I’ve had to temporarily pull StatusNet Mobile from the iTunes App Store altogether to keep people from installing the broken version. We’re hoping that the review of the fix will go faster, or that Apple can revert our distribution to the last known-good release until it’s complete, but these options aren’t available under our direct control; I’ve asked and simply have to wait and hope.

In constrast, a web app breaking like this could have been fixed immediately, with the fix instantly visible to all users. An Android app breaking like this could be updated in the Market immediately, with users seeing update notifications within a day. A Windows, Linux, or Mac app could have a new version pushed out immediately, with probably moderately slower uptake depending on how you distribute your updates.

To be fair, Apple’s iTunes App Store system is remarkably liberal by the standards of game consoles and many older “mobile apps” models, where you need a lot more up-front negotiation & money with the hardware manufacturer or carrier. $99/year and a cut of sales for platform-exclusive sales channel isn’t awful; I’m not even sure how to find out how many hoops I’d have to jump through as an independent developer to whip up some little goodie for the Wii or Playstation 3 and get it out for legit sale to end-users.

But compared to what we’re used to on personal computers and the web, it’s extremely onerous for developers, and the side effects harm our users in directly visible ways.

Update 2010-10-25: Our StatusNet Mobile 1.0.3 update has been approved after 9 days sitting in the “in review” state without comment. It should appear in the App Store again shortly.

Beta testers for StatusNet Mobile wanted soon…

A few weeks ago, we released the first public beta of StatusNet’s dedicated desktop client for Linux, Mac, and Windows.

We’re still working on bug fixes and improvements, but we’ve also been working on a mobile version, which runs on Android and iPhone/iOS platforms (Blackberry support isn’t ready yet in the Titanium cross-platform runtime we’re using, but it should come along in a few months). If you’re really brave you can dive into the source code, but we’re in the middle of major restructurings and UI design so it’s not really usable yet. :)

Once we get the UI polished up in the next week or so, we are going to need some testers to help make sure things work on different devices, different OS versions, at different screen sizes, with different servers, etc…

If you have an iPhone or iPod Touch and want to test without being a developer yourself, you’ll need to find your device’s UDID number and send it to us; due to the way Apple’s code signing works you won’t be able to install the beta distribution unless your device’s ID was included when building the signing key.

Android users will only need to ensure that “Unknown sources” is checked in Application settings, which allows installing apps from the web as well as from the Android Market. (Some models unfortunately don’t allow changing this setting, in which case you may need to root your phone to get the beta running. Sorry!)

Particular things we’re looking for…

  • older iPhone 2G, 3G devices still running iPhoneOS 3
  • Android phones running older OS versions (1.6 or later; 1.5 does not work with our runtime)
  • Android devices with unusual screen sizes:
    • small low-res screens (less than 320×480)
    • larger tablet devices

Yet another iOS mulititasking explanation post

There’s been a lot of confusion about just how multitasking works in the iPhone’s latest iOS 4.0, and just what the limitations on background processes are. Most of the articles I’ve seen attempting to clarify it have concentrated on the addition of the new suspend state and how apps being background vs suspended vs terminated relates to the task list interface. That helps with the end-user confusion, but to me has just made it even more confusing from the developer’s perspective — I want to know what my app will be able to do in this brave new multitasking world, and what its limitations are going to be.

I’ve gone ahead and actually looked at the documentation (RTFM); here’s some notes… (Impatient readers may wish to skip to the summary at the end!)

Application state lifecycle

First, let’s go ahead and put those “background” and “suspend” states into perspective…

Not running

On screen? no
Running? no
In memory? no
Resources none

In the beginning, there was nothing… Before your application is started, it just doesn’t exist in the system yet.

An app that’s not running has no way to execute code, but popup notifications may be shown on its behalf by a registered server application or from earlier scheduling.

When your app gets launched, your code gets loaded into memory and you transition into:
Active state

On screen? yes
Running? yes
In memory? yes
Resources as you like

Your app is large and in charge! Your code and data are in memory, code is being executed, and you’ve got free control over the user interface, audio, network, etc.

There’s also an inactive state when the system takes over the UI and event loops for stuff like showing the incoming phone call dialog; your app is temporarily paused from the UI, but all your resources stay intact and you’ll get them back soon.

When it comes time to switch apps (through the home menu, task list, or programatically), your app loses control of the screen and enters the…
Background state

On screen? no
Running? yes
In memory? yes
Resources restricted*

Your code is still running, but you’ve got no access to the screen, and various resources start getting cut off. Usually this is a temporary state giving an application a chance to save data, close out unneeded resources, and generally tidy up before being suspended completely.

There are some special exceptions which can allow an app to run in background state for prolonged time, which is where the really interesting stuff comes in. We’ll get to that soon!

When we’re done with background state, the OS can put your app to bed; now it’s in…
Suspend state

On screen? no
Running? no
In memory? yes
Resources mostly freed

This is the biggest change in iOS 4: after your post-switchaway cleanup, the app remains in memory so it can be continued at a moment’s notice.

Previously, after your app did a little cleanup on the way out it would be terminated and all its memory and network resources freed. Instead, the app is now simply stopped at this point, but with the explicit warning that it may or may not ever be continued.

If the app is reactivated from suspend mode, anything you kept in memory is still there — you have a lot less work to do to reestablish your application’s running state than when relaunching the process.

But you may die before you wake, in which case you’re back to…

Not running state.

If the system needs more memory to assign to another application, or gets shut down, your suspended app will be terminated without being woken to inform it.

You need to be prepared for termination before entering suspend state… but really, you’re already writing code that assumes it could crash at any time and saves state at intervals and key points so it won’t lose user data, right? Um, right?

Background mode limitations

So just what are the limits of what you can do while running in background state? The docs mix together a lot of strict limits along with recommendations for being a good citizen; I’ve tried to split them out here:

YOU CANNOT (technical restrictions on what you can do):

  • Can’t make OpenGL calls; they will terminate your app.
  • Can’t accept new connections on a listening socket.
  • Can’t use shared system resources like the Address Book (it sounds like they might sorta work if still open, but you could get terminated if there’s a conflict.)
  • Can’t use external accessories — you must register for and handle disconnection events.

YOU SHOULD (recommendations for behaving well):

  • Should be prepared for loss of connectivity — open network connections could be torn down at any time.
  • Should save your state, since your app could be terminated due to memory pressure.
    (You should be saving state during regular operation anyway to protect against application or system crashes, power failures, etc. Programs that assume orderly shutdown are asking for trouble!)
  • Should avoid updating your windows and views; it’ll work but since your UI is hidden it’s a waste of time & battery.
  • Should normalize your UI state — cancel modal alerts, hide temporarily shown passwords, etc.
  • Should “do minimal work” while in background.

Reaching the user when not on screen

iPhone OS 2 introduced networked push notifications, where — through the magic of the internet — your app’s web services can trigger a notification dialog on the phone, even if your application is no longer running. iOS 4 extends this to local background tasks; if your app is in the background state, it can pop up a notification immediately without needing to go out to the network.

You can also schedule a future notification at any time (up to 128 scheduled per app), which will trigger even if your app has been terminated — obviously handy for alarms, calendars, and timer apps.

Notifications are limited in that they alert the user, not the app. If you were suspended or not running when the notification came, you won’t be woken unless the user pushes the button that opens your app.

When in background…

Any app can start up background task threads, which will block the background->suspended state transition.

This is primarily intended for orderly shutdown tasks, like completing that photo uploading to Twitbook or syncing mailbox state to a server after reading a bunch of messages. The system actually gives you a time limit, and will terminate your app if you don’t declare your tasks complete when the time limit’s up! Once you’re done, you’re forced to suspend… absent other triggers, your app is going to stay that way until the user switches back to it or it’s terminated.

You can also register to receive an event for “significant location updates“, which will wake or even relaunch your application when the cell network has noticed that you’ve moved a non-trivial distance. This avoids running down the battery with the GPS if you want updates but don’t really need to be watching it continuously.

Special backgrounding modes

An app can declare itself to have certain types of backgrounding characteristics, which can allow some additional behaviors in background state. Since these are pre-declared in the code-signed app bundle, you need to be aware of what affect they’ll have on your app’s runtime behavior, and will have to run the App Store approval gauntlet with an extra bulls-eye on your forehead. ;)

Background audio mode

Normally, the system audio frameworks cut you off when transitioning from active to background state. If your app is marked as a background audio app, you get two perks:

  • Audio in/out continues to work in background state.
  • Suspend is blocked while playing audio, so you can keep running in the background arbitrarily long.

If audio is not active, your app will still be able to suspend — so a music player that’s paused, or reaches the end of its playlist in the background, can free its resources.

Articles I’ve seen have had a lot of vague language seeming to indicate that apps in this mode can “only” play audio and do nothing else, which might imply that there’s some kind of wacky alternate API for bg audio — this is not true. The docs recommend avoiding unnecessary work while playing background audio to keep resource usage down, but there’s no artificial restriction beyond the general limitations on backgrounded apps.

You’ll still use the same old network interfaces, the same old audio APIs, etc; reportedly it only took an hour to port Pandora’s iPhone player to use background audio.

Background VOIP mode

The VOIP mode is really about management of long-running network clients — an actual VOIP app will probably need to also mark itself as needing background audio. Your app will still get suspended if the user switches away with no active call, but gets a few special abilities:

  • Sockets you register as VOIP control channels will stay live when your app is suspended. If data comes in, you’ll be woken up — this lets you handle an incoming call.
  • You can register a timeout to be woken at intervals, so you to send keepalive pings if needed.
  • The app is automatically launched in the background on boot, so you can connect to the server.
  • The app is automatically relaunched on non-zero exit code, so a one-off app crash won’t break the VOIP service.

Note that while this mode sounds ideal for IM/chat apps, connections to real-time update streams for social networking clients, etc, I suspect that Apple would not actually approve such apps.

Continuous location mode

Navigation apps, GPS tracers, etc may need a more direct way to monitor the GPS for location changes while backgrounded. This is similar to the background audio mode:

  • Continue to use the regular location services APIs…
  • …while you’ve got it active, suspend will be blocked and you can remain in background mode arbitrarily long.

GPS has a particularly bad reputation for running down the battery, so if you’re just looking to ping 4square or something you should probably use the “significant location updates” event registration instead.

Summary

Now that we’ve seen something about how it all works, let’s take some sample cases and ask whether they’ll actually do what we need… So what do we need?

I’m a media player (Pandora, Airfoil Speakers, etc)

  • Can I continue playing audio after switching away?
    • Yes — mark your app as requiring background audio, and it’ll stay backgrounded on switch.
  • Can I keep communicating with the network while playing audio?
    • Yes! But if you’re doing other stuff not needed for your audio and Apple notices, they may not approve your app.
  • Can I start playing audio later on after having been backgrounded, like an alarm clock?
    • No — if you’re not playing audio at switch time, you’ll still get suspended. You could schedule a local notification to alert the user and they could push a button to launch your app and then you could play the music. Ewww!
  • Can I keep a socket open to listen for other computers to connect and send me audio to play?
    • No — your listening sockets will be closed, and you’ll have been suspended anyway as above.

I’m a VOIP client (SIP clients, Skype etc)

  • Can I keep an active call going after switching away from the app?
    • Yes — mark your app as requiring background audio, and a running call will be able to keep on going.
  • Can I maintain a connection to my server to listen for incoming calls?
    • Yes — mark your app as needing VOIP mode, and set the special flag on your control channel after setting up the connection.
  • Can I be automatically launched on boot, so I can open that connection?
    • Yes — mark your app as needing VOIP mode, you’ll be automatically launched if you
  • Can I maintain a listening socket to receive direct SIP calls?
    • No — all listening sockets will be closed in the background. You need an existing connection to a server which’ll send a packet down when there’s an event.
  • Can I auto-answer calls?
    • I’m not 100% sure on this one; if the system fully foregrounds you to handle incoming events so you can show an “incoming” screen then yes, otherwise I don’t think so.

I’m an IM or social networking client (AIM, Meebo etc; StatusNet, Twitter, Facebook, etc)

  • Can I finish uploading a post in the background if the user switches apps before it’s done?
    • Yes — do it from a background task thread, and notify the system when you’re done and ready to be suspended.
  • Can I poll my server in the background to check for updates?
    • No — you’ll need to pair with a server component and use networked notifications to alert the user.
  • Can I keep a socket open to listen for real-time updates from my server?
    • No — in theory the VOIP mode would allow this, but Apple would have to approve your app’s using it for non-VOIP use.
  • Can I be woken to check status when the physical location has changed?
    • Yes — you can register for significant location updates and be woken or launched to check if you need to perform any actions.

I’m any kind of server:

  • Can I listen for clients while in the background?
    • No. Your listening sockets will be closed, and any Bonjour service stuff will be torn down.
  • Can I finish up an existing client connection after switching away?
    • In theory this ought to work, if the operation can complete in a background task thread before you’re forced to suspend.

I’m any other bit of software:

  • Can my app be woken at a specified time?
    • No. You can set a notification to display at a given time, but user interaction will be needed to wake or launch your app.

Whee!

Nexus 1 + Froyo notes & iPhone 4

The Android 2.2 “Froyo” update finally came through over the last few days for Nexus 1 owners. After a few days of on-and-off usage, some notes to add to my initial review of the N1 running 2.1:

What’s new:

  • Speed: Things definitely feel snappier than they used to, but not really in a firmly quantifiable way. I’ll try another head-to-head scrolling test after a bit, but I can still expect to see the N1 way behind on that — scrolling still feels jerkier, and usually slower, than on an iPhone.
  • Tethering: For me, this was one of the main the killer features that pushed me to actually buy the N1, and I’m very happy to see it working! AT&T might finally have gotten around to enabling tethering for the iPhone, but they’ve shot themselves in the foot by making it cheaper to buy a new Android phone instead of the $20/month to not get a bandwidth limit increase on your iPhone. Over your 2-year contract, that comes to $480 wasted on AT&T… and it still wouldn’t power your Wifi iPad while the Android will! Sorry, guys. I know which features I want.
  • Screen: my background image is still pretty badly banded, but gradients in the web browser look smoother. There may be piecemeal improvements in how images get rendered and dithered for fullcolor output, but it’s still a bit inconsistent.

Otherwise, the OS isn’t mind-blowingly different, but definitely has a lot of nice little bumps. Ars Technica has a general review of Froyo on the N1 if you want to peek at a few other under-the-hood changes.

Update: There’s also a notification system that looks like a very flexible superset of what the iPhone platform has, which might be very nice for things like sending realtime updates to our upcoming mobile client without it having to poll in the background. That ain’t much useful to users yet, but we’re sure gonna use it in future!

Compared to the iPhone 4

Of course, Apple’s been moving as well. iOS 4 is out for the existing iPhone 3G and 3Gs, and the new iPhone 4 is available and busy fighting a reception issue scandal.

iOS 4 on my iPhone 3G feels like a very nice incremental improvement. Things aren’t radically different, but it’s definitely a bit nicer: folders have helped organize home screens by moving out rarely-used apps, background processing is a big help for a few apps (like Pandora!) and there are other niceties like threading in the mail reader.

I haven’t picked up an iPhone 4 for personal use yet, but I did swing through an Apple store the other day (when the crowds had died down a bit!) to check it out. There are only a couple of interesting user-visible hardware changes beyond the case change:

My favorite is the awesome, awesome high-resolution display. I am really looking forward to this pixel density being available on desktop-size screens… some day we can stop worrying about pixels and just have text and graphics that look good.

There’s some talk that HDTV has actually set display technology back for large formats; I’ve seen only a handful of commercially-available monitors that venture much beyond 1920×1080, and those are all to gain extra desktop space not to improve density/sharpness.

The screen on the Nexus 1 is visibly sharper than the iPhone 3Gs, but even with my slightly blurry vision is visible pixelated at smartphone-usage distances from my eye. The iPhone 4 really, literally, truly moves it into the realm where pixels no longer matter; as this level of display technology makes it out into the broader market, I think it’s going to make a big difference in what we’re comfortable reading on a small screen.

The front-facing camera & video calling support is the primary selling point in Apple’s current ad campaign; the nice saleslady demoed it for me, and the quality’s pretty good for what it is. But honestly I don’t see myself ever using it as more than a gimmick; I’ve had a webcam on my laptop for 5 years and have never been on a video chat that’s not about trying out the video chat feature. Perhaps Apple will prove me wrong — and like with video chats on computers, some people get a lot more mileage out of it than others. I can certainly see if I had a small child we’d probably be on with my parents a lot more often — my mom doesn’t need too many real-time updates on the cats. ;)

There’s also an improved main camera, which may be a nice extra but isn’t a killer feature for me — the current phone cameras are adequate (though not great) and aren’t main selling points for me.

Mobile dev trade-offs: emulator vs simulator

Along with other projects at StatusNet, I’ve been poking at the mobile version of our open-source client reference implementation (still in pre-alpha but getting usable for desktop version). We’re building the client with Appcelerator Titanium, a JavaScript-based cross-platform toolset for development and packaging; the desktop version uses a WebKit-based HTML environment, while the mobile versions use a thin bridge between JS and native controls.

There are some differences between the JavaScript and native bridge implementations between the different target platforms, but cleanly-written backend code can be shared between all platforms, and we’re able to use a single codebase for the mobile UI on both iPhone and Android.

The fun part, though, is with testing and debugging. I’m doing most of the mobile development on my MacBook Pro since I can test both current mobile targets in their respective emulators or real devices from there.

The Android experience

There are several really nice things about the Android SDK setup. First off the download isn’t a bandwidth-shattering 2.3 gigabyte disk image. :) Once installed, I can create custom emulator images with particular combinations of screen resolution and API versions. And, of course, I don’t have to pay $99 and set up a bunch of code-signing keys just to run my test app on a real device!

Android’s SDK emulator is a real, honest-to-god emulator, built around the amazingly versatile QEMU. (I remember using QEMU to simulate an x86_64 system back before I could afford one! Oh the memories…) It runs a complete virtual ARM-based system, booting up a full Linux kernel and Android userland environment.

The good thing about this is that you’re going to be running the exact same real actual code that you’d load onto a real system.

The bad thing is that it takes fricking FOREVER to boot up. Even on a fast modern desktop CPU, emulation is a bit sluggish… booting and general UI actions feel much slower in the emulator than on my Nexus 1 with a 1GHz Snapdragon CPU. And if you accidentally close the emulator you have to wait for it to boot up before relaunching your app…

It’s actually faster in many cases to plug in an Android phone and launch it there. With USB debugging enabled, a native phone can be treated much like the emulator, and Titanium’s wrapper on the SDK can install and launch my app remotely just as quickly as on the emulator — but without waiting for it to boot.

The iPhone experience

Apple went another direction with their iPhone SDK, which has some pluses and minuses. Rather than a true system emulator, the SDK contains an “iPhone Simulator” application, which runs much of the iPhone OS userland as native Intel code on the host system.

The downsides are obvious: you have to compile separately for the simulator and the real, ARM-based devices. Subtle bugs can arise from differences between the systems at both high and low levels. Low-level optimizations such as assembler or vector code won’t even compile, much less run (though that at least isn’t an issue for our JS-based code! ;) An emulator wouldn’t have the same performance characteristics, but could help you confirm that  your math is right before sticking it on a real device.

But there are some upsides: most important to me, the simulator launches nearly instantly. This makes a big difference when you’re working in a rapid-development environment without a good debugging infrastructure; working in Titanium’s JavaScript involves a lot of ‘poke in this line of debug to find out wtf is going on, then fix it’ and I might have to restart the app over and over and over while working with it…

The thing that’s amusingly poor with the iPhone is launching the app  on a physical device. Thanks to Apple’s tight restrictions on app distribution, running your own program requires buying into Apple’s developer program ($99/year), setting up code-signing keys, an dropping a bunch of certs into iTunes so it’ll be willing to copy your stuff over. The Titanium developer tool can then recompile your app (this time for ARM) and shove it over to iTunes, which performs a sync of your phone to copy the app on. This is kind of annoying if you have a bunch of random crap on your phone and syncing takes forever!

What I’d like

Something in the middle might be nice… working with a real device is a lot easier without jumping through code-signing hoops, and the iTunes mediation seems like something that should be skippable if the toolchain’s better integrated, which could improve the iPhone experience.

Performance and boot time are the biggest issues with the Android emulator; making it boot within a couple seconds would be a huge improvement by itself. Cutting overhead by running a native i386 or x86_64 system image might be nice too, but might not be worth the trade-offs of being able to run native ARM code in the emulator.

The trading post: MacBook Air 1.86GHz/2GB/128GB

Hey there my San Francisco buddies, and farther-away buddies who might be willing to pay shipping!

It’s laptop shuffle time at the Vibber house… I’m replacing my MacBook Air as my mobile & webdev machine and am looking for a good home for it… For just US$1150, you can become this ultra-thin laptop’s sponsor. All it needs is a place to plug in and a good meal of electrons every day, and it’ll be your best travel buddy!

I’ve used the box for MediaWiki and StatusNet development, general web surfing, and a little light gaming. Memory and disk performance are a bit tight for a really hardcore workstation (I wouldn’t use it as a mobile video editing studio, that’s for sure!) but it’s perfect for mobile webdev/notes/surfing/skyping and beats the pants off any netbook I’ve tried.

This machine has been to such exotic locales as:

  • San Francisco!
  • Orlando!
  • Paris!
  • Montreal!
  • Los Angeles!
  • Seattle!
  • Berlin!

Purchased from Apple as a refurb in September 2009 with 1 year “like new” warranty — it’s still eligible for purchase of a 2-year AppleCare warranty extension, if that sort of thing floats your boat. Apple still lists this model (full specs) at the refurb price of $1349 that I paid; specs are about the same as the current $1499 base-model MacBook Air but with the 128GB SSD drive.

Machine shipped with Mac OS X 10.5 and a 10.6 install disc; I’ve wiped the drive and put on a fresh install of 10.6. Accessories included: 45W power brick, US 2-prong plug and 3-prong plug w/ extension cord; USB ethernet adapter. Note that VGA and DVI adapters are not included; like other current Apple models it has a native Mini DisplayPort connector and needs an adapter for pretty much any external monitor.

Why I’d recommend it: compared to a netbook, the Air is much more powerful and has a keyboard that won’t hurt your hands. Compared to an iPad, the Air actually can run arbitrary programs and be used for software development. Compared to other full-size laptops, it’s delightfully thin and light, which your shoulders and back will appreciate if you need to travel regularly or cart it to the office on public transit.

Why I’m replacing it: I’ve picked up a MacBook Pro 13″ (same form factor & screen size, but 1kg heavier) primarily for the huge increases in battery life in the last couple product generations. I prefer the lighter weight, but I have a lot of long-distance travel this year and a battery that can actually last me through a cross-country flight or a full day of conferencing is going to serve me better right now… I just have to be really hardcore about keeping extra crap out of my bag!

The good: thin, light, and beautiful! At just 3 pounds, this thing is a joy to carry around when traveling; it really does make a difference to my back. CPU/gfx performance are decent enough for light webdev and a little gaming.

The bad: SSD disk performance is relatively sluggish, which may be painful if you do a lot of compiling. Running heavy CPU for a while can lead to the machine slowing itself down to stay cool. Battery life is similar to the previous generation of MacBooks (theoretically 4-5 hours; I get 2-3 hours of real usage).

The annoying: 2GB RAM is adequate for most needs but cannot be upgraded; folks working with virtual machines will find this awkward. Single USB port can be overly confining when traveling, especially if you need to use the USB ethernet dongle at the same time as anything else. No built-in CD/DVD drive may be a problem for some uses (remote disc is supported if you have another Windows or Mac machine with a CD drive, but has limitations. External USB drives will work, but be warned that Apple’s $99 Air-branded external drive does not work with USB hubs — it must be plugged directly into the Air’s single USB port, leaving you unable to use a USB keyboard, mouse, hard drive, Ethernet adaptor, or iPod.)

If interested, drop me a line. If there’s no excitement it’ll end up on eBay.