Datasheet

22
Part I: The Nuts and Bolts of Android
Security
Android allows your apps to do a lot! Imagine if someone released an app
that went through the contact list and sent the entire list to a server some-
where for malicious purposes. This is why most of the functions that modify
the user’s device or access its protected content need to have permissions to
work. Suppose that you want to download an image from the Web and save
it to the SD Card. To do so, you need to get permission to use the Internet
so that you can download the file. You also need permission to save files to
the SD Card. Upon installation of the application, the user is notified of the
permissions that your app is requesting. At that point, the user can decide
whether he wants to proceed with the installation. Asking for permission is
as easy as implementing one line of code in your application’s manifest file,
which I cover in Chapter 3.
Google APIs
The Android OS isn’t limited to making phone calls, organizing contacts, or
installing apps. You have much more power at your fingertips. As a devel-
oper, you can integrate maps into your application. To do so, you have to use
the maps APIs that contain the map widgets.
Pinpointing locations on a map
Perhaps you want to write an app that displays your current location to your
friends. You could spend hundreds of hours developing a mapping system —
or you could just use the Android Maps API. Google provides the Android
Maps API, which you can use in your app, and just like everything else in
Android, it’s free! You can embed and use the API in your application to show
your friends where you are; it won’t take hundreds of hours or cost you a
cent. Imagine all the juicy map goodness with none of the work developing
it. Using the maps API, you can find just about anything with an address; the
possibilities are endless. Display your friend’s location, the nearest grocery
store, or the nearest gas station — anything or anyplace with an address.
Getting around town with navigation
Showing your current location to your friends is cool, but wait — there’s
more! The Android Maps API can also access the Google Navigation API. Now
you can pinpoint your location and also show your users how to get to that
location.
05_9780470770184-ch01.indd 2205_9780470770184-ch01.indd 22 11/2/10 8:51 AM11/2/10 8:51 AM