-
Notifications
You must be signed in to change notification settings - Fork 19
Getting Started
To start using Navigation library in your project you should do the following steps.
Register on http://client.navigine.com, create a location and get your personal security key in the profile (it has the form 16 hexadecimal digits: XXXX-XXXX-XXXX-XXXX).
Download "libnavigine.aar" and add it to the Android project. For Android Studio users this page may be useful.
Initialize Navigation library in your code before any other library functions are called:
// Initialize Navigine library
Navigine.initialize(Context);
// Set user hash and server before getting the instance of [[NavigineSdk|class-NavigineSdk]]
NavigineSdk.setUserHash(mUserHash); // your user hash from the server
NavigineSdk.setServer(mLocationServer); // your server url (by default `https://api.navigine.com`)
NavigineSdk mNavigineSdk = NavigineSdk.getInstance();If mNavigineSdk is null than library is not initialized and cannot be used. This generally happens in one of the following cases:
- Android SDK version is less than 21;
- Android device doesn't support Bluetooth 4.0;
- CPU architecture is not supported yet.
Get instance of LocationManager, set LocationListener and download a location archive from the server using the following (or similar) code:
LocationManager mLocationManager = mNavigineSdk.getLocationManager();
mLocationManager.addLocationListener(new LocationListener() {
@Override
public void onLocationLoaded(Location location) {
// do smth with location
}
@Override
public void onDownloadProgress(int progress, int total) {
// do smth with location download progress
}
@Override
public void onLocationFailed(Error error) {
// do smth if error occurs during downloading location
}
});
mLocationManager.setLocation(/* your location id */);If location archive was successfully loaded you can start navigation (see NavigationManager for details). You can set the LocationView and it will display your position, or you can use NavigationManager and get updates about your position through PositionListener.
NavigationManager mNavigationManager = mNavigineSdk.getNavigationManager();
mNavigationManager.addPositionListener(new PositionListener() {
@Override
public void onPositionUpdated(Position position) {
// do smth with position
}
@Override
public void onPositionError(Error error) {
// do smth if error occurs during downloading location
}
});Tutorials
Classes
- NavigineSdk
- LocationListManager
- LocationManager
- NavigationManager
- RouteManager
- ZoneManager
- NotificationManager
- MeasurementManager
- LocationEditManager
- ResourceManager
- Location
- Sublocation
- Category
- Venue
- Zone
- Beacon
- Eddystone
- Wifi
- LocationView
- LocationViewController
- CircleMapObject
- PolylineMapObject
- IconMapObject
- TouchInput
- ScaleResponder
- PanResponder
- LongPressResponder
- DoubleTapResponder
- TapResponder
- LocationListListener
- LocationListener
- PositionListener
- RouteListener
- ZoneListener
- NotificationListener
- LocationEditListener
- MeasurementListener
- ResourceListener
- ResourceUploadListener
- Notification
- Position
- SignalMeasurement
- SensorMeasurement
- Image
- RoutePath
- RouteEvent
- LocationPoint
- LocationInfo
- BitmapRegionDecoder