In this chapter, we’ll tackle the very trendy subject of location-based services. One of Android’s major selling points is its native access to the Google Maps infrastructure. Although it is an optional feature, what carrier wouldn’t include this powerful package? I suppose that, in the coming year or so, we’ll find out. You’ll delve into this subject in two major parts in this chapter. First, you’ll take on Android’s LocationManager object, which allows you to determine your latitude and longitude, ostensibly, using a variety of systems under the hood. Next, you’ll get into making the Google Maps API do your bidding. It’s important to note that Android’s support for GPS and tower-based location systems is not fully implemented. At press time, it’s possible to emulate GPS data either by using the default, which is a drive around the Bay Area in California, or by building your own fake GPS data. My example will use the first method, but I’ll include code that should eventually work with shipping handsets. You can find more information about building a custom GPS route and the ins and outs of location-based services (LBSs) in the Android documentation at http://code.google.com/android/toolbox/apis/lbs.html.
KeywordsCode Listing Native Access Draw Method Public Void Lookup Method
Unable to display preview. Download preview PDF.