Tiffany Coleman wrote:
The good news is that the majority of the books content is applicable to programming for other mobile device platforms that ship with WebKit browsers (iOS, WebOS, Blackberry Torch, some Nokia), but this still leaves a lot of devices that code samples in the book just won't work on.
Does that mean that this book will help me be able to write an app that I can use on my droid, as well as, then be able to turn around and use it on my iPad? Most of my app ideas are for things like -- accessing online games or reviewing specific database information for online games. I'd like to be able to do it whether I was using my phone or my tablet.
And -- will the book give me enough of the 80% that I could learn the 80% and then grab the 20% to make my app work cross platform? Does it define the 80/20 items -- for instance, does it say, this portion will work multi-platform and also say, this is Android specific and doesn't function somewhere else? If not, would it then be "trial and error" to find out which parts work and don't work if you want to have it be cross OS?
Thanks.
--tiffany
Hey Tiffany,
Another good question. The short answer is yes. Because both your Droid and an iPad (I have a HTC Desire and iPad) both have a Webkit browser just about everything you will code will "just work". I'd recommend starting by targeting the Android first as it's probably the "fussier" of the two platforms.
The one thing
you should consider when writing for these two platforms is the different screen sizes that you are coding for. So when thinking about your layout think about using percentages rather than absolute pixel dimensions to ease the transition, but you can also use
CSS3 media queries to supply different styles for the different screen sizes also.
In terms of what to watch out for, main things are slight variations in Touch handling and some frustrating things around Android 2.1's handling of "device-dpi" when working with the HTML canvas (problem goes away in 2.2 thankfully). On the touch handling front, I have written a
Javascript library to try and help out with that, but it isn't covered in the book as I only created it very recently.
Hope that helps answer your question.
Cheers,
Damon.