21
HERE Maps for the Nokia X platform

HERE Maps for the Nokia X platform

Embed Size (px)

DESCRIPTION

With HERE Maps, users always know where they are and where they’re going, even when they’re not connected to a mobile network. In this webinar, we’ll show you how to integrate HERE Maps into your new apps for Nokia X and how to port existing apps.

Citation preview

Page 1: HERE Maps for the Nokia X platform

HERE Maps for theNokia X platform

Page 2: HERE Maps for the Nokia X platform

NOKIA XHERE MAPS

Page 3: HERE Maps for the Nokia X platform

• The HERE API for Nokia X Software Platform provides a set of programming interfaces that enable developers to build immersive Nokia X Software Platform applications by leveraging a powerful and flexible mapping platform.

• Through these APIs, developers can add rich location features such as routing, interactive maps, and searching a global Place database to their applications. The powerful client-side HERE API for Nokia X Software Platform also includes a sophisticated engine for rendering map data and route calculation.

• In addition to downloading map data dynamically as needed, it also supports offline maps through use of previously cached map data or previously downloaded map packages.

WHAT IS THE HERE API FOR NOKIA X ?

Page 4: HERE Maps for the Nokia X platform

• The HERE API delivers vector-based map data, in contrast to most mapping SDKs that only provide APIs to display map data using raster tiles. With raster tiles, panning to a new location or moving to a new zoom level requires additional raster tiles must be downloaded, leading to a negative impact on application fluidity and the overall user experience.

• Vector map data used by the HERE API consists of many data layers that are rendered based on rules describing what to display and how to display it.

• Vector map data requires significantly less storage space than raster map tiles, enabling map data to be downloaded for offline use. The result is a powerful hybrid solution where map data can be downloaded over a wireless data connection as needed, or maps for countries and regions can be preloaded for later use, eliminating the need for an always-present wireless data connection.

• The HERE API uses vector data for all normal maps. Raster tiles are used when satellite, terrain, and custom maps are being displayed.

VECTOR MAPS

Page 5: HERE Maps for the Nokia X platform

• Dynamically download vector maps for more than 190 countries in over 50 languages• Preload maps for offline usage• Map styles: normal street map, satellite map, transit map, and more• Textured 3D landmarks• Street level imagery• Touch gestures (including pan, flick, pinch zoom, rotate, and tilt)• Overlay objects on the map such as polylines, polygons, icons, and routes• Overlay 3D map objects• Overlay custom raster tiles on the map (for example, to display heat maps)• Ability to render raster tiles and map objects interleaved within different map layers• Venue maps• Show real-time traffic flow and incidents• 3D Buildings• Traffic and transit object interaction

FEATURES - MAPPING

Page 6: HERE Maps for the Nokia X platform

• Search through a broad set of geographical content, including 25 million streets, 200 million address points, and over 60 million categorized places across the globe

• Search for a specific place or explore by categories• Get rich details for a Point of Interest (including images, ratings, reviews, and editorials)• Perform geocoding and reverse geocoding lookups• Offline places search, offline geocoding/reverse geocoding lookups

• Get driving or pedestrian directions• Public Transit directions• Specify preferred route type (fastest/shortest) and attributes to avoid (toll roads, motorways, parks,

and more)• Alternate routes• Offline route calculation• Driving directions that take traffic into account

FEATURES – SEARCH / DIRECTIONS

Page 7: HERE Maps for the Nokia X platform

• The MapGesture interface encapsulates all user interactions and touch gestures supported by the HERE API for Nokia X Software Platform. The MapGesture associated with a particular fragment can be retrieved from MapFragment.getMapGesture(). The default behavior of the map for each gesture type may be used as-is, supplemented, or replaces entirely.

MAP GESTURES

Page 8: HERE Maps for the Nokia X platform

• The HERE API for Nokia X Software Platform provides a variety of map appearances for your application to choose from, these appearances are otherwise known as map schemes. The MapScheme class defines schemes that the HERE map service supports. You can set a desired scheme by making a call to the Map.setMapScheme(String) method.

MAP SCHEMES

NORMAL_DAYSATELLITE_DAYHYBRID_DAYHYBRID_DAY_TRANSITNORMAL_NIGHTNORMAL_NIGHT_TRANSITTERRAIN_DAYNORMAL_DAY_TRANSIT

Page 9: HERE Maps for the Nokia X platform

• MapObject represents a base interface for all map-related objects that can be added on a Map. To create these objects, you must use the MapFactory class by calling the corresponding create method with a geo object. Geo objects (for example, GeoPolyline and GeoPolygon) are geographical data representations that act as models to MapObjects, which act as views.

GEO OBJECTS

MapContainerMapCircleMapPolylineMapPolygonMapRouteMapMarkerMapLocalModelMapGeoModel

Page 10: HERE Maps for the Nokia X platform

• MapTransitLayer is a layer that displays the available transit data for a map area. Three types of transit data are currently available:• Transit Stop data - represented by TransitStopObject• Transit Line data - represented by TransitLineObject• Transit Access data - represented by TransitAccessObject

TRANSIT INFORMATION

Page 11: HERE Maps for the Nokia X platform

