Ben Stein of Mobile Commons is giving a talk on Cross-platform Mobile App development. They hadn’t done any client mobile work, but lately clients have been asking “what about iPhone?,” “what about Android?” and the like. Whether or not this question of navigating the mobile client world is important to you now, Ben predicts it will soon be, as that’s where we’re headed.
Thoughts and experiences from Mobile Commons’ first mobile client apps:
Mobile give you capabilities not available elsewhere:
- Accelerometer & Orientation
- Phone & Contacts
- Sound & Vibrate
This is a big list – serious stuff.
Uncool things about mobile
- Unreliable network connectivity
- Java, Objective-C
- Memory Management
Options for mobile
- Maybe your Rails Web app is good enough
- A mobile-formatted version of the web site
- A client app
- alternate stylesheets
- separate mobile subdomain
- No cool mobile features
- No app store distribution
** have to bookmark, no $$
iui, iPhone, Rails
- iui & rails-iui: gives you stylesheet and typical iPhone ajaxy interaction
- Mime::Type.register ‘text/html’, :iphone
- Rich User experience
- Cool device features
- App store distributions
Native Apps: Cons
- New technologies
- Different technologies
- Frameworks to learn
“There are only so many hours in the day to learn new technologies.”
Alternative Tech Stack
- Webkit rendering engine (HTML/CSS)
- Business logic in web application
(accelerometer, location, phone, &c.)
- HTML5 Client-Side Storage (SQLite + JS)
- Proposed 6 years ago, working group started in 2007. Implementations emerging, particularly in Webkit, which is the common mobile renderer.
- Video Tag
- Client-side Storage
- and more…
3 Types of Storage
- Structured Storage
- Client Database
HTML5: App Cache
Also defines a mechanism for enabling intelligent client-side caching.
- Defines an interface for client-side databases
Ben then demos a sticky-note app which works currently in Safari, and works with client-side persistent storage.
Security & Privacy
This makes cookie resurrection easy, so the designers include a same-domain policy in the spec, to reduce access.
GMail on the iPhone
Currently uses the app-cache and asynchronous updates to enable offline access.
- Open-source Project by Nitobi
jQuery minus all the browser compatibility code, optimized for Webkit & Mobile phones.
Don’t use Curl to test these apps, use HttpClient, which deals with much of the basics, including authentication
The phone number is linked with the a ‘tel:// ‘ URI which then allows initiating a call from within the phone.
These projects can be built and managed out of eclipse for Android and XCode for iPhone.
- Apps don’t quite feel native. A bit slower, not quite as polished.
- Not good for graphics, games, &c.
- App store policies? Reports that some apps have been rejected for using these frameworks.
- HTML5 spec not yet finalized
- Tons of fun work to add HTML5 functionality to Rails
Q & A
What about Migrations?
There’s no easy answer, this is one of the reasons we switched to Web development, because we have more control and the easy ability to push updates. Client migration support is also theoretically possible, but has yet to be implemented.
About the Author