Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps.

Similar presentations


Presentation on theme: "TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps."— Presentation transcript:

1 TCS Internal Maps

2 2 TCS Internal Objective Objective :  MAPS o Integration of Maps

3 3 TCS Internal Map With the Google Maps Android API, you can add maps based on Google Maps data to your application. The API automatically handles access to Google Maps servers, data downloading, map display, and response to map gestures The API allows you to add these graphics to a map: 1) Icons anchored to specific positions on the map (Markers). 2) Sets of line segments (Polylines). 3) Enclosed segments (Polygons). 4) Bitmap graphics anchored to specific positions on the map (Ground Overlays). 5) Sets of images which are displayed on top of the base map tiles (Tile Overlays).

4 4 TCS Internal Integrate maps Creating a new Android application that uses the Google Maps Android API v2 requires several steps. Install and configure the Google Play services SDK 1. Install the Google Play services SDK. 2. Add Google Play services as an Android library project. 3. Reference the Google Play services in app's project. Add the Google Play services version to your app's manifest <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> Get Google Maps API key 1. Navigate to your project in the Google APIs Console. 2. In the Services page, verify that the "Google Maps Android API v2" is enabled. 3. click API Access. 4. In the resulting page, click Create New Android Key.... 5. In the resulting dialog, enter the SHA-1 fingerprint, then a semicolon, then your application's package name. 6. The Google APIs Console responds by displaying Key for Android apps (with certificates) followed by a forty-character API key

5 5 TCS Internal Add the API key to your application In AndroidManifest.xml, add the following element as a child of the element, by inserting it just before the closing tag : <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="API_KEY"/> Specify permissions <!-- The following two permissions are not required to use Google Maps Android API v2, but are recommended. --> Integrate maps

6 6 TCS Internal 1. Add the following fragment in the app's layout XML file. If you created a 'hello world' app using the Android Developer Tools (ADT) package in Eclipse, the file is at res/layout/activity-main.xml. Replace the entire contents of that file with the following code. <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.MapFragment"/> 2. Add the following code in MainActivity.java. public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } Integrate maps

7 TCS Internal Thank You


Download ppt "TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps."

Similar presentations


Ads by Google