Вы находитесь на странице: 1из 23

Programming with Mobile

Applications
Chapter 4: Google Android: App Inventor

In Chapter 4, You Learn to


Describe the Android architecture
Use Google App Inventor to create Android
apps
Use the App Inventor app designer
Use the App Inventor Blocks Editor
Use non-visible components
Incorporate messaging, locations, and
media into an app
Deploy an app created with App Inventor
Programming with Mobile Applications

Android Architecture
Linux kernel This component is
the OS; its the communication layer
between the hardware and the
software.

Programming with Mobile Applications

Android Architecture
(continued)
Android runtime components
This component includes the Dalvik
virtual machine (a specialized virtual
machine for low-memory appliances)
and the core libraries, described
next.

Programming with Mobile Applications

Android Architecture
(continued)
Core libraries Developers have
access to all the core libraries
Android supplies, such as SQLite,
FreeType, and SGL the Scalable
Graphics Library used by Android.
Note that access to these core
libraries is what makes Android stand
out from its peers.
Programming with Mobile Applications

Android Architecture
(continued)
Application framework You use this
component to write applications that
make use of the core libraries and any
libraries you create. It includes a Content
Provider, a Resource Manager, an
Activity Manager, a Notification Manager,
and more. It also includes many views
you can access, including a wide variety
of user interface components.
Programming with Mobile Applications

Android Architecture
(continued)
Applications The uppermost
component is the application layer. It
includes built-in apps, such as a Web
browser and e-mail, as well as any
apps you write. Its the layer thats
directly available to users.

Programming with Mobile Applications

Android Architecture
(continued)
Figure
2-2 The Android architecture

Programming with Mobile Applications

App Inventor
App Inventor is a Web-based IDE for
creating Android apps.
App Inventor includes a user interface
designer and a code block editor.
Instead of writing code, you assemble
prefabricated blocks of code.
App Inventor gives you access to
powerful Android libraries you can use
when creating apps.
Programming with Mobile Applications

Access to Android Features


Including

Data storage
Location services via GPS
Telephony
Messaging capabilities
and more

Programming with Mobile Applications

10

App Inventor Workspace


Figure 4-2 The App Inventor workspace

Programming with Mobile Applications

11

App Inventor Blocks Editor


Figure 4-7 The Blocks Editor workspace

Programming with Mobile Applications

12

Hello App Inventor!

Programming with Mobile Applications

13

Hello App Inventor!


(continued)

Programming with Mobile Applications

14

Starting the Emulator

Programming with Mobile Applications

15

The Android Emulator


Figure 4-16 The locked emulator

Programming with Mobile Applications

16

Connecting to the New


Emulator

Programming with Mobile Applications

17

Hello App Inventor Running


Figure 4-18 The HelloAppInventor app running in the
emulator

Programming with Mobile Applications

18

Packaging and Deployment

Programming with Mobile Applications

19

Wheres My Phone?

Programming with Mobile Applications

20

Wheres My Phone?
(continued)

Programming with Mobile Applications

21

Wheres My Phone?
(continued)
Figure 4-29 Sending
a text message to the Wheres My
Phone? emulator

Programming with Mobile Applications

22

Wheres My Phone?
(continued)
Figure 4-30
Message received and response
sent

Programming with Mobile Applications

23