Android Java SDK for Sygic 3D
 
Loading...
Searching...
No Matches
Api Class Reference

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

Public Member Functions

void setSoundMutex (boolean mutex) throws RemoteException
 
void setOnSoundListener (OnSoundListener listener)
 
void setOnTtsListener (OnTtsListener listener)
 
void connect ()
 Connect to the remote service.
 
void disconnect ()
 Disconnect from the remote service.
 
void show (boolean background) throws RemoteException
 Show the navigation.
 
void bringApplicationToBackground ()
 Bring navigation to background.
 
void registerCallback () throws RemoteException
 Register callback to receive events from remote app.
 
void unregisterCallback () throws RemoteException
 Unregister callback.
 
boolean isAppRunning () throws RemoteException
 Checks if the Navi Thread is running.
 
void stopSygicService ()
 Stop SygicService.
 
String selfTest (String json, int maxTime) throws GeneralException
 

Static Public Member Functions

static Api init (Context context, String pckgName, String className, ApiCallback callback)
 Initializes the Api class.
 
static Api getInstance ()
 Gets the single instance of Api.
 
static boolean isApplicationRunning (int maxTime) throws GeneralException
 Verifies whether Navigation is running.
 
static void endApplication (int maxTime) throws GeneralException
 Ends Navigation application.
 
static boolean isApplicationInForeground (int maxTime) throws GeneralException
 
static String getUniqueDeviceId (int maxTime) throws GeneralException
 Returns device ID.
 
static String getMapVersion (String iso, int maxTime) throws GeneralException
 Gets the map version of a given country's ISO code.
 
static NaviVersion getApplicationVersion (int maxTime) throws GeneralException
 Returns the application version and build number.
 
static ApiVersion getSdkVersion ()
 Returns the sdk api version and build number.
 
static String getLibVersion ()
 Returns the sdk api version.
 
static String importFile (String base64Content, String fileName, boolean append)
 Passes base64 string encoded data into the defined file, either to create a new file or to append to an existing file.
 

Static Public Attributes

static final String CLASS_AURA = "com.sygic.aura.SygicService"
 
static final String CLASS_TRUCK = "com.sygic.truck.SygicService"
 
static final String CLASS_FLEET = "com.sygic.fleet.SygicService"
 
static final String CLASS_DRIVE = "com.sygic.drive.SygicService"
 
static final String INTENT_ACTION_MINIMIZE_REMOTE = "com.sygic.intent.action.minimize_remote"
 

Package Functions

IRemoteSygicService getService ()
 

Detailed Description

Basic class providing set of functions to command Navigation.

Member Function Documentation

◆ bringApplicationToBackground()

void bringApplicationToBackground ( )

Bring navigation to background.

Exceptions
RemoteExceptionthe remote exception

References Api.INTENT_ACTION_MINIMIZE_REMOTE.

◆ connect()

void connect ( )

Connect to the remote service.

◆ disconnect()

void disconnect ( )

Disconnect from the remote service.

◆ endApplication()

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().

◆ getApplicationVersion()

static NaviVersion getApplicationVersion ( int maxTime) throws GeneralException
static

Returns 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
model.NaviVersion instance containing the version and build number
Exceptions
GeneralExceptionthe general exception

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

Referenced by ApiNavigation.getRoute().

◆ getInstance()

static Api getInstance ( )
static

Gets the single instance of Api.

Returns
single instance of Api

