Hardware Reference
In-Depth Information
Native Applications for Mobile Phones
Even though web and SMS interfaces offer many possibilities, there are projects for
which you really need access to a mobile phone's operating system. Web applications
make it difficult—if not impossible—to access the phone's hardware or file system, for
example. In these cases, you need to get to know your phone's operating system and
the programming tools available for it. If you're aiming to make an application for all
mobile phones, you need to become familiar with several operating systems.
The mobile phone industry is fast changing, as are its
smartphone operating systems, and keeping up with it
all can be exhausting. Google's Android OS, Blackberry,
Palm's webOS, Windows Mobile, Symbian, and Apple's
iOS (for iPad, iPhone, and iPod touch) are currently the
largest players. Of those, Android, iOS, and Blackberry
are the three largest at the moment, covering most of
the market. Nokia's Symbian was one of the largest, but
Nokia is no longer supporting it as its primary operating
system. As of the last quarter of 2010, Android was the
most popular of smartphone operating systems, taking
35% of the world market.
offers an environment familiar to many experienced devel-
opers. For those less comfortable with code, Google offers
a graphic programming environment called App Inventor
( http://appinventor.googlelabs.com ) that allows you to
create applications by combining graphic objects. For
the rest of this chapter, you'll learn to make Android apps
using a familiar environment: Processing. As of version 1.5,
Processing can compile and install sketches as Android
apps.
Processing for Android
Processing for Android is a very exciting update to Pro-
cessing, but as it is very new, it is still under development.
The examples that follow were developed at the same
time as the tools to make them possible—in some cases,
they are the first real tests of the libraries they use. So be
warned, you're sailing in uncharted waters now. As the
Processing for Android wiki ( http://wiki.processing.org/w/
Android ) explains: “Do not use this code while operating
heavy equipment. Do not rely on this code for thesis or
diploma work, as you will not graduate. Do not use this
code if you're prone to whining about incomplete software
that you download for free.” The libraries used here are
likely to change after the publication of this topic, and they
will hopefully become more stable and easier to use. So
make sure to check the online documentation of anything
mentioned here for updates.
There's a lot of interest in programming for iOS because
it's such an attractive environment, but Apple is notori-
ously controlling about iOS development. You have to
register as a developer, and they've limited the available
toolkits severely. In addition, you can't just distribute
your app independently—you have to do it through the
App Store. That's fine for commercial developers, but for
hobbyists and home hackers, it can be quite forbidding.
For more on iPhone programming, see Alasdair Allan's
books, Learning iPhone Programming (O'Reilly) and iOS
Sensor Programming (O'Reilly). Alasdair has done a great
deal to make iPhone programming accessible.
Android, on the other hand, is somewhat more accessible
to programmers. Applications can be installed on Android
phones using the Android Market, or they can be installed
over USB. Based on Linux and programmed in Java, it
Search WWH ::




Custom Search