Android Tutorial

(avery) #1

By : Ketan Bhimani


390 

This method of making a call to the JavaScript on the currently
loaded page does not allow for return values. There are ways,
however, to structure your design to allow checking of results,
generally by treating the call as asynchronous and implementing
another method for determining the response.

Figure shows how this application might behave on an Android
device.

This style of development has been popularized by the open source
PhoneGap project, which aims to provide a set of standard
JavaScript interfaces to native code across a variety of platforms,
including iOS,Android, BlackBerry, Symbian, and Palm.

Working with Flash

For those web developers wanting to bring their Flash applications
to mobile,Android is the only smart phone platform currently
supporting desktop Flash 10.1 (as opposed to Flash Lite, a common
mobile variant of Flash that’s very limited). However, there are
both benefits and drawbacks to including Flash technology on the
platform. Let’s look at some of the facts:

 Flash might not be the “future,” but it’s the “status
quo” in some web circles. There are millions of Flash
applications and websites out there that can now be
accessed from Android devices. This makes users
happy, which should make the rest of us happy.

A simple Android application with a
JavaScript interface.

 Native Android applications are always going to
perform better, use fewer resources (read: drain the
Free download pdf