- Developers
- Professional Navigation for Fleets
- Android
- API
- Online API
Online API
Overview
Online API provides functionalities related to the data management services exhibiting dynamic content, such as traffic data or map corrections.
With the function OnlineServicesLogin one can perform a login with username and password to obtain automatic updates on traffic data and speed camera points of interest. Through SetMobileData / GetMobile data one can control data transfer count over mobile data internet to make sure it does not pass defined limits. With the functions GetMapCorrectionEvents and AddCorrectionEvents dynamic map content corrections can be maintained.
GetMapCorrectionEvents
GetMapCorrectionEvents reads all user typed map correction entries, called events, of different categories such as wrong road directions, closure, speed limit incorrect, input through GUI of Sygic navigation.
The typical usecase is that these data are collected from many drivers by a central access point to build an overall database of map corrections. And then later on to use it for distribution to all drivers.
Please note the function only retrieves events, which have been input over GUI (so called user events) and does not contain events, which have been introduced by the AddMapCorrectionEvents function, which are marked as company events.
The events list is retrieved in a form of csv string, the purpose of which is just to be stored in a central database, and further distributed in the as-is form.
Check details of GetMapCorrectionEvents in the reference manual.
Example
This example collects all user typed map corrections events and sends it to a company collecting database server.
try
{
String csv = ApiOnline.getMapCorrectionEvents(0);
SendMC(URL, csv);
}
catch(GeneralException e) {
e.printStackTrace();
}
AddMapCorrectionEvents
AddMapCorrectionEvents adds so called company events of map corrections.
The typical usecase is that the function is triggered by company central point, which updates all its drivers with the built-up knowledge of map corrections.
The events can be cleared from a device using ClearMapCorrectionEvents function.
Please note these events are not retrievable through the function GetMapCorrectionEvents.
Check details of AddMapCorrectionEvents in the reference manual.
Example
This example updates a device with map corrections retrieved from a company database server.
try
{
String csv = ReadMC(URL);
ApiOnline.clearMapCorrectionEvents(csv,0);
ApiOnline.addMapCorrectionEvents(csv,0);
}
catch(GeneralException e) {
e.printStackTrace();
}
Example
This example updates map with a single map correction event from a fixed string.
Please note the two end-of-line characters \n are important in the string.
String csv1;
csv1 = "ID;ISO_CODE;DIRECTION;EVENT;ICON;JAM_FACTOR;EXPIRATION;DELAY;CLOSURE;OPENLR\n" +
"6527742;SVK;0;401;17;3;0;0;1;Cwwt7SI9poSRAf/p/7iEAQ==\n";
try
{
ApiOnline.addMapCorrectionEvents(csv1,0);
}
catch(GeneralException e) {
e.printStackTrace();
}
ClearMapCorrectionEvents
ClearMapCorrectionEvents deletes all imported company-events by the function AddMapCorrectionEvents.
Please note it does not clear user-events. They can only be removed manually over GUI of Sygic navigation by a driver.
Check details of ClearMapCorrectionEvents in the reference manual.
Example
This example clears all imported events. Immediately after the function execution the events disappear from map.
try
{
ApiOnline.clearMapCorrectionEvents(csv,0);
}
catch(GeneralException e) {
e.printStackTrace();
}
- Previous article: Dialog API
- Next article: Sidebar API