Truck Navi­ga­ti­on App

Tuto­ri­al — How to inte­gra­te the Truck Navi­ga­ti­on Interface

In this tuto­ri­al we take you on a step by step cour­se to inte­gra­te the Map­Trip Truck navi­ga­ti­on inter­face into your own appli­ca­ti­on. The tuto­ri­al con­sists of mul­ti­ple les­sons which build upon each other and take you through the pro­cess of buil­ding an app that remo­te con­trols Map­Trip. After com­ple­ting the tuto­ri­al you will be able to inte­gra­te the truck navi­ga­ti­on into your own Android app.

About the Map­Trip Truck Navi­ga­ti­on Inter­face (MTI)

MTI is the acro­nym for Map­Trip Inter­face. MTI is an easy to use inter­face which enables deve­lo­pers to con­trol the Map­Trip navi­ga­ti­on app with few com­mands and requi­re­ments for deve­lo­p­ment. For more detail­ed infor­ma­ti­on plea­se refer to the Map­Trip Inter­face Docu­men­ta­ti­on.

About this tutorial

This tuto­ri­al shows how to use the Map­Trip Inter­face API (MTI) to con­trol the Map­Trip navi­ga­ti­on app with your Android app. Step by step you will learn more about the com­mu­ni­ca­ti­on bet­ween your app and Map­Trip and the mecha­nism of MTI callbacks.

Using this tutorial

This tuto­ri­al con­sists of dif­fe­rent les­sons. With every les­son you will build a simp­le app which inter­acts with Map­Trip. As is usu­al in tuto­ri­als, the first les­son starts with the basics and the fol­lo­wing les­sons beco­me slight­ly more com­plex. Each les­son builds on the pre­vious one. Accor­din­gly, we recom­mend that you fol­low the given sequence. To keep this simp­le, every les­son has a ordi­nal in its name.

The tuto­ri­al pro­ject structure

The tuto­ri­al is crea­ted and tested with Android Stu­dio. It is also pos­si­ble to fol­low the les­sons using ano­ther deve­lo­p­ment envi­ron­ment. Of cour­se this depends to your expe­ri­ence. Any­way, all expl­ana­ti­ons are rela­ted to Android Stu­dio — we hope you are fine with this.

In Android Stu­dio the les­sons are modu­les so you have all les­sons at a glan­ce and can con­cen­tra­te on one of them at a time. Swit­ching the pro­ject view bet­ween ‘Android’ and ‘Pro­ject Files’ helps to see only the code or all other rela­ted files like documentation.

Brief over­view of the tuto­ri­al structure

  • every les­son is an Android Stu­dio modu­le and can be gene­ra­ted as a run­nable app
  • every modu­le has its own README file with a short expl­ana­ti­on of the lesson’s goal
  • in every les­son modu­le the­re is a fol­der con­tent which contains 
    • a PDF file with instructions
    • code or con­fi­gu­ra­ti­on files (for con­trol­ling if some­thing went wrong during your own imple­men­ta­ti­on steps)

Les­sons overview

lesson1_initialize

  • Start­ing the Map­Trip app
  • Inte­gra­te MTI libra­ry as dependency
  • use call­backs
  • ini­ti­li­ze API

lesson2_showapps

  • bring Map­Trip to foreground
  • bring tuto­ri­al app to foreground

lesson3_navigateWithCoordinates

  • add coor­di­na­tes
  • Start navi­ga­ti­on gui­dance or (wit­hout available GPS) start simulation
  • Switch to tuto­ri­al app when desti­na­ti­on is reached

Pre­re­qui­si­tes

As men­tio­ned befo­re, this tuto­ri­al descri­bes how to con­trol the navi­ga­ti­on app Map­Trip. The­r­e­fo­re Map­Trip has to be instal­led befo­re you can start the les­sons. Plea­se ensu­re that Map­Trip runs at your device (or an emu­la­ti­on within your deve­lo­p­ment envi­ron­ment). Other­wi­se it is hard to under­stand the les­sons content.

If you are new in Map­Trip you can get it by down­loa­ding here: maptrip.de

Down­load on Github

You can down­load the enti­re pro­ject on our Git­hub page.

Les­son 1 — Set­up Pro­ject, Use MTI Lib and­Start MapTrip

Down­load the first les­son here or go to the pro­jects Git­hub page.