Referenced by ApiItinerary.addEntryToItinerary(), ApiItinerary.addItinerary(), ApiItinerary.addItinerary(), ApiOnline.addMapCorrectionEvents(), ApiPoi.addPoi(), ApiPoi.addPoiCategory(), ApiItinerary.calculateRoute(), ApiOptions.changeApplicationOptions(), ApiOnline.clearMapCorrectionEvents(), ApiDialog.closeDialogs(), ApiItinerary.deleteEntryInItinerary(), ApiItinerary.deleteItinerary(), ApiPoi.deletePoi(), ApiPoi.deletePoiCategory(), Api.endApplication(), ApiPoi.findNearbyPoi(), ApiPoi.findNearbyPoiList(), ApiDialog.flashMessage(), ApiNavigation.getActualGpsPosition(), ApiOptions.getApplicationOptions(), Api.getApplicationVersion(), ApiInfo.getCurrentSpeedLimit(), ApiHistory.getHistoryList(), ApiItinerary.getItineraryList(), ApiLocation.getLocationAddressInfo(), ApiLocation.getLocationRoadInfo(), ApiOnline.getMapCorrectionEvents(), Api.getMapVersion(), ApiOnline.getMobileData(), ApiPoi.getPoiCategoryList(), ApiPoi.getPoiList(), ApiPoi.getPoiOnRoute(), ApiNavigation.getRoute(), ApiNavigation.getRouteStatus(), Api.getUniqueDeviceId(), ApiOnline.goOnline(), ApiGps.gpsSwitchOn(), Api.importFile(), Api.isApplicationInForeground(), Api.isApplicationRunning(), Api.isAppRunning(), ApiNavigation.loadComputedRoute(), ApiNavigation.loadComputedRoute(), ApiMaps.loadGeoFile(), ApiLocation.locationFromAddress(), ApiLocation.locationFromAddressEx(), ApiPoi.makeUserPoiVisible(), ApiNavigation.navigateToAddress(), ApiOnline.onlineServicesLogin(), ApiItinerary.optimizeRoute(), ApiTts.playSound(), ApiOnline.resetMobileData(), ApiLocation.searchLocation(), ApiOptions.setApplicationOptions(), ApiOptions.setDefaultValues(), ApiOnline.setMobileData(), ApiPoi.setPoiWarning(), ApiItinerary.setRoute(), Api.setSoundMutex(), Api.show(), ApiMaps.showCoordinatesOnMap(), ApiDialog.showDialog(), ApiDialog.showMessage(), ApiMaps.showRectangleOnMap(), ApiItinerary.skipNextWaypoint(), ApiNavigation.startNavigation(), ApiNavigation.stopNavigation(), ApiMaps.switchMap(), ApiMaps.unloadGeoFile(), ApiMaps.unloadGeoFiles(), and ApiPoi.updatePois().

◆ getLibVersion()

static String getLibVersion ( )
static

Returns the sdk api version.

◆ getMapVersion()

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().

◆ getSdkVersion()

static ApiVersion getSdkVersion ( )
static

Returns the sdk api version and build number.

Returns
model.ApiVersion instance containing the version and build number

◆ getService()

IRemoteSygicService getService ( )
package

Referenced by ApiItinerary.addEntryToItinerary(), ApiItinerary.addItinerary(), ApiItinerary.addItinerary(), ApiOnline.addMapCorrectionEvents(), ApiPoi.addPoi(), ApiPoi.addPoiCategory(), ApiItinerary.calculateRoute(), ApiOptions.changeApplicationOptions(), ApiOnline.clearMapCorrectionEvents(), ApiDialog.closeDialogs(), ApiItinerary.deleteEntryInItinerary(), ApiItinerary.deleteItinerary(), ApiPoi.deletePoi(), ApiPoi.deletePoiCategory(), Api.endApplication(), ApiPoi.findNearbyPoi(), ApiPoi.findNearbyPoiList(), ApiDialog.flashMessage(), ApiNavigation.getActualGpsPosition(), ApiOptions.getApplicationOptions(), Api.getApplicationVersion(), ApiInfo.getCurrentSpeedLimit(), ApiHistory.getHistoryList(), ApiItinerary.getItineraryList(), ApiLocation.getLocationAddressInfo(), ApiLocation.getLocationRoadInfo(), ApiOnline.getMapCorrectionEvents(), Api.getMapVersion(), ApiOnline.getMobileData(), ApiPoi.getPoiCategoryList(), ApiPoi.getPoiList(), ApiPoi.getPoiOnRoute(), ApiNavigation.getRoute(), ApiNavigation.getRouteStatus(), Api.getUniqueDeviceId(), ApiOnline.goOnline(), ApiGps.gpsSwitchOn(), Api.importFile(), Api.isApplicationInForeground(), Api.isApplicationRunning(), Api.isAppRunning(), ApiNavigation.loadComputedRoute(), ApiNavigation.loadComputedRoute(), ApiMaps.loadGeoFile(), ApiLocation.locationFromAddress(), ApiLocation.locationFromAddressEx(), ApiPoi.makeUserPoiVisible(), ApiNavigation.navigateToAddress(), ApiOnline.onlineServicesLogin(), ApiItinerary.optimizeRoute(), ApiTts.playSound(), ApiOnline.resetMobileData(), ApiLocation.searchLocation(), Api.selfTest(), ApiOptions.setApplicationOptions(), ApiOptions.setDefaultValues(), ApiOnline.setMobileData(), ApiPoi.setPoiWarning(), ApiItinerary.setRoute(), Api.setSoundMutex(), Api.show(), ApiMaps.showCoordinatesOnMap(), ApiDialog.showDialog(), ApiDialog.showMessage(), ApiMaps.showRectangleOnMap(), ApiItinerary.skipNextWaypoint(), ApiNavigation.startNavigation(), ApiNavigation.stopNavigation(), ApiMaps.switchMap(), ApiMaps.unloadGeoFile(), ApiMaps.unloadGeoFiles(), and ApiPoi.updatePois().

◆ getUniqueDeviceId()

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().

◆ importFile()

static String importFile ( String base64Content,
String fileName,
boolean append )
static

Passes base64 string encoded data into the defined file, either to create a new file or to append to an existing file.

Parameters
base64Contentbase64 string encoded data
fileNamedestination filename defined by the full path relative to SygicNavigation root, e.g. "Res/myIcon/my.png"
appendfalse to create a new file, true to append to an existing one
Returns
the absolute file path of the resulting file as an informative value
Remarks
The function takes care of creating intermediate folder tree structure if contained in the defined file path. E.g. dir1 and dir2 when filename is "Res/dir1/dir2/my.txt".
Exceptions
IOExceptionthe general I/O exception

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

◆ init()

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

Initializes the Api class.

Parameters
contextthe application context
pckgNamethe package name of the navigation application connecting to. For Sygic Professional it is "com.sygic.fleet"
classNamethe class name of the navigation service connecting to. For Sygic Professional Navigation it is "com.sygic.fleet.SygicService"
callbackthe callback to retrieve events from navigation application
Returns
the api instance
Remarks
For application and service identificators the primary choice is to use "com.sygic.fleet" and "com.sygic.fleet.SygicService".
The other options are:
  • "com.sygic.truck" and "com.sygic.truck.SygicService" for Sygic Truck Navigation for consumers
  • "com.sygic.taxi" and "com.sygic.taxi.SygicService" for Sygic Taxi Navigation
  • "com.sygic.drive" and "com.sygic.drive.SygicService" for Sygic 2D Navigation
But please note that "com.sygic.truck" will cease to support SDK functionality in future.

◆ isApplicationInForeground()

static boolean isApplicationInForeground ( int maxTime) throws GeneralException
static
Parameters
maxTimeMaximum of time (in milliseconds) function can take. If maxTime=0 function execution is not time limited.
Returns
true if connected Sygic navigation is in foreground, false otherwise
Exceptions
GeneralException

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

◆ isApplicationRunning()

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().

◆ isAppRunning()

boolean isAppRunning ( ) throws RemoteException

Checks if the Navi Thread is running.

Returns
true, if is running

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

◆ registerCallback()

void registerCallback ( ) throws RemoteException

Register callback to receive events from remote app.

It is not necessary to call this method anymore.

Exceptions
RemoteExceptionthe remote exception

◆ selfTest()

String selfTest ( String json,
int maxTime ) throws GeneralException

References Api.getService().

◆ setOnSoundListener()

void setOnSoundListener ( OnSoundListener listener)

◆ setOnTtsListener()

void setOnTtsListener ( OnTtsListener listener)

◆ setSoundMutex()

void setSoundMutex ( boolean mutex) throws RemoteException

◆ show()

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().

◆ stopSygicService()

void stopSygicService ( )

Stop SygicService.

◆ unregisterCallback()

void unregisterCallback ( ) throws RemoteException

Unregister callback.

It is not necessary to call this method anymore.

Exceptions
RemoteExceptionthe remote exception

Member Data Documentation

◆ CLASS_AURA

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

◆ CLASS_DRIVE

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

◆ CLASS_FLEET

final String CLASS_FLEET = "com.sygic.fleet.SygicService"
static

◆ CLASS_TRUCK

final String CLASS_TRUCK = "com.sygic.truck.SygicService"
static

◆ INTENT_ACTION_MINIMIZE_REMOTE

final String INTENT_ACTION_MINIMIZE_REMOTE = "com.sygic.intent.action.minimize_remote"
static