PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE · 2016. 12. 14. · Google Maps Android API v2 is...

26
PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) K Candra Brata Mobille App Lab 2015-2016 Maps [email protected]

Transcript of PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE · 2016. 12. 14. · Google Maps Android API v2 is...

  • PENGEMBANGAN APLIKASIPERANGKAT BERGERAK

    (MOBILE)

    K Candra Brata

    Mobille App Lab 2015-2016

    “ Maps

    [email protected]

  • Google Maps API v2Make your Android app pop with Google Maps

  • Google Maps Android API v2 is part of the Google Play servicesplatform.

    The v2 Maps offer exciting features such as 3D maps, indoor,satellite, terrain, and hybrid maps.

    Custom colors or icons for map markers to match app’s look andfeel.

    Polylines and polygons to indicate paths.

    Users have the ability to rotate, tilt and zoom the map.

    Introduction

  • Android SDK, min API 14Google Play services library included.

    Prerequisites

  • API Key - Android Maps API v2

    You will need an API key on every map application. Unlimited usage.

    How to get API Key?https://developers.google.com/maps/documentation/android-api/signup

    Register with your keystore + package namehttps://console.developers.google.com/

    Dont forget to Enable your Maps API !!!

    Prerequisites

  • Add project’s dependencies.

    Get SetUp

    YOUR Google Play Service Version

  • Adding permissions and meta-tags to your manifest file. INTERNET : To check whether internet connection is available. ACCESS_NETWORK_STATE : Used for Checking network state. WRITE_EXTERNAL_STORAGE : Writing to external storage. OpenGL ES V2 : This permission is needed to run maps.Optional ACCESS_FINE_LOCATION : To get user’s location using GPS. ACCESS_COARSE_LOCATION : To get user’s location using WiFi and mobile network.

    Get Set Up

    Include your API Key which you got in your google developer console using the meta-data tag

    Include the meta-data tag needed for google play services version

  • AndroidManifest. xml

    Get Set Up

  • It's a Fragment... with a map!● com.google.android.gms.maps.MapFragment● Use GoogleMap object to interact with map: call getMap() method.

    What about Gingerbread?● com.google.android.gms.maps.SupportMapFragment

    MapFragment

  • Basic setupAdd a Map

  • Add a Map

  • BasicMapRun your project !!

  • Map Type

    Normal

    Hybrid

    Satellite

    Terrain

  • Set Map TypeJavaGoogleMap map;

    map.setMapType(GoogleMap.MAP_TYPE_HYBRID);

  • MarkerMarkers, custom icons, keeping track of them

  • Indicates a point on a map

    Properties:

    Position (required) Title and snippet Dragging Visibility Icon (default icon, coloured icon, custom icon)

    and anchor

    Add a Marker

  • Add a MarkerJavamap.addMarker(new MarkerOptions()

    .position(new LatLng(51.5075744, -0.0992315));

  • Custom marker iconJavamap.addMarker(new MarkerOptions()

    .position(new LatLng(51.5075744, -0.0992315))

    .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_museum));

  • My LocationJavaGoogleMap map;

    map.setMyLocationEnabled(true);

  • ShapePolyline and Polygon Options

  • Add shapes to your map

    Polyline

    Polygon

    Circle

  • Add shapes to your map

    Polyline Polygon

  • Add shapes to your mapJavaPolylineOptions options = new PolylineOptions()

    .add(new LatLng(a,b))

    .add(new LatLng(c,d))

    .....color(0xFFAA0000)

    .width(10);

    // Add it to the map.

    mMap.addPolyline(options);

    Polyline

  • Add shapes to your mapJava

    Polygon

  • Add shapes to your mapJava

    Circle

  • Thanks!QUESTIONS?

    Developers

    PENGEMBANGAN APLIKASI�PERANGKAT BERGERAK �(MOBILE)Slide Number 2Slide Number 3Slide Number 4Slide Number 5Slide Number 6Slide Number 7Slide Number 8Slide Number 9Slide Number 10Slide Number 11Slide Number 12Slide Number 13Slide Number 14Slide Number 15Slide Number 16Slide Number 17Slide Number 18Slide Number 19Slide Number 20Slide Number 21Slide Number 22Slide Number 23Slide Number 24Slide Number 25Thanks!