Java SDK for 2D
 All Classes Namespaces Functions Variables Pages
Api Class Reference

Basic class providing set of functions to command Navigation. More...

Public Member Functions

void setSoundMutex (boolean mutex) throws RemoteException
 Sets the sound mutex. More...
 
void setOnSoundListener (OnSoundListener listener)
 Sets the on sound listener. More...
 
void setOnTtsListener (OnTtsListener listener)
 Sets the on tts listener. More...
 
void connect ()
 Connect to the remote service. More...
 
void disconnect ()
 Disconnect from the remote service. More...
 
void show (boolean background) throws RemoteException
 Show the navigation. More...
 
void bringApplicationToBackground () throws RemoteException
 Bring navigation to background. More...
 
void registerCallback () throws RemoteException
 Register callback to receive events from remote app. More...
 
void unregisterCallback () throws RemoteException
 Unregister callback. More...
 
boolean isAppRunning () throws RemoteException
 Checks if the Navi Thread is running. More...
 

Static Public Member Functions

static Api init (Context context, String pckgName, String className, ApiCallback callback)
 Initializes the Api class. More...
 
static Api getInstance ()
 Gets the single instance of Api. More...
 
static boolean isApplicationRunning (int maxTime) throws GeneralException
 Verifies whether Navigation is running. More...
 
static void endApplication (int maxTime) throws GeneralException
 Ends Navigation application. More...
 
static String getUniqueDeviceId (int maxTime) throws GeneralException
 Returns device ID. More...
 
static boolean isApplicationInForeground (int maxTime) throws GeneralException
 Returns if the application is active in foreground or idle in background. More...
 
static String getMapVersion (String iso, int maxTime) throws GeneralException
 Gets the map version of a given country's ISO code. More...
 
static NaviVersion getApplicationVersion (int maxTime) throws GeneralException
 Gets the application version and build number. More...
 
static ApiVersion getSdkVersion ()
 Get sdk version. More...
 

Static Public Attributes

static final String CLASS_AURA = "com.sygic.aura.SygicService"
 
static final String CLASS_DRIVE = "com.sygic.drive.SygicService"
 

Package Functions

IRemoteSygicService getService ()
 

Detailed Description

Basic class providing set of functions to command Navigation.

Member Function Documentation

void bringApplicationToBackground ( ) throws RemoteException

Bring navigation to background.

Exceptions
RemoteExceptionthe remote exception

References Api.getInstance(), and Api.getService().

void connect ( )

Connect to the remote service.

void disconnect ( )

Disconnect from the remote service.

static void endApplication ( int  maxTime) throws GeneralException
static

Ends Navigation application.

Parameters
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static NaviVersion getApplicationVersion ( int  maxTime) throws GeneralException
static

Gets the application version and build number.

Parameters
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
NaviVersion instance containing the version and build code
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static Api getInstance ( )
static

Gets the single instance of Api.

Returns
single instance of Api

Referenced by ApiMaps.addBitmapToMap(), ApiItinerary.addEntryToItinerary(), ApiItinerary.addItinerary(), ApiPoi.addPoi(), ApiPoi.addPoiCategory(), ApiFavorites.addStopOffPointsToFavorites(), ApiHistory.addStopOffPointToHistory(), ApiOnline.addTMCEvent(), Api.bringApplicationToBackground(), ApiOptions.changeApplicationOptions(), ApiOnline.clearTMCTable(), ApiDialog.closeDialogs(), ApiItinerary.deleteEntryInItinerary(), ApiItinerary.deleteItinerary(), ApiPoi.deletePoi(), ApiPoi.deletePoiCategory(), Api.endApplication(), ApiPoi.findNearbyPoi(), ApiPoi.findNearbyPoiList(), ApiDialog.flashMessage(), ApiNavigation.getActualGpsPosition(), ApiLocation.getAddressList(), Api.getApplicationVersion(), ApiLocation.getCoordinatesFromOffset(), ApiInfo.getCurrentSpeedLimit(), ApiFavorites.getFavoritesList(), ApiHistory.getHistoryList(), ApiItinerary.getItineraryList(), ApiLocation.getLocationAddressInfo(), ApiLocation.getLocationRoadInfo(), Api.getMapVersion(), ApiInfo.getNextInstruction(), ApiNavigation.getOFGRouteStatus(), ApiPoi.getPoiCategoryList(), ApiPoi.getPoiList(), ApiNavigation.getRouteInfo(), Api.getUniqueDeviceId(), ApiOnline.goOnline(), ApiGps.gpsSwitchOn(), ApiPoi.highlightPoi(), Api.isApplicationInForeground(), Api.isApplicationRunning(), Api.isAppRunning(), ApiNavigation.loadComputedRoute(), ApiMaps.loadExternalFile(), ApiMaps.loadGFFile(), ApiNavigation.loadOFGRoute(), ApiLocation.locationFromAddress(), ApiLocation.locationFromAddressEx(), ApiPoi.makeUserPoiVisible(), ApiMaps.moveBitmap(), ApiNavigation.navigateToAddress(), ApiOnline.onlineServicesLogin(), ApiOnline.onlineServicesSettings(), ApiMenu.onMenuCommand(), ApiTts.playSound(), Api.registerCallback(), ApiMaps.reloadExternalFiles(), ApiMaps.removeAllBitmaps(), ApiMaps.removeBitmap(), ApiFavorites.removeFavoriteFromList(), ApiOnline.removeTMCEvent(), ApiNavigation.saveComputedRoute(), ApiNavigation.saveOFGRoute(), ApiOptions.setDefaultValues(), ApiPoi.setPoiWarning(), ApiItinerary.setRoute(), Api.setSoundMutex(), Api.show(), ApiMaps.showBitmap(), ApiMaps.showCoordinatesOnMap(), ApiLocation.showHierarchyDialog(), ApiDialog.showMessage(), ApiMaps.showRectangleOnMap(), ApiItinerary.skipNextWaypoint(), ApiNavigation.startNavigation(), ApiNavigation.stopNavigation(), ApiMaps.switchMap(), ApiMaps.unloadExternalFile(), ApiMaps.unloadGFFile(), and Api.unregisterCallback().

static String getMapVersion ( String  iso,
int  maxTime 
) throws GeneralException
static

Gets the map version of a given country's ISO code.

Parameters
isoString describing the country's ISO code to retrieve the version from
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
String instance containing the version
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static ApiVersion getSdkVersion ( )
static

Get sdk version.

Returns
e.g "15h,BA00000"
IRemoteSygicService getService ( )
package

Referenced by ApiMaps.addBitmapToMap(), ApiItinerary.addEntryToItinerary(), ApiItinerary.addItinerary(), ApiPoi.addPoi(), ApiPoi.addPoiCategory(), ApiFavorites.addStopOffPointsToFavorites(), ApiHistory.addStopOffPointToHistory(), ApiOnline.addTMCEvent(), Api.bringApplicationToBackground(), ApiOptions.changeApplicationOptions(), ApiOnline.clearTMCTable(), ApiDialog.closeDialogs(), ApiItinerary.deleteEntryInItinerary(), ApiItinerary.deleteItinerary(), ApiPoi.deletePoi(), ApiPoi.deletePoiCategory(), Api.endApplication(), ApiPoi.findNearbyPoi(), ApiPoi.findNearbyPoiList(), ApiDialog.flashMessage(), ApiNavigation.getActualGpsPosition(), ApiLocation.getAddressList(), Api.getApplicationVersion(), ApiLocation.getCoordinatesFromOffset(), ApiInfo.getCurrentSpeedLimit(), ApiFavorites.getFavoritesList(), ApiHistory.getHistoryList(), ApiItinerary.getItineraryList(), ApiLocation.getLocationAddressInfo(), ApiLocation.getLocationRoadInfo(), Api.getMapVersion(), ApiInfo.getNextInstruction(), ApiNavigation.getOFGRouteStatus(), ApiPoi.getPoiCategoryList(), ApiPoi.getPoiList(), ApiNavigation.getRouteInfo(), Api.getUniqueDeviceId(), ApiOnline.goOnline(), ApiGps.gpsSwitchOn(), ApiPoi.highlightPoi(), Api.isApplicationInForeground(), Api.isApplicationRunning(), Api.isAppRunning(), ApiNavigation.loadComputedRoute(), ApiMaps.loadExternalFile(), ApiMaps.loadGFFile(), ApiNavigation.loadOFGRoute(), ApiLocation.locationFromAddress(), ApiLocation.locationFromAddressEx(), ApiPoi.makeUserPoiVisible(), ApiMaps.moveBitmap(), ApiNavigation.navigateToAddress(), ApiOnline.onlineServicesLogin(), ApiOnline.onlineServicesSettings(), ApiMenu.onMenuCommand(), ApiTts.playSound(), Api.registerCallback(), ApiMaps.reloadExternalFiles(), ApiMaps.removeAllBitmaps(), ApiMaps.removeBitmap(), ApiFavorites.removeFavoriteFromList(), ApiOnline.removeTMCEvent(), ApiNavigation.saveComputedRoute(), ApiNavigation.saveOFGRoute(), ApiOptions.setDefaultValues(), ApiPoi.setPoiWarning(), ApiItinerary.setRoute(), Api.setSoundMutex(), Api.show(), ApiMaps.showBitmap(), ApiMaps.showCoordinatesOnMap(), ApiLocation.showHierarchyDialog(), ApiDialog.showMessage(), ApiMaps.showRectangleOnMap(), ApiItinerary.skipNextWaypoint(), ApiNavigation.startNavigation(), ApiNavigation.stopNavigation(), ApiMaps.switchMap(), ApiMaps.unloadExternalFile(), ApiMaps.unloadGFFile(), and Api.unregisterCallback().

static String getUniqueDeviceId ( int  maxTime) throws GeneralException
static

Returns device ID.

Parameters
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
String describing the device ID.
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static Api init ( Context  context,
String  pckgName,
String  className,
ApiCallback  callback 
)
static

Initializes the Api class.

Parameters
contextthe application
pckgNamethe package name of the app connecting to
classNamethe class name of service, can be either CLASS_DRIVE or CLASS_AURA
callbackthe callback to retrieve events from remote app
Returns
the api
static boolean isApplicationInForeground ( int  maxTime) throws GeneralException
static

Returns if the application is active in foreground or idle in background.

Parameters
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
true if Navigation is running in foreground otherwise false
Exceptions
GeneralExceptionthe general exception

References Api.getInstance(), and Api.getService().

static boolean isApplicationRunning ( int  maxTime) throws GeneralException
static

Verifies whether Navigation is running.

Parameters
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
true if Navigation is running otherwise false
Exceptions
GeneralException

References Api.getInstance(), and Api.getService().

boolean isAppRunning ( ) throws RemoteException

Checks if the Navi Thread is running.

Returns
true, if is running

References Api.getInstance(), and Api.getService().

void registerCallback ( ) throws RemoteException

Register callback to receive events from remote app.

Exceptions
RemoteExceptionthe remote exception

References Api.getInstance(), and Api.getService().

void setOnSoundListener ( OnSoundListener  listener)

Sets the on sound listener.

Parameters
listenerthe new on sound listener
void setOnTtsListener ( OnTtsListener  listener)

Sets the on tts listener.

If set, Navigation will not play TTS sound.

Parameters
listenerthe new on tts listener
void setSoundMutex ( boolean  mutex) throws RemoteException

Sets the sound mutex.

If set to true, Navigation will wait for false to play sound.

Parameters
mutexset true before playing sound, false when stopped
Exceptions
RemoteExceptionthe remote exception

References Api.getInstance(), and Api.getService().

void show ( boolean  background) throws RemoteException

Show the navigation.

Starts if not already running.

Parameters
backgroundif true navigation will start in background and will not be shown
Exceptions
RemoteExceptionthe remote exception

References Api.getInstance(), and Api.getService().

void unregisterCallback ( ) throws RemoteException

Unregister callback.

Exceptions
RemoteExceptionthe remote exception

References Api.getInstance(), and Api.getService().

Member Data Documentation

final String CLASS_AURA = "com.sygic.aura.SygicService"
static
final String CLASS_DRIVE = "com.sygic.drive.SygicService"
static