Mapping with Google APIs in Android Auburn CA

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

Local Companies

Priusant, Inc.
425-699-7645
6391 Bluebill Ct.
Rocklin, CA
J4 Systems
(916) 784-8220 ext 131
1050 Melody Lane
Roseville, CA
Indowsway Software
(530) 885-7942
Auburn, CA
Bacs Inc.
(858) 488-3549
San Diego, CA
Gic-Software
(408) 356-7208
PO Box 1353
Los Gatos, CA
Softsource
(949) 583-0093
21076 Bake Pkwy Ste 104
Lake Forest, CA
Integrity Sales
(510) 733-0540
Hayward, CA
Investment Technology Labs
(310) 378-3966
Torrance, CA
Optimal Synthesis Inc
(650) 213-8585
868 San Antonio Rd
Palo Alto, CA
Accela
(559) 627-1959
1731 W Walnut Ave
Visalia, 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

Priusant, Inc.

425-699-7645
6391 Bluebill Ct.
Rocklin, CA
http://www.priusant.com

Priusant provides the following services:
=>Full Cycle Application Development
=>Rapid Product Development
=>Documentation, Content and Knowledge Management Services
=>Web design, member management, online billing and credit card transactions, web/wireless integration.

Priusant believes that the Internet and web based model will continue to be adopted. The wireless-handheld technology will augment this. Our primary focus will be to bring these two technologies to applications existing and new.
Checkout our website at http://www.priusant.com for more details of our products and services.


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