How to integrate vanillaNAV in native Android apps


This FAQ is meant to serve as a guideline for using the vanillaNAV library in a third party native Android application.

Please contact us under support(at) to get access to the libraries. 


Library distribution


The vanillaNAV library is distributed as an Android library file in the AAR format.

The contents of this AAR file are:

  • Navigation Activity - which is used for the navigation functionality 

  • Favorite Location Save Activity -  used for saving a location (a POI or a navigation marker) and beeing able to navigate to it afterwards

  • C++ code for marker detection

  • Utility classes for the navigation functionality that enable the necessary computations  and data acquisition (like downloading the venue data)


Importing the Library


The AAR file has to be imported via a gradle script. See reference of this here.

To use your Android library's code in another app module, proceed as follows:

  1. Add the compiled AAR file:

    1. Click File > New Module

    2. Click Import .AAR Package then click Next

    3. Enter the location of the AAR file then click Finish

  2. Make sure the library is listed at the top of your settings.gradle file, as shown here for a library named "vanillanav-lib":

include ':app', ':vanillanav-lib'
  1. Open the app module's build.gradle file and add a new line to the dependencies block as shown in the following snippet:

dependencies {
   implementation project(":vanillanav-lib")
  1. Click Sync Project with Gradle Files


Calling vanillaNAV Navigation


In an activity of your choice, import the following items:

import net.rosoftlab.vnlib.ui.navigation.NavigationActivity;
import static net.rosoftlab.vnlib.Constants.DESTINATION_ID;
import static net.rosoftlab.vnlib.Constants.VENUE_ID;


Create an intent using your activity as the context and selecting the NavigationActivity as the target:

Intent intent = new Intent(this, NavigationActivity.class);


Add extra information to identify your venue and destination:

intent.putExtra(VENUE_ID, 12345L); 
intent.putExtra(DESTINATION_ID, 67890L);
intent.putExtra(CHECK_TO_UPDATE_CACHE, false); //Optional, by default true


The VENUE_ID is an unique identifier of the venue for which navigation shall be used, as configured in the vanillaNAV Manager web application

The DESTINATION_ID is an unique identifier of a destination (point of interest) inside the venue,  as configured in the vanillaNAV Manager web application

The CHECK_TO_UPDATE_CACHE is a boolean which determines if NavigationActivity should check whether newer version of venue is available in the vanillaNAV Manager web application. It is an optional extra with default value being "true"

Please contact us directly to obtain information on how to get these IDs. 


Start the activity:



Adding the Navigation Activity to the manifest.xml


The following lines needs to be declared in your manifest to ensure the activity can be launched:

    android:launchMode="singleTask" />


The vanillaNAV library needs permission to access the camera and the internet. These permisions are declared within the library’s manifest.


Retrieving the List of Destinations


In order to access information about destinations or other data vanillaNAV uses to provide its services, access to the venue object is required.

A venue is the top level object that holds all the data regarding one location. All venues are stored online and they can be downloaded using the vanillaNAV public web API. This can be done by using the the API provided with the library.

This method uses the smartphone’s local memory to cache the venue and provide version control of the cache.


PublicApi api = Lib.getInstance(context).getPublicApi();

Observable<Venue> venueObservable = api.getVenue(12345L);

venueObservable.subscribe(new Consumer<Venue>() {
    public void accept(Venue venue) throws Exception {
        List<Destination> destinations = venue.getDestinations();


Note that the library provides Observables of the data, using the RxJava v.2 library.



Tags: API, SDK
Last update:
2018-05-22 12:22
Marlene Lange
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.