|
/* |
|
Initialize the NavigineSDK and load your location |
|
*/ |
|
NavigineSDK.initialize(mContext, USER_HASH, SERVER_URL); |
|
NavigineSDK.loadLocationInBackground(D.LOCATION_NAME, 30, mLoadListener); // Loading with Location.LoadListener callback |
|
|
|
LocationView locationView = findViewById(R.id.locationView); |
|
... |
|
/* |
|
After the location is loaded, you could set it to LocationView element |
|
and could add Listener and OnLayoutChangeListener |
|
|
|
In this listeners will happen redrawing of the location and will habdle touch events |
|
*/ |
|
|
|
... |
|
// Get the NavigationThread class |
|
mNavigation = NavigineSDK.getNavigation(); |
|
|
|
/* |
|
Set device listener for getting updates about your position in the location |
|
you will get results every second. |
|
|
|
So you can provide the custom signals after you get the device info, for getting navigation in next updates |
|
But we recommend to provide it in another function, |
|
because you could want to provide a lot of signals |
|
*/ |
|
mNavigation.setDeviceListener(new DeviceInfo.Listener(){ |
|
@Override public void onUpdate(DeviceInfo info) { |
|
handleDeviceUpdate(info); |
|
} |
|
}); |
|
|
|
... |
|
// Do not forget to set the navigation mode to normal for getting navigation without pauses |
|
mNavigation.setMode(NavigationThread.MODE_NORMAL); |
|
|
|
... |
|
/* |
|
You need to create your Beacon creater function for generating new beacons |
|
with the uuid, major, minor you need in your location |
|
|
|
And in your beacon creater function you should provide the data to the navigation thread |
|
*/ |
|
|
|
mNavigation.provideBluetoothMeasurement(name, address, rssi, scanRecord); |
|
|
|
/* |
|
And also you could create the function for generating wifi signals |
|
and add the same function for providing this data to the navigaiton |
|
*/ |
|
|
|
mNavigation.provideWifiMeasurement(scanResults); |