GuidesFlutter API ReferencesHERE SDK for Android API referencesHERE SDK for iOS API references
Guides

Examples

Most code snippets in this guide can also be found as part of small, focused example apps. You have two ways to access them:

  • Find the latest example apps for your product bundled within the downloaded package you can find on the HERE platform.

Example apps

  • Find the latest example apps for Explore on GitHub.

  • Find the latest example apps for Navigate on GitHub.

Note

Most example apps are written in a consistent way where a "XYExample.java/kt" file contains the relevant code. UI elements are mostly left out or kept minimal to not shadow the important parts of the code. Note that the HERE SDK itself does offer most APIs headless without UI.

For this guide and the accompanying example apps, we preferably avoid the use of lambda notations to show the full type of information and other details, such as callback or listener name. Since Android Studio supports one-click conversion between anonymous classes and lambdas, adapting the examples to suit your personal preference should be simple.

Following the popular POJO (Plain-Old-Java-Object) principle, the example code is kept free of most Android dependencies - instead it's mostly pure Java / Kotlin code that shows how the HERE SDK can be used.

Available example apps

Show a map view

The "HelloMap" app shows how to get started by showing a map view.

Show a map view with Android Auto

The "HelloMapAndroidAuto" app shows how to integrate Android Auto to show a map on an in-car head unit display.

Use the map camera

The "Camera" app shows how to change the target and the target anchor point and how to move to another location using custom map animations.

Create custom camera animations

The "CameraKeyframeTracks" app shows how to do custom camera animations with keyframe tracks.

Show various map schemes & map layers

The "MapFeatures" app shows how to enable different map view features such as different map layers and map schemes. Only available for the the Navigate.

Visualize real-time traffic on a map view

The "Traffic" app shows how to search for real-time traffic and how to visualize it on the map.

Interact with the map view using gestures

The "Gestures" app shows how to handle gestures like tap, double-tap, pinch & rotate and many more.

Add map items

The "MapItems" app shows how to add circles, polygons and polylines, native views, 2D and 3D map markers to locate POIs (and more) on the map.

Pick embedded POIs

The "CartoPOIPicking" app shows how to pick embedded map markers with extended place details. Embedded map markers are already visible on every map, by default.

Render low level graphic elements

The "HelloMapSurface" app shows how to use the MapSurface class to render low-level graphic elements with OpenGL ES on top of the map.

Style your own map schemes

The "CustomMapStyles" app shows how to load custom map schemes made with the HERE Style Editor.

Add custom raster layers

The "CustomRasterLayers" app shows how to load custom raster layers.

Add custom tile sources

The "CustomTileSource" app demonstrates how to load custom point layers, implement clustering functionality using a custom point tile source, and integrate custom raster layers.

Show a map view on multiple displays

The "MultiDisplays" app shows how a HERE SDK map can be shown on two separate displays using Android's Multi-Display API.

Generate map images offscreen

The "OffscreenMapSurface" app shows how the HERE SDK can be used to generate images of the map without putting a map view on screen.

Use the HERE SDK without a map view

The "StandAloneEngine" app shows how to use an engine without a map view.

Find places, use geocoding and reverse geocoding online

The "Search" app shows how to search POIs and add them to the map. Also shows geocoding and reverse geocoding.

Find places, use geocoding and reverse geocoding online & offline

The "SearchHybrid" app shows how to search for places including auto suggestions, for the address that belongs to certain geographic coordinates (reverse geocoding) and for the geographic coordinates that belong to an address (geocoding). It also shows how to search offline, when no internet connection is available. Only available for Navigate.

Calculate and visualize routes online

The "Routing" app shows how to calculate routes and add them to the map.

Calculate and visualize routes online & offline

The "RoutingHybrid" app shows how to calculate routes online and offline. Only available for Navigate.

Calculate EV routes

The "EVRouting" app shows how to calculate routes for electric vehicles, area of reach with isoline routing, and how to search along a route.

Optimize routes with avoidance options

The "RoutingWithAvoidanceOptions" app shows how to calculate routes with AvoidanceOptions and how to use the SegmentDataLoader to retrieve data from the map. It also allows to pick segments from the map to avoid certain areas or roads. Only available for Navigate.

Calculate routes for public transport

