See: Description
Package | Description |
---|---|
com.tomtom.navapp |
Contains all the classes for the NavApp SDK.
|
NavAppClient
class.NavAppClient.Factory.make(Context, ErrorCallback)
method.
The returned instance is used to access the individual APIs.onCreate
callback. Once this call returns the NavAppClient
instance is ready to use.
protected void onCreate(Bundle savedInstanceState) {
// Instantiate the NavAppClient passing in a Context and an ErrorCallback.
mNavappClient = NavAppClient.Factory.make(this, mErrorCallback);
}
And closed in the the Activity onDestroy
callback, using
NavAppClient.close()
protected void onDestroy() {
mNavappClient.close();
}
mSDKUtils = mNavappClient.getUtils();
mSDKUtils.getMapInfo(mMapInfoListener);
private MapInfo.Listener mMapInfoListener = new MapInfo.Listener() {
public void onMapInfo(MapInfo mapInfo) {
Log.d(TAG, "name: " + mapInfo.getName() +
"releaseNumber: " + mapInfo.getReleaseNumber() +
"releaseDate: " + mapInfo.getReleaseDate() +
"buildNumber: " + mapInfo.getBuildNumber() +
"locationPath: " + mapInfo.getLocationPath());
}
};
Or planning a trip:
mTripManager = mNavappClient.getTripManager();
final Routeable destination = mNavappClient.makeRouteable(DESTINATION_LATITUDE, DESTINATION_LONGITUDE);
mTripManager.planTrip(destination, mPlanListener);
private Trip.PlanListener mPlanListener = new Trip.PlanListener() {
public void onTripPlanResult(Trip trip, PlanResult result) {
Log.d(TAG, "onTripPlanResult result["+result+"]");
// save the created trip
mTrip = trip;
}
};
SDK/android/sample/SDKTestApp
Build.Version.API_LEVEL
for the current version of the client library.