Mapping with Google APIs in Android Calexico CA

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

Local Companies

Emerson Computer Power
(760) 357-8823
2340 Rockwood Ave
Calexico, CA
Esoon
(408) 501-8833
1250 Oakmead Pkwy
Sunnyvale, CA
Autoexec Inc
(626) 574-9054
662 W Huntington Dr
Monrovia, CA
U A Systems Inc
(909) 608-1575
2335 W Foothill Blvd Ste 10
Upland, CA
Ocs Software Inc
(559) 781-4123
767 N Porter Rd
Porterville, CA
Baton Rouge International Inc
(408) 830-0529
825 Maria Ln
Sunnyvale, CA
Pacific Partners Management Services Inc
(818) 710-2727
5850 Canoga Ave
Woodland Hls, CA
Opsource Inc
(408) 567-2000
5201 Great America Pkwy
Santa Clara, CA
Surado Solutions Inc
(951) 682-4895
2060 Chicago Ave Ste C5
Riverside, CA
Complipoint Llc
(858) 674-6100
San Diego, 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

MARAUDER CORPORATION

760-423-1111
74-923 HWY 111
Indian Wells, CA
http://www.billcollectorinabox.com

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