The "PublicTransit" app shows how to calculate routes for buses, trains, and subways.

Integrate HERE Positioning

The "Positioning" app shows how to integrate HERE Positioning to find out where you are. Only available for Navigate.

Enable background location updates

The "PositioningWithBackgroundUpdates" app shows how to integrate HERE Positioning with background location updates using a foreground service.

Track and record outdoor trips

The "HikingDiary" app shows how to record GPX traces with HERE Positioning. Only available for Navigate.

Get started with navigation

The "NavigationQuickStart" app shows how to get started with turn-by-turn navigation. Only available for Navigate.

Use turn-by-turn navigation with tracking features

The "Navigation" app gives an overview of how to implement turn-by-turn navigation along with tracking features and voice assistance. Only available for Navigate.

Customize turn-by-turn navigation

The "NavigationCustom" app shows how the guidance view can be customized. Only available for Navigate.

Display navigation event during turn-by-turn navigation

The "NavigationWarners" app shows how to implement various navigation events such as speed limit and lane assistance during turn-by-turn navigation. Only available for Navigate.

Use spatial audio navigation

The "SpatialAudioNavigation" app shows how to make use of spatial audio notifications for TTS voices during guidance. Only available for Navigate.

Handle rerouting during navigation

The "Rerouting" app shows how the HERE SDK can be used to handle rerouting during guidance after a driver left the route. Only available for Navigate.

Use navigation for trucks

The "TruckGuidance" app shows how the HERE SDK can be used to calculate routes specific for trucks and many more truck-related features. Only available for Navigate.

Start navigation headlessly without a map view

The "NavigationHeadless" app show the HERE SDK can be set up to navigate without following a route in the most simplest way - and without showing a map view. Only available for Navigate.

Use offline maps

The "OfflineMaps" app shows how the HERE SDK can work fully offline and how offline map data can be downloaded for continents and countries. Only available for Navigate.

Integrate Indoor maps

The "IndoorMap" app shows how to integrate private venues. Only available for Navigate.

Integrate reusable building blocks

The "HERESDKUnits" app demonstrates how to modularize your application UI and extract HERE SDK features - such as map-scheme switching - into small, reusable units. Only available for Navigate.

Write unit tests for the HERE SDK

The "UnitTesting" app helps you mock SDK classes for solid unit testing.

Most example apps are available in both Java and Kotlin. Kotlin apps are identified by the suffix "-Kotlin". Unless otherwise noted, the same app can be executed with Explore or Navigate credentials.

How to build an example app

Choose an example of your choice, then:

  1. Add the HERE SDK framework to the app's libs folder.
  2. Insert your HERE credentials (access_key_id and access_key_secret) in the MainActivity.java file.

Now you are ready to open the project with Android Studio and you can instantly execute the app on your device or simulator.

To learn how the HERE SDK integrates into apps, see Integrate the HERE SDK.

List of demo apps

  • If you are interested to see a demo of the features the HERE SDK has to offer - or if you simply want to see all features in action, check the HERE WeGo application. This app uses the same technology stack that empowers the HERE SDK.
  • Alternatively, you can build and run the reference application (available only for Flutter) which you can find as an open source project on GitHub. This app shows most features of Navigate including the features from Explore in an release-ready app with easy-to-understand UX flows and reusable UI assets.

About the reference application

The reference application for the HERE SDK for Flutter (Navigate) shows how a complex and release-ready project targeting iOS and Android devices may look like. You can use it as a source of inspiration for your own HERE SDK based projects - in parts or as a whole. Many parts of the app overlap with Explore - however, guidance requires the HERE SDK (Navigate).

The reference application can be used as a base project to start your own app development.

On top, the reference application offers a lot of ready-made assets that can be used for your own apps based on the terms shown on the GitHub page.

Below you can find the available selection of maneuver icons that can be shown to indicate a maneuver action - for example, during turn-by-turn guidance.

The reference application also contains a variety of other icons, such as map markers, to get you started quickly with your own application.

Below you can find an overview of selected features along with the related code that can be used in your own projects.

More reusable icons can be found in the official HERE Icon Library.

How to build the reference application

Build instructions are given on the GitHub page hosting the reference application.

Note that only major versions of the HERE SDK for Flutter are supported.