Getting started
Integrate VisioMove Essential into your Android app to explore, search and navigate within your Visioglobe map.
Requirements
To use this framework you will need:
- Android Studio Flamingo (2022.2.1) or higher
- Android SDK 33 or higher
Map requirements
To play well with VisioMove Essential, your Visioglobe map should:
- be published at VisioMove SDK v2.1.15 or greater (ask your Visioglobe project manager if you're unsure)
- be hosted on the map server (i.e retrieved via a hash code)
- have at least one localisation language.
Setup build tools
Set the build tools version within your projects build.gradle file to at least 21.0.0. This fixes a layout rendering issue:
android {
...
buildToolsVersion "33.0.0"
...
}
Setup dependencies
Add in "repositories" and "dependencies" sections of the module-level build.gradle (replace 'libs' with the location where you put VisioMoveEssential.aar reative to the build.gradle file):
repositories {
flatDir {
dir 'libs'
}
}
dependencies {
...
api fileTree(include: ['*.jar'], dir: 'libs')
implementation files("../VisioMoveEssential.aar")
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.8.10'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3'
...
}
Add this line in your gradle.properties file :
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
If you want to load a view you can add to your .xml's layout :
com.visioglobe.visiomoveessential.VMEMapView
Then in your fragment you will have to inflate the map view from your layout & load the map data and the view. Here are the steps to display your view :
//Build your mapController.
val builder = VMEMapControllerBuilder()
//For example mapHash is used:
builder.mapHash = "dev-m2ca47a978ce45fd3f3334b7a1078272ec07655bc"
builder.mapSecretCode = 0
mMapController = VMEMapController(requireContext(), builder)
// Set the life cycle listener (defined below).
mMapController!!.setLifeCycleListener(mLifeCycleListener)
//Load data & view. You can load data without view.
mMapController!!.loadMapData()
mMapController!!.loadMapView(mMapView!!)
On crucial element is the LifeCycleListener, which is tracking the lifecycle of the map. Don't forget to define it. Here is the simplest way to define it:
private val mLifeCycleListener: VMELifeCycleListener = object : VMELifeCycleListener() {
}
See samples in SDK folder in order to configure project