• Traffic information can be displayed on the Map (where available) by using Map.setTrafficInfoVisible(true). Traffic events are selectable through map gestures and MapGestureListener.onSelectedObjects(List<ViewObject>). Traffic visualization requires a network data connection to download real time traffic information, however traffic information may continue to be displayed thereafter without a connection until the traffic events expire or the visibility is toggled.

TRAFFIC INFORMATION

Page 12: HERE Maps for the Nokia X platform

• HERE API supports showing 3D representations of buildings and structures. This feature is called extruded buildings, and you can enable it by simply calling the setExtrudedBuildingsShown() method in com.here.android.restricted.mapping.Map method. Extruded buildings are available for most metropolitan areas in North American and Europe.

EXTRUDED BUILDINGS AND 3D LANDMARKS

Page 13: HERE Maps for the Nokia X platform

• In addition to outdoor mapping and geographical information, the HERE API for Nokia X Software Platform also allows developers to retrieve and display venues from around the world. With the Venue Maps API, your application can show data and map tiles that provide additional details of the interior of a building, including information such as floor numbers, the structure of each floor, and room names.

VENUE MAPS

Page 14: HERE Maps for the Nokia X platform

• The HERE API for Nokia X Software Platform allows application developers to offer users a panoramic street-level imagery for many cities. Street-level imagery is a collection of interconnected 360-degree panoramas. You can navigate from one panorama to another by tapping on links that appear on-screen as arrows pointing in various navigable directions.

STREET-LEVEL IMAGERY

Page 15: HERE Maps for the Nokia X platform

• HERE Maps requires:OpenGl ES 2.0 support.HERE App ID & Token.SD card to be present (emulator).Internet connection.

• Note that map tiles will be cached, thus you need to load them only once.

GENERAL REQUIREMENTS

Map Initialization

Failure

Page 16: HERE Maps for the Nokia X platform

• HERE Maps offers the same functionality as Google Maps API, as well as additional functionality for utilizing HERE location based services.

• Generally you can port your application to the HERE API in two approaches:1. Create Separate APK to be used in Nokia X platform

• Use can use the Google Maps V1 or V2 API Wrapper to port your existing application to utilize the HERE maps.

• Simple 2 step porting with no need for code changes.

2. Add HERE API usage into the Existing APK • At run time, select HERE maps to be used when the application is run in Nokia X devices, and use

other implementation when it is not. • For reference implementation, see the MapsDemo example shipped with the SDK.• Note that there are separate Wrappers with nokia namespace which can be used with this

approach.

PORTING TO HERE MAPS API

Page 17: HERE Maps for the Nokia X platform

MODIFYING MANIFEST (I)

<uses-library android:name="com.here.android" android:required="true" />

You need to make some minor modifications to the AndroidManifest.xml file of your project to enable HERE Maps. First, specify the application version compatibility by adding or editing the following tag:

Add the additional permissions required by HERE:

<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="16" />

Within the <application></application> block of tags, add the following library:

<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /><uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Page 18: HERE Maps for the Nokia X platform

MODIFYING MANIFEST (II)

<uses-feature android:glEsVersion="0x00020000" android:required="true" />

All application using the HERE SDK must have a valid application ID (app ID) and application token (app token). You will also need to register your application in the Nokia Publishing tool to obtain these. Please follow the instructions in the publishing content quick guide. Once you have acquired the app ID and token, insert them within the <application></application> block of tags:

HERE Maps require OpenGL and GPU so make sure you have OpenGL ES 2.0 usage declared in the manifest file:

<meta-data android:name="com.here.android.maps.appid" android:value="YOUR ID" /><meta-data android:name="com.here.android.maps.apptoken" android:value="YOUR TOKEN" />

In addition, either the whole application or the activity using maps, needs to have property android:hardwareAccelerated set true:

<application ... android:hardwareAccelerated="true">

Page 19: HERE Maps for the Nokia X platform

CONFIGURATION STEPS• Import library project located at:

• <Android SDK installation path>/extras/nokia/nokia_x_services/libs/reference-v2_lib

• Remove Google Play Services library (google-play-services_lib) and make project "reference-v2_lib" in the library list as a reference.

• Make sure that Android Private Libraries are in the Build Path. This ensures that the HERE JAR is packaged as part of your application.

• If your existing application requires the Android Support Library (e.g. android-support-v4.jar), ensure that the relevant JAR file is also present in your ported project. For instance, the Google Play Services map sample uses FragmentActivity class, which requires version 4 Android support library (android-support-v4.jar) to be linked to the project.

Page 20: HERE Maps for the Nokia X platform

RUN AND TEST YOUR APPLICATIONYour application will now use the v2 Reference APIs on the HERE Maps platform instead of Google Maps. There should be no need to make additional changes to the source code of your app. If you still have problems with the application after following the previous steps, make sure that:

• If you are running the app in the emulator, the use of host GPU is enabled in the Android Virtual Device (AVD) settings and you have a SD card defined.

• Your internet connection is working and proxy is properly set if needed.• Your app ID and token are valid.

Page 21: HERE Maps for the Nokia X platform

Thanks!