Simulating routes on Android Emulator

Photo by Immo Wegmann on Unsplash

It could be for a Java Android project, a Flutter app or a Kotlin app but sometimes you just need to simulate routes along a certain path (maybe to test a location based service).

Android emulator offers a simple way to simulate routes, even if it’s not so publicized: it is in fact possible to import GPX/KML files.

Building your own route

Google Earth makes it possible to build and export KML files to be imported in the emulator.

Open Google Earth and point a place you would like to start the trip from, let’s say “Piazza del Popolo”, in Rome. Click on the “Polyline” tool and trace your route on the map.

Press Enter to save the line.

Choose a title for the route, a title for the project and select “New KML file in the dropdown”. Click on “Save”.

The polyline will be automatically added to a new project. Click the three dot icon and choose “Export as KML file”.

Now you have a KML file to use in the emulator.

Simulating the route

Import the route in the emulator.

When you click on “Play route”, the location pointer will move along the route. You can try to open Google Maps in the emulator to verify that the route is being correctly emulated.

You can use Google Earth to compose more complex routes all around the city or…around the world, so have fun!

Here we post technical and non technical content, best practices and success stories from European Google Developers across our programs (Google Developer Groups,Google Developer Student Clubs,Google Developer Experts,Women Techmakers,Accelerators) and products.

Recommended from Medium

Deploying a Spring Boot App in Docker Hub

Found in translation —  going multilingual with serverless

Weekly Digest 03/2021

Kong & Konga HMAC With Postman

CSS Conflict Resolution Rules Explained

WebOSINT Write-up

Basic Authentication and Form-based Authentication using Spring Security

Introducing F# Analyzers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Juna Salviati

Juna Salviati

Full-time Human-computer interpreter. Opinions are my own.

More from Medium

internal error in Cloud Firestore. SOLVED

Solution for “AndroidStudio: Entrypoint file not found at main.dart”

Mapbox Realtime Navigation- Customize the UI of Navigation in Android-Kotlin PART 2

Firestore Pagination with Realtime Updates — Android

Firestore pagination with realtime updates by Ankur Gupta