Mapping with Google APIs in Android Arcadia CA

Learn how to tap into the many great mapping functionalities in Android.

Local Companies

AniWorld Inc
(626) 564-9768
758 E Colorado Blvd
Pasadena, CA
DigitalHousing & Administration, LLC
626.440.9030.111
101 E. Green St. suite 5
Pasadena, CA
etelligence technologies inc.
626-810-9262
17700 castleton st. #383
city of industry, CA
Ignify Inc
+562 483 2448
12440 Firestone Blvd, Suite 225
Norwalk, CA
NRG Global
213-383-6745
3807 Wilshire Blvd.
Los Angeles, CA
Web Studios West
(877) 225-9772
2219 W.Olive Ave #213
Burbank, CA
j2 Global Communications
1 (888) 532.9265
6922 Hollywood Blvd
Los Angeles, CA
Diskeeper Corporation
800 829 6468
Corporate Campus
Burbank, CA
Specto Design
818-761-5538
4428 Camellia Ave
Studio City, CA
Harris Business Systems
818-951-3033
9900 Rancho Caballo Drive
Shadow Hills, CA

Mapping with Google APIs in Android

provided by: 
Originally published at Internet.com


Mapping functionality has become a must-have feature for new mobile devices. With all the new technology advances, mobile devices, especially cell phones, are more than capable of handling complicated mathematical calculations on their own or keeping up with the high-traffic communication with the servers. GPS devices used to be the dominant player with the mapping capabilities, but more and more mobile devices are offering almost full-featured GPS functionalities. Google's Android provides direct access to its popular mapping tools. You will explore key programming APIs that power its mapping features.

What Google APIs Are Available for Mapping?

Before you start, all the necessary development tools, plug-ins, and sample code you need are from Google's own Android site at http://code.google.com/android/. It also provides simple-to-follow instructions to get you started. I recommend you do that first if you have not done so already.

The majority of the mapping APIs are within the package com.google.android.maps. At a minimum, two of them are required to embed the mapping tools inside your software: MapActivity and MapView. MapActivity manages the activity life cycle and services behind a MapView. MapView is an Android View that displays a map. Other than these APIs, you also have MapController to perform panning and zooming a map. MyLocationOverlay and Overlay are used to draw the user's info or objects on top of the map.

Discussing mapping without mentioning GPS is nearly impossible now because GPS has become one of the indispensable features most people would want from their mobile devices. The package android.location is included for GPS support. LocationManager is the most important API; it provides access to the system location services. The mapping and GPS APIs are the essential elements for building location-based services (LBS). You will pretty much cover all these APIs in a working example later.

Constructing a MapView by a MapActivity

You can construct a MapView only by a MapActivity because it depends on background threads that access the network and filesystem managed by MapActivity. That is to say, you should always start by extending your class from MapActivity as follows: public class TutorialOnMaps extends MapActivity { private static MapView mMapView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); // Get the map view from resource file mMapView = (MapView)findViewById(R.id.mv); } }

While in the default resource file main.xml, you add in some on-screen buttons with transparent panels. To properly "inflate" the MapView, you use a well-known solution among Android developers to declare a MapView. Figure 1 shows the initial screen on the emulator with your on-screen buttons.

Featured Local Company

AniWorld Inc

6265649768
758 E Colorado Blvd
Pasadena, CA
http://www.aniworld.com

Related Local Events
Windows Hardware Engineering Conference
Dates: 11/5/2008 - 11/7/2008
Location: Los Angeles Convention Center
Los Angeles CA
View Details

Digital Video Expo
Dates: 11/4/2008 - 11/6/2008
Location: Los Angeles Convention Center
Los Angeles CA
View Details

IT ChannelVision Fall 2008
Dates: 10/4/2008 - 10/8/2008
Location: Hyatt Regency Los Angeles
Los Angeles CA
View Details

IT ChannelVision Fall 2008
Dates: 10/4/2008 - 10/8/2008
Location: Hyatt Regency Los Angeles
Los Angeles CA
View Details

Biotechnology Vendor Showcase - University of California, Los Angeles
Dates: 10/2/2008 - 10/2/2008
Location: UCLA
Los Angeles CA
View Details
Rate Article
     
Articles Insider

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Advertising Engineering Home Services Retail & Consumer Services
Business Services Entertainment Industrial Goods & Services Software
Career Family Insurance Technology
Cars Financial Services Internet Telecommunications
Computer Hardware Food & Beverage Legal Transportation & Logistics
Construction Health Pets Travel
Education Home Electronics Real Estate Wedding