Truck Navigation App
Tutorial — How to integrate the Truck Navigation Interface
In this tutorial we take you on a step by step course to integrate the MapTrip Truck navigation interface into your own application. The tutorial consists of multiple lessons which build upon each other and take you through the process of building an app that remote controls MapTrip. After completing the tutorial you will be able to integrate the truck navigation into your own Android app.
About the MapTrip Truck Navigation Interface (MTI)
MTI is the acronym for MapTrip Interface. MTI is an easy to use interface which enables developers to control the MapTrip navigation app with few commands and requirements for development. For more detailed information please refer to the MapTrip Interface Documentation.
About this tutorial
This tutorial shows how to use the MapTrip Interface API (MTI) to control the MapTrip navigation app with your Android app. Step by step you will learn more about the communication between your app and MapTrip and the mechanism of MTI callbacks.
Using this tutorial
This tutorial consists of different lessons. With every lesson you will build a simple app which interacts with MapTrip. As is usual in tutorials, the first lesson starts with the basics and the following lessons become slightly more complex. Each lesson builds on the previous one. Accordingly, we recommend that you follow the given sequence. To keep this simple, every lesson has a ordinal in its name.
The tutorial project structure
The tutorial is created and tested with Android Studio. It is also possible to follow the lessons using another development environment. Of course this depends to your experience. Anyway, all explanations are related to Android Studio — we hope you are fine with this.
In Android Studio the lessons are modules so you have all lessons at a glance and can concentrate on one of them at a time. Switching the project view between ‘Android’ and ‘Project Files’ helps to see only the code or all other related files like documentation.
Brief overview of the tutorial structure
- every lesson is an Android Studio module and can be generated as a runnable app
- every module has its own README file with a short explanation of the lesson’s goal
- in every lesson module there is a folder content which contains
- a PDF file with instructions
- code or configuration files (for controlling if something went wrong during your own implementation steps)
Lessons overview
lesson1_initialize
- Starting the MapTrip app
- Integrate MTI library as dependency
- use callbacks
- initilize API
lesson2_showapps
- bring MapTrip to foreground
- bring tutorial app to foreground
lesson3_navigateWithCoordinates
- add coordinates
- Start navigation guidance or (without available GPS) start simulation
- Switch to tutorial app when destination is reached
Prerequisites
As mentioned before, this tutorial describes how to control the navigation app MapTrip. Therefore MapTrip has to be installed before you can start the lessons. Please ensure that MapTrip runs at your device (or an emulation within your development environment). Otherwise it is hard to understand the lessons content.
If you are new in MapTrip you can get it by downloading here: maptrip.de
Download on Github
You can download the entire project on our Github page.
Lesson 1 — Setup Project, Use MTI Lib andStart MapTrip
Download the first lesson here or go to the projects Github page.