Skip to content

CoPilotMgr

CopilotVersion

Overview
Description A class containing information about the version of CoPilot and map data that is currently loaded on a device. This includes software version, map data version, year and quarter.
Supported on Android Since Version 9.6.0.821
Type Class
Package com.alk.cpik

Methods

Method Name Return Type Description
getAppVersion() String Returns the CoPilot application version.
getDataVersion() String Returns the CoPilot map data version.
getDataYear() Int Returns the year of the map data version.
getDataQuarter() Int Returns the quarter of the map data version.

Sample Code

// Print out information about a CopilotVersion.
try {
    CopilotVersion currVersion = CopilotMgr.getVersionInfo();
    System.out.println("Application version: " + currVersion.getAppVersion());
    System.out.println("Map data version: " + currVersion.getDataVersion());
    System.out.println("Map data year: " + String.valueOf(currVersion.getDataYear()));
    System.out.println("Map data quarter: " + String.valueOf(currVersion.getDataQuarter()));
} catch(CopilotException e) {
    System.out.println("Exception! : " + e.toString());
}

CopilotVersion.getAppVersion

Overview
Description Returns the CoPilot application version currently installed on the device
Supported Since CoPilot Version 9.6.0.867
Supported in following Platforms Android
Type Method
Package com.alk.cpik

Syntax

String getAppVersion()

Return Value

String object containing the application version.

Sample Code

// Print out CopilotVersion application version.
try {
  CopilotVersion currVersion = CopilotMgr.getVersionInfo();
  System.out.println("Application version: " + currVersion.getAppVersion());
} catch (CopilotException e) {
  System.out.println("Exception! : " + e.toString());
}

Related APIs


CopilotVersion.getDataVersion

Overview
Description Returns the CoPilot map data version that is downloaded on the device.
Supported Since Version 9.6.0.867
Platforms Supported Android
Type Method
Package com.alk.cpik

Syntax

String getDataVersion()

Return Value

String object containing the map data version.

Sample Code

try {
  CopilotVersion currVersion = CopilotMgr.getVersionInfo();
  System.out.println("Application version: " + currVersion.getDataVersion());
} catch (CopilotException e) {
  System.out.println("Exception! : " + e.toString());
}

CopilotVersion.getDataYear

Overview
Description Returns an integer representing the year of the map data version that is currently in use on the device (e.g. 2014).
Supported Since Version 9.6.0.867
Platforms Supported Android
Type Method
Package com.alk.cpik

Syntax

int getDataYear()

Return Value

Integer value of the year of the map data version.

Sample Code

// Print out CopilotVersion map data year.
try {
  CopilotVersion currVersion = CopilotMgr.getVersionInfo();
  System.out.println("Map data year: " + String.valueOf(currVersion.getDataYear()));
}catch(CopilotException e){
  System.out.println("Exception! : " + e.toString());
}

Related APIs


CopilotVersion.getDataQuarter

Overview
Description Returns an integer representing the quarter that the map data version was released (1, 2, 3, or 4).
Supported Since Version 9.6.0.867
Platforms Supported Android
Type Method
Package com.alk.cpik

Syntax

Int getDataQuarter()

Return Value

Integer value of the quarter of the map data version.

Sample Code

// Print out CopilotVersion map data year.
try {
  CopilotVersion currVersion = CopilotMgr.getVersionInfo();
  System.out.println("Map data quarter: " + String.valueOf(currVersion.getDataQuarter()));
}catch(CopilotException e){
  System.out.println("Exception! : " + e.toString());
}

Related APIs


CopilotMgr

Overview
Description A class containing static methods for setting and checking various CoPilot features and settings.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Class
Package com.alk.cpik

Methods

Method Name Return Type Description
enableMotionLock(boolean) void Enables or disables Motion Lock, which locks the navigation map when the vehicle is in motion.
getMotionLockEnabled() boolean Returns whether Motion Lock is enabled or disabled.
getMotionLockSpeedThreshold() MotionLockSpeedThreshold Returns a MotionLockSpeedThreshold object containing the SpeedThreshold for Motion Lock.
setMotionLockSpeedThreshold( MotionLockSpeedThreshold) void Sets the SpeedThreshold at which Motion Lock is engaged.
getTimeFormat() [Linux only] TimeFormat Returns a TimeFormat enum representing the currently set format.
setTimeFormat(TimeFormat) [Linux only] void Sets the time format for CoPilot.
getUnitsOfMeasure() UnitsofMeasure Gets the UnitsOfMeasure displayed by CoPilot.
setUnitsOfMeasure(int) void Sets the UnitsOfMeasure displayed by CoPilot.
getVersionInfo() CopilotVersion Returns a CopilotVersion object containing information about CoPilot’s application version number and map data version.
setTurnInstructionCallbackDelay(int) void Sets the time between when turn instruction callbacks onReadyToSpeakTurnInstruction and onSpeakTurnInstructionComplete are fired when CoPilot starts speaking.
getTurnInstructionCallbackDelay() int Retrieves the current delay between when the turn instruction callbacks onReadyToSpeakTurnInstruction and onSpeakTurnInstructionComplete.
getView() [Android only] View Retrieves the view associated with the CoPilot service.
isActive() [Android only] boolean Determines if CoPilot can receive API calls. APIs can only be called after the onCPStartup callback is sent and before the onCPShutdown callback returns.
enableGPS() [Android only] void Restarts the CoPilot GPS Service and resumes all suspended GPS activities including listening, and processing.
disableGPS() [Android only] void Suspends background GPS/routing processing and deregister the CoPilot GPS Service. Background Navigation will not work after this API call.
setBillingProvider (IBillingProviderInterface) [Android only] void Sets a third-party, in-app billing provider that should be used by CoPilot for in-app billing operations.
setCopilotStartupParameters (CopilotStartupParams) [Android only] void Sets the CopilotStartupParams object that contains overridden methods used during CoPilot Startup.
addFavorite(Favorite) void Adds a new favorite to CoPilot’s favorites list.
removeFavorite(int) void Removes a favorite from CoPilot.
getFavoritesList() List Returns the list of favorites currently stored in CoPilot's favorites list.

StopBuilder

Overview
Description Builds stops using some of the optional parameters for creating stops.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Class
Package com.alk.cpik

Methods

Method Name Return Type Description
fromLatLon(Coordinate) StopBuilder Static method to create a StopBuilder from a latitude / longitude combination.
fromCountryAndPostalCode(String, String) StopBuilder Static method to create a StopBuilder from a country and postal code combination.
fromCityAndState (String, String) StopBuilder Static method to create a StopBuilder from a city and state combination.
setLatLong (Coordinate) StopBuilder Sets lat/long information for the stop to be created.
setPostalCode (String) StopBuilder Sets postal code for the stop to be created.
setStreetAddress (String) StopBuilder Sets street address for the stop to be created.
setCity (String) StopBuilder Sets city for the stop to be created.
setState (String) StopBuilder Sets state for the stop to be created.
setCountry(String) StopBuilder Sets country for the stop to be created.
setName(String) StopBuilder Sets optional name for the stop to be created.
setCounty(String) StopBuilder Sets optional county for the stop to be created.
setDestinationFlag(boolean) StopBuilder Sets optional flag to designate whether this stop is to be a waypoint.
geocode(GeocodeSearchType) StopList Geocodes the address and returns the list of stops.
setID(String) StopBuilder Sets a custom ID for the stop. *Available in version 10.9 and greater
setNote(String) StopBuilder Sets a custom note against the stop that will be shown on the stop details screen within the CoPilot UI.*Available in version 10.9 and greater
setEarliestArrivalTime(ArrivalTimeWindowInfo) StopBuilder Sets the Earliest acceptable Arrival Time when the stop can be reached. If no date is given, the current date will be used. Requires Additional License. (Optional, but if used setLatestArrivalTime and setPlannedDuration need to be used also.) *Available in version 10.9 and greater
setLatestArrivalTime(ArrivalTimeWindowInfo) StopBuilder Sets the Latest Arrival Time for Time Window the stop should be reached. If no date is given, the current date will be used. Requires Additional License.*Available in version 10.9 and greater
setPlannedDuration(int) StopBuilder Sets the planned duration for the stop. This should reflect all the non-driving (dwell) time at the destination. Requires Additional License. *Please note Planned Duration will be updated to Seconds in future releases. Available in version 10.9 and greater
setSideOfStreetAdherence(StopSideAdherenceLevel) StopBuilder Sets Side of Street Adherence for the stop.*Available in version 10.9 and greater
setCustomFields(HashMap customFields) StopBuilder Sets Custom Field for the stop that is used when providing a custom chevron display to the driver.
Please note, to use this field the configuration setting for custom chevron display must also be set. This field should never be used to add a unique identifier to the stop, setID can be used for this purpose. Further details on the configuration setting which must be set can be found within ConfigurationSetting.*Available in version 10.9 and greater
setIcon(imageName) String Sets the icon image for a stop. The name of the image should be passed. Image of the matching name must be saved as a .png file in the save folder of the map data being used in CoPilot. *Available in version 10.9 and greater
getNearbyStreets String Returns list of nearby streets relative to the coordinates passed to CoPilot, returned as StreetSearchResult
StreetSearchResult String Provides list of nearby streets relative to the coordinates passed to CoPilot via getNearbyStreets.

Notes

To build a waypoint rather than a stop, call the setDestinationFlag() method with a false parameter. (Stops are the default.) Waypoints are locations added only to guide the route along desired roads. CoPilot will tell drivers to stop at a stop or to drive through a waypoint.

Sample Code

//StopBuilder to add stops
{
  try {
    double latitude = 40.367709;
    double longitude = -74.655784;
    // Construct a stop from coordinates
    StopBuilder latLonStop = StopBuilder.fromLatLon(new Coordinate(latitude, longitude))
      .setName("Trimble MAPS");
    Stop sampleStopA = latLonStop.geocode(GeocodeSearchType.BEST_MATCH).get(0);

    // Construct a stop from city and state
    StopBuilder cityState = StopBuilder.fromCityAndState("Princeton", "NJ")
      .setName("Princeton NJ Stop");
    Stop sampleStopC = cityState.geocode(GeocodeSearchType.BEST_MATCH).get(0);

    // Construct a stop from country and postal code
    StopBuilder countryPostalCode = StopBuilder.fromCountryAndPostalCode("United States", "08540")
      .setName("Princeton NJ");
    StopList sampleStopList = countryPostalCode.geocode(GeocodeSearchType.MULTI_MATCH);

    //add the created stops
    RouteMgr.addStop(RouteEnums.AddStopPurpose.NEW_CURRENT_DESTINATION,
      sampleStopA, false);
    RouteMgr.addStop(RouteEnums.AddStopPurpose.AFTER_FINAL_DESTINATION,
      sampleStopC, false);

    // adding the stops list
    RouteMgr.addStops(RouteEnums.AddStopPurpose.NEW_TRIP,
      sampleStopList, false);

  } catch (CopilotException \| RouteException \| GeocodingException e) {
    System.out.println("Exception! : " + e.toString());
  }
}

// StopBuilder with v10.9 enhanced fields

StopBuilder latLonStop = StopBuilder.fromLatLon(new Coordinate(40.368420, -74.655036));
ArrivalTimeWindowInfo startWindow = new ArrivalTimeWindowInfo(22, 5, 2018, 780);
ArrivalTimeWindowInfo endWindow = new ArrivalTimeWindowInfo(22, 5, 2018, 840);
latLonStop.setEarliestArrivalTime(startWindow);
latLonStop.setLatestArrivalTime(endWindow);
latLonStop.setPlannedDurationMinutes(12);
latLonStop.setSideOfStreetAdherence(StopSideAdherenceLevel.MODERATE);
latLonStop.setID("This is ID");
latLonStop.setNote("This is note");
HashMap<String,String> customFields = new HashMap<String,String>();
customFields.put("CUSTOMCHEVRONDISPLAY", "This is custom chevron message");
latLonStop.setCustomFields(customFields);
latLonStop.setIcon("myStopIcon");
try {
  Stop sampleStopA = latLonStop.setName("Trimble MAPS").geocode(GeocodeSearchType.BEST_MATCH).get(0);
} catch (GeocodingException e)
{
  e.printStackTrace();
}

Stop

Overview
Description The Stop object provides data related to a specific location. CoPilot uses this information to geocode an address and add it as a stop on a route. Depending on the information provided, CoPilot will endeavor to populate as much of the remaining information about the stop as possible. Stop objects have many optional parameters and should be created via a StopBuilder object.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Class
Package com.alk.cpik

Methods

Method Name Return Type Description
isDestination() boolean Returns true if the stop is a destination.
getName() String Gets the name of the object.
getAddress() String Gets the address of the object.
getCity() String Gets the city in which the object resides.
getState() String Gets the state in which the object resides.
getCountry() String Gets the country in which the object resides.
getCounty() String Gets the county in which the object resides.
getZip() String Gets the postal code in which the object resides.
getCoordinate() Coordinate Gets the coordinate object.
getID() String Gets the Stop ID for the the stop object.This is an optional field. Available in CoPilot 10.9 and higher
getNote() String Gets the note associated with the stop object. This is an optional field. Available in CoPilot 10.9 and higher
getEarliestArrivalTime() ArrivalTimeWindowInfo Gets the optional early time for the time window where a stop should be reached. Available in CoPilot 10.9 and higher
getLatestArrivalTime() ArrivalTimeWindowInfo Gets the latest time for the time window where a stop should be reached. This is an optional field. Available in CoPilot 10.9 and higher
getPlannedDurationMinutes() int Gets the expected Dwell/Wait time that is added to a stop. This is an optional field. *Please note Planned Duration will be updated to Seconds in a release of CoPilot. Available in CoPilot 10.9 and higher
getETA() String Gets the current ETA for this stop. Available in CoPilot 10.9 and higher
getCustomFields() Hashmap Gets a Hashmap of the optional custom fields for this stop. Available in CoPilot 10.9 and higher
getIcon() String Get the stop icon image name for the stop object. Available in version 10.9 and higher
getTimeZoneOffset() int Get time zone offset for the stop object. Available in CoPilot 10.9 and higher
isVehicleRestricted() boolean Returns true if the stop is located on a road that is limited to only pedestrians or bicycles. Available in CoPilot 10.14 and higher

Example Output

  • Name: myStop
  • Address: Hallenstraat 19
  • City: Brussels
  • State:
  • Zip: 1000
  • Country: BE
  • Waypoint: false
  • Location:
  • Coordinates:50.85N, 4.35E
  • ID: This is id
  • Note: This is a note
  • Earliest Arrival Time:5/22/2018:13:0
  • Latest Arrival Time: 5/22/2018:14:0
  • Delivery Status:EARLY
  • Planned Duration:12
  • TimeZoneOffset:240
  • Side Of Street:UNKNOWN
  • Side Of Street Adherence:MODERATE
  • Advanced ETA:2018-05-31T14:32:20-04:00
  • Icon:myStopIcon
  • Custom Field : (CUSTOMCHEVRONDISPLAY:chevronmessage)
  • Vehicle Restricted: False

stop.isVehicleRestricted

Overview
Description Returns true if the stop is mapped to a Vehicle Restricted Road (only allows pedestrians or bicycles). If this is true, CoPilot will route to closest road that allows vehicles.
Supported on Android Since Version 10.14
Supported on iOS Since Version 10.14
Type Method
Package com.alk.cpik

Syntax

stop.isVehicleRestricted();

Parameters

None

Return Values

Boolean

Sample Code

If (stop.isVehicleRestricted())
{
StringBuilder result = new StringBuilder();
result.append("Vehicle restricted: " + String.valueOf(stop.isVehicleRestricted());
}

StopBuilder.getNearbyStreets

Overview
Description This API will return a list of nearby streets relative to the coordinates passed to CoPilot. All nearby street names within the configurable distance, set as a maximum of 1 mile, will be returned. The number of streets returned can be set up to a maximum of 10. Streets will be returned sorted in order of distance.
Supported on Android Since Version 10.9
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik.stopbuilder

Syntax

public List<StreetSearchResult> getNearbyStreets(double distanceThreshold, int maxResults) throws GeocodingException
(NSArray*) getNearbyStreets:(double) distanceThreshold withMaxResults:(int) maxResults withError:(NSError* __autoreleasing*) error;

Parameters

Parameter Description
distance Maximum distance to return street names from, maximum distance of 1 mile.
maxResults Number of results to be returned. Maximum of 10.

Return Value

Street Name - String
Distance - double

Sample Code

StopBuilder sb = StopBuilder.fromLatLon(new Coordinate(39.874412, -75.242413));
List<StopBuilder.StreetSearchResult> resultList = sb.getNearbyStreets(1.0, 10);
StopBuilder *stopBuilder1 = [[StopBuilder alloc] initWithLatLon:[[Coordinate alloc] initWithLatLon:29.135773 withLon:-81.142704]];
NSArray *nearby = [stopBuilder1 getNearbyStreets:1.0 withMaxResults:5 withError:nil];

StopBuilder.StreetSearchResult

Overview
Description This API will return a list of nearby streets relative to the coordinates passed to CoPilot. All nearby street names within the configurable distance, set as a maximum of 1 mile will be returned. The number of streets returned can be limited within the request which will be returned sorted in order of distance.
Supported on Android Since Version 10.9
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik.stopbuilder

Syntax

public List<StreetSearchResult> getNearbyStreets(double distanceThreshold, int maxResults) throws GeocodingException
-(NSArray*) getNearbyStreets:(double) distanceThreshold withMaxResults:(int) maxResults withError:(NSError* __autoreleasing*) error;

Parameters

Parameter Description
distanceThreshold Maximum distance to return street names from, maximum distance of 1 mile.
maxResults Number of results to be returned

Return Value

Street Name - String
Distance - double

Sample Code

StopBuilder sb = StopBuilder.fromLatLon(new Coordinate(39.874412, -75.242413));
List<StopBuilder.StreetSearchResult> resultList = sb.getNearbyStreets(1.0, 10);
StopBuilder *stopBuilder1 = [[StopBuilder alloc] initWithLatLon:[[Coordinate alloc] initWithLatLon:29.135773 withLon:-81.142704]];
NSArray *nearby = [stopBuilder1 getNearbyStreets:1.0 withMaxResults:5 withError:nil];

GeocodeSearchType

Overview
Description An enum that allows different types of geocoding. Geocoding attempts to match user input with actual locations in the CoPilot map database.
Supported on Android Since Version 9.6.0.1000
Type Enum
Package com.alk.cpik

Values

Value Description
EXACT_MATCH_ONLY Return only one stop. Will only return a stop that is an exact match to the input.
MULTI_MATCH Will return a list of stops which are closest to the given information.
BEST_MATCH Returns the best match geocoded stop from the given information.

StopSideAdherenceLevel

Overview
Description An enumerated value that defines the Side of Street adherence level, which defines the extent to which CoPilot will try to route to the side of the street where a stop is located.
For further details on how this can affect a route, please see the Side of Street explanation document.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Enum
Package com.alk.cpik

Values

Value Description
OFF Will not reroute according to side of the street.
MINIMAL Will increase the route by up to a maximum of 1⁄4 mile to avoid ending up on the wrong side of the street.
MODERATE Will increase the route by up to a maximum of 1/2 mile to avoid ending up on the wrong side of the street.
AVERAGE Will increase the route by up to a maximum of 1 mile to avoid ending up on the wrong side of the street.
STRICT Will increase the route by up to a maximum of 5 miles to avoid ending up on the wrong side of the street.
ADHERE Will increase the route by up to a maximum of 10 miles to avoid ending up on the wrong side of the street.
STRONGLY_ADHERE Will route the driver by any possible means to reach the correct side of the street.

StopSide

Overview
Description An enumerated value that represents whether the side of street of the specified stop is known. If it is known, the value will indicate if it is on the left-hand side of the road or right.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Enum
Package com.alk.cpik

Values

Value Description
UNKNOWN Stop Side Unknown
LEFT Stop Side Left
RIGHT Stop Side Right

StopArrivalStatus

Overview
Description An enumerated value that indicates the status of the stop relative to the defined time window.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Enum
Package com.alk.cpik

Values

Value Description
UNKNOWN Arrival window status unknown
EARLY Stop arrival time early and expected before the defined window
ON_TIME On time with the defined arrival time window
AT_RISK Current ETA is at risk of the arrival time window
LATE Current ETA is later than the defined window

StopClickedInfo

Overview
Description The StopClickedInfo class is used within the onMapStopClicked callback, which is called when a user clicks on a location on the map.

StopClickedInfo can be used to replicate the UI functionality in CoPilot, and it is specifically useful if using the CPIK No_Widget views and a custom UI. This would allow the integration application to replicate the pop up information based on a user tapping on the map screen.

Supported Since Version 10.14
Platforms Supported Android, iOS Linux
Type Class
Package com.alk.cpik

Methods

Method Name Return Type Description
getClickedStop() Stop Gets information about the stop that was clicked.
getClickType() StopClickType Lets you distinguish whether a click on the map was a road, origin, destination, waypoint or intermediate stop.
toString() String Returns the string representation of the Stop object.

getClickType

Overview
Description Lets you distinguish whether a click on the map was a road, origin, destination, waypoint or intermediate stop.
Supported Since Version 10.9.0.958
Platforms Supported Android, iOS Linux
Type Method
Package com.alk.cpik

Syntax

getClickType()
A property named clickType in CoPilotStopClickedInfo class.

Parameters

None

Return Values

A StopClickType

Sample Code

@Override
public void onMapStopClicked(StopClickedInfo clickInfo)
{
if (clickInfo.getClickType() == StopClickType.ROAD)
  Log("Link: " + clickInfo.getClickedStop().toString());
else if (clickInfo.getClickType() == StopClickType.ORIGIN_STOP)
  Log("Origin Stop: " + clickInfo.getClickedStop().toString());
}
-(void) onMapStopClicked:(CoPilotStopClickedInfo*) clickInfo
{
  Stop *stop = clickInfo.clickedStop;
  enum StopClickType type = clickInfo.clickType;
}

StopClickType

Overview
Description A value that represents the type for the location a user clicked on the map.
Supported Since Version 10.9.0.958
Platforms Supported Android, iOS Linux
Type Method
Package com.alk.cpik.ui

Syntax

StopClickType.ROAD

Values
ROAD
ORIGIN_STOP
DEST_STOP
WAYPOINT
INTERMEDIATE_STOP
UNKNOWN_ERROR

Sample Code

@Override
public void onMapStopClicked(StopClickedInfo clickInfo)
{
if (clickInfo.getClickType() == StopClickType.ROAD)
  Log("Link: " + clickInfo.getClickedStop().toString());
else if (clickInfo.getClickType() == StopClickType.ORIGIN_STOP)
  Log("Origin Stop: " + clickInfo.getClickedStop().toString());
}
+(NSString*)stringFromStopClickType:(enum CPStopClickType)clickType
{
    switch (clickType) {
        case CLICK_TYPE_ROAD:
            return @"CLICK_TYPE_ROAD";
        case CLICK_TYPE_INTERMEDIATE_STOP:
            return @"CLICK_TYPE_INTERMEDIATE_STOP";
        case CLICK_TYPE_WAYPOINT:
            return @"CLICK_TYPE_WAYPOINT";
        case CLICK_TYPE_DEST_STOP:
            return @"CLICK_TYPE_DEST_STOP";
        case CLICK_TYPE_ORIGIN_STOP:
            return @"CLICK_TYPE_ORIGIN_STOP";
        case CLICK_TYPE_UNKNOWN:
        default:
            return @"CLICK_TYPE_UNKNOWN";
    }
}

ArrivalTimeWindowInfo

Overview
Description ArrivalTimeWindowInfo is a class that is used to assign a time window. Date information (i.e., day, month and year) are optional, but minutes from midnight is required. If user only specifies minutes from midnight, CoPilot will use today’s date. Minutes from midnight is the time since midnight in minutes. For example, if minutes from midnight is set to 960, this equates to a time of 4:00PM.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Object
Package com.alk.cpik

Methods

Method Name Return Type
getDay() int
getMonth() int
getYear() int
getMinutesFromMidnight() int
setDate(int, int, int) void
setMinutesFromMidnight(int) void
toString() String

Sample Code

 StopBuilder latLonStop = StopBuilder.fromLatLon(new Coordinate(40.368420, -74.655036));
ArrivalTimeWindowInfo startWindow = new ArrivalTimeWindowInfo(22, 5, 2018, 780);
ArrivalTimeWindowInfo endWindow = new ArrivalTimeWindowInfo(22, 5, 2018, 840);
latLonStop.setEarliestArrivalTime(startWindow);
latLonStop.setLatestArrivalTime(endWindow);
stopBuilder.deliveryWindowEnd = endWindow;

FavoriteBuilder

Overview
Description Favorite objects have many optional parameters, and should be built via this FavoriteBuilder class. Favorites are CoPilot's list of a user’s favorite locations.
For example: Favorite myFavorite = new FavoriteBuilder.setName("MyFavorite").setCountry("US").build();
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version Android, Linux
Type Class
Package com.alk.cpik.trip

Methods

Method Name Return Type Description
setName(String) FavoriteBuilder Sets name of the favorite.
setStreetAddress(String) FavoriteBuilder Sets street address of the favorite.
setCity(String) FavoriteBuilder Sets city of the favorite.
setState(String) FavoriteBuilder Sets state of the favorite.
setCountry(String) FavoriteBuilder Sets country of the favorite.
setZip(String) FavoriteBuilder Sets zip code of the favorite.
setFavoriteType(FavoriteType) FavoriteBuilder Sets FavoriteType of the favorite.
setFavoriteType(int) FavoriteBuilder Sets FavoriteType of the int.
setCoordinates(LocationCoordinate) FavoriteBuilder Sets coordinates of the favorite.
build() Favorite Constructs and returns a new favorite object with the information that has been set using a FavoriteBuilder object.

Sample Code

double latitude = 40.367709;
double longitude = -74.655784;
// Creating the favorite General
Favorite favoriteGeneral = new FavoriteBuilder().setName("Favorite A")
    .setCoordinates(new Coordinate(latitude, longitude))
    .setFavoriteType(Favorite.FavoriteType.GENERAL)
    .build();
// Creating the favorite Home
Favorite favoriteHome = new FavoriteBuilder().setStreetAddress("457 N Harrison St")
    .setCity("Princeton").setState("NJ")
    .setFavoriteType(Favorite.FavoriteType.HOME)
    .build();
// Creating the favorite Work
Favorite favoriteWork = new FavoriteBuilder().setStreetAddress("457 N Harrison St")
    .setCity("Princeton").setState("NJ")
    .setFavoriteType(Favorite.FavoriteType.WORK)
    .build();

// adding created Favorites in Copilot
CopilotMgr.addFavorite(favoriteGeneral);
CopilotMgr.addFavorite(favoriteHome);
CopilotMgr.addFavorite(favoriteWork);
FavoriteBuilder *favoriteBuilderA = [[FavoriteBuilder alloc] init];
favoriteBuilderA.name = @FavoriteA;
favoriteBuilderA.favoriteType = CP_FAVORITE_WORK;
Coordinate *coordinateA =
[[Coordinate alloc] initWithLatLon:40.368420 withLon:-74.655036];
favoriteBuilderA.location = coordinateA;
Favorite *favoriteA = [favoriteBuilderA getFavorite];
FavoriteBuilder *favoriteBuilderB = [[FavoriteBuilder alloc] init];
favoriteBuilderB.name = @FavoriteB;
favoriteBuilderB.favoriteType = CP_FAVORITE_HOME;
favoriteBuilderB.streetAddress = @457 N Harrison St;
favoriteBuilderB.country = @USA;
favoriteBuilderB.zipOrPostalCode = @08540;
Favorite *favoriteB = [favoriteBuilderB getFavorite];

Favorite

Overview
Description Favorite objects contain information to be used in CoPilot's list of a user’s favorite locations. Favorite objects have many optional parameters and cannot be constructed by themselves. They should be created via a FavoriteBuilder object.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Object
Package com.alk.cpik.trip

Methods

Method Name Return Type Description
getFavoriteType() FavoriteType Gets the FavoriteType describing the favorite.
getName() String Gets name of the object.
getAddress() String Gets address of the object.
getCity() String Gets city in which the object resides.
getState() String Gets state in which the object resides.
getCountry() String Gets country in which the object resides.
getZip() String Gets postal code in which the object resides.

Example Output

Name: myFavorite Address: Avenue A.J. Slegers 397 City: Brussels State: Zip: 1200 Country: BE Type: HOME Location: Coordinates: 50.84035N, 4.413889E


FavoriteType

Overview
Description An enum of the ways to define a favorite type.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Enum
Package com.alk.cpik.trip

Values

Value Description
GENERAL The favorite is a general favorite.
HOME The favorite is the Home location.
WORK The favorite is the Work location.

ContactBuilder

Overview
Description Builder to create Contact objects
Supported on Android Since Version 9.6.0
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Public Methods

Method Name Return Type
setName(String) String
setPhoneNumber(String) ContactBuilder
setEmailAddress(String) ContactBuilder
setStreetAddress(String) ContactBuilder
setCity(String) ContactBuilder
setState(String) ContactBuilder
setCountry(String) ContactBuilder
setZip(String) ContactBuilder
setCoordinates(Coordinate) ContactBuilder
build() Contact

Sample Code

Contact contactA = new ContactBuilder()
  .setName("Contact A")
  .setStreetAddress("41 Rumbridge St")
  .setCity("Southampton")
  .setCountry("GB")
  .build();

CoPilotMgr.singleSearchInit

Overview
Description This API initiates single search. This includes several HTTP requests and requires internet connection. Once the initialization has successfully finished, a callback onSingleSearchReady will be returned indicating that the other Single Search APIs are available to use.
Note: This API must be called and the onSingleSearchReady callback received before Single Search APIs can be used.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Sample Code

CopilotMgr.singleSearchInit();

// In your CopilotListener file
@Override
public void onSingleSearchReady()
{
// Single search is ready
}

SingleSearchError

Overview
Description A response enum from a request to the Single Search web service. Responses will provide information on the result of the request including specific reasons if a request fails.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Enum
Package com.alk.cpik

Value

Value Description
OK Successfully get the single search response
FAILURE_INIT Failed to initialize single search
FAILURE_WEBSERVICE Single Search Web Service returns errors
FAILURE_CONNECT There are network connection issues
FAILURE_INVALID_JSON While using singleSearchJSON API, the JSON parameter user passes in is invalid
FAILURE_DATA_NOT_LICENSED_OR_NOT_INSTALLED You requested data is either not licensed or not installed
FAILURE_DATA_NOT_AVAILABLE_FOR_RESULT The stop results returned from single search web service are not valid in CoPilot installed data
FAILURE_GENERIC Unknown errors

CopilotMgr.singleSearch

Overview
Description This API is used for a Single Search query. It will send user’s query string together with all default search settings to the Single Search web service. This API is not synchronous. A callback onSingleSearchFinished will be returned once web service gives the response back.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Syntax - static void singleSearch(String query)

Parameters String: Single search query string. Can be address, POI name, street name, city name, zip.

Sample Code

CopilotMgr.singleSearch("1 independence way princeton nj");
// In your CopilotListener file
@Override
public void onSingleSearchFinished(StopList stopList, SingleSearchError error)
{
  if (SingleSearchError.OK == error)
  {
  // Do something with stopList
  }
  else
  {
  // Do something with error
  }
}

CopilotMgr.singleSearchJSON

Overview
Description This API is used for Single Search query. User needs to pass a JSON string containing the query with the customized search settings. This API is not synchronous. A callback onSingleSearchFinished will be fired once web service gives the response back.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Syntax - static void singleSearchJSON(String settingsJSON)

Parameters String: A json string that contains query string as well as search settings. Below is an example:

{
  "Query": "1 independence way princeton nj",
  "MaxResults":20,
  "Location":{
   "Address":{
     "StreetAddress":"1 independence way",
     "City":"Princeton",
     "State":"NJ",
     "Zip":"08540",
     "County":"Mercer",
     "Country":""
   },
   "Coords":{
    "Lat":"40.361076",
    "Lon":"-74.601515"
   }
  },
  "Searchtype":1,
  "PoiCategories":["Airport", "bank", "CAT scales"],
  "Countries":["CA", "US", "GL"],
  "States":["NJ", "NM"]

Sample Code

// Assuming you formed the json into queryJSON
CopilotMgr.singleSearch(queryJSON);

// In your CopilotListener file
@Override
public void onSingleSearchFinished(StopList stopList, SingleSearchError error)
{
  if (SingleSearchError.OK == error)
  {
  // Do something with stopList
  }
  else
  {
  // Do something with error
  }
}

CopilotMgr.getSingleSearchPOICategories

Overview
Description This API is used to get a list of POI categories that can be recognized by Single Search web service. This is used to form the json string for singleSearchJSON API, specifically the “PoiCategories” field.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Syntax - static List getSingleSearchPOICategories()

Return Values - List

Sample Code

List<String> poiCategories = CopilotMgr.getSingleSearchPOICategories();
String result = "";
for (String poi : poiCategories)
{
  // Do something with poi
}

CopilotMgr.getSingleSearchCountries

Overview
Description This API will return the list of countries the user is able to search within. User may need it to form the json string (the "Countries" field) for singleSearchJSON API.
Please note the countries that are returned must have been licensed, map data present on the device and those countries supported by the Single Search Web service.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type
Package com.alk.cpik

Syntax - static List getSingleSearchCountries ()

Return Values - List

Sample Code

List<String> countries = CopilotMgr.getSingleSearchCountries ();
String result = "";
for (String country : countries)
{
  // Do something with country
}

CopilotMgr.getSingleSearchStates

Overview
Description This API will return the list of states the user is able to search within. User may need it to form the json string (the "States" field) for singleSearchJSON API.
Please note the states that are returned are those within regions that have been licensed, appropriate map data is present on the device and those states supported by the Single Search Web service.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Sample Code

List<String> states = CopilotMgr. getSingleSearchStates ();
String result = "";
for (String state : states)
{
  // Do something with state
}

Motion Lock

Motion Lock is a safety feature within CoPilot which limits access to the CoPilot UI once traveling above a threshold speed. This feature has been enhanced to increase the amount of interaction that is available through multiple modes available.

CoPilotMgr.setMotionLockMode

Overview
Description Motion lock will lock the CoPilot UI once traveling above a specified speed. The UI can be locked down over a different range of modes, restricting more or less of the UI based on integration needs.
The threshold at which Motion Lock will be initiated should be set using setMotionLockSpeedThreshold. This API is just to set the lock mode, it’s not responsible for the actual lock to be activated.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Syntax - Java - static void setMotionLockMode(MotionLockMode mode)

Parameters

Parameter Description
MotionLockMode The mode that you want CoPilot to locked down to once motion lock has been initiated. This will dictate the available options once traveling above the specified threshold speed.

Sample Code

// set ALL_UI_LOCK mode
CopilotMgr.setMotionLockMode(MotionLockMode.ALL_UI_LOCK);

CopilotMgr.getMotionLockMode

Overview
Description To return the current Motion Lock mode this API should be used. The mode dictates the extent to which the CoPilot UI will be locked down once initiated and traveling above the threshold speed. This will not return the threshold speed.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Syntax

static MotionLockMode getMotionLockMode()
+(CP_MotionLockMode) getMotionLockMode

Return Values - MotionLockMode

Sample Code

MotionLockMode mode = CopilotMgr.getMotionLockMode();
enum CP_MotionLockMode mode = [CopilotMgr getMotionLockMode];

MotionLockMode

Overview
Description A value representing the Motion Lock UI mode that CoPilot will apply when motion lock is activated.
Supported Since Version 10.9
Platforms Supported Android, Linux
Type Enum
Package com.alk.cpik

Values

Value Description
ALL_UI_UNLOCK Unlock all UI, do not lock any UI elements when traveling above the threshold speed.
ALL_UI_LOCK Lock all UI when traveling above the defined threshold speed. This will also disable all pop ups except for the destination arrival pop up. All action required pop-ups have a default decision which will be followed if they are shown.
ONLY_DRIVING_UI_ACCESS Only allow access to driving functions. This will Lock access to the entire UI with the exception of the following:

Driving Menu → 2D/3D
Driving menu → Directions/Safety
Driving Menu → Clear Destination
Driving Menu → Close
Zoom buttons on map
Reset to current location button on map
POI Alert button on map
Popups
Map drag/swipe/pan/multi touch
Sound mute button
Mapsure button on navigation dialog

This is the default mode available within the CoPilot UI.

ONLY_DRIVING_UI_ACCESS_EXTEND ONLY_DRIVING_UI_ACCESS plus access to the following (disable keyboard):

Driving Menu → Find POIs
Main POI categories
Search All
More Categories
Driving Menu → My Route → Alternate
Go (Green circular button on plan trip screen)
Traffic Bar and traffic refresh button
Buttons in flow traffic map except for the setting button

PASSENGER_MODE Allow a temporary disablement of Motion Lock when used by a passenger. Motion Lock settings should be resumed upon restarting CoPilot.
When this mode is set, all UI will be unlocked. Once the application is re-launched CoPilot will resume in the previous MotionLock mode.
To enable this mode the following configuration is required to be set within the user.cfg:

[User Settings]
"EnablePassengerMode"=1

Once this is set this mode being passed will replicate the user selecting the passenger mode button within the UI.


CopilotMgr.getMotionLockEnabled

Overview
Description Returns whether or not Motion Lock is currently enabled. Motion Lock will lock the CoPilot navigation screen, preventing user input, then the current speed is greater than or equal to a certain threshold. This threshold can be set using setMotionLockSpeedThreshold.
Supported on Android Since Version 9.6.0.821
Supported on Android Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

boolean getMotionLockEnabled()
+(bool) getMotionLockEnabled

Return Value

Boolean - True if enabled, false if disabled.

Sample Code

// Print out whether or not motion lock is enabled
{
  try {
    boolean bMotionLockEnabled = CopilotMgr.getMotionLockEnabled();
    System.out.println("Motion lock enabled: " + String.valueOf(bMotionLockEnabled));
  } catch (CopilotException e) {
    System.out.println("Exception! : " + e.toString());
  }
}
NSLog([NSString stringWithFormat:@"Motion Lock is: %@", ([CopilotMgr
getMotionLockEnabled] == false) ? @"Not enabled" : @"Enabled"]);

CopilotMgr.enableMotionLock

Overview
Description Enables or disables the Motion Lock in CoPilot. Motion Lock will lock the CoPilot navigation screen, preventing user input, when the current speed is greater than or equal to a certain threshold. This threshold can be set using setMotionLockSpeedThreshold.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void enableMotionLock(Boolean enable)
+(bool) enableMotionLock:(bool)

Parameters

boolean enable - Set to true to enable, false to disable.

Sample Code

try {
  // Disable motion lock
  CopilotMgr.enableMotionLock(false);
  // Enable motion lock
  CopilotMgr.enableMotionLock(true);
} catch (CopilotException e) {
  System.out.println("Exception! : " + e.toString());
}
[CopilotMgr enableMotionLock:false];
[CopilotMgr enableMotionLock:true];

CopilotMgr.getMotionLockSpeedThreshold

Overview
Description Returns the current speed threshold at which Motion Lock will be enabled. Motion Lock will lock the CoPilot navigation screen, preventing user input, when the vehicle’s speed reaches this threshold.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

MotionLockSpeedThreshold getMotionLockSpeedThreshold()
+(enum CP_MotionLockSpeedThreshold) getMotionLockSpeedThreshold

Return Value

MotionLockSpeedThreshold - An Enum indicating the speed above which Motion Lock is active.

Sample Code

try {
  // Get the current motion lock speed threshold and print
  MotionLockSpeedThreshold threshold = CopilotMgr.getMotionLockSpeedThreshold();
  switch (threshold) {
    case LEVEL_1:
      System.out.println("Motion lock will enable at 5 MPH");
      break;
    case LEVEL_2:
      System.out.println("Motion lock will enable at 10 MPH");
      break;
    case LEVEL_3:
      System.out.println("Motion lock will enable at 15 MPH");
      break;
    case LEVEL_4:
      System.out.println("Motion lock will enable at 20 MPH");
      break;
    default:
      System.out.println("Motion lock threshold is not set");
      break;
  }
} catch (CopilotException e) {
  System.out.println("Exception! : " + e.toString());
}
NSString *value = [[[NSString alloc] init] autorelease];

switch([CopilotMgr getMotionLockSpeedThreshold])
{
 case CP_LEVEL_NOT_SET:
 value = @"CP_LEVEL_NOT_SET";
 break;
 case CP_LEVEL_1:
 value = @"CP_LEVEL_1";
 break;
 case CP_LEVEL_2:
 value = @"CP_LEVEL_2";
 break;
 case CP_LEVEL_3:
 value = @"CP_LEVEL_3";
 break;
 case CP_LEVEL_4:
 value = @"CP_LEVEL_4";
 break;
 default:
 break;
}
NSLog([NSString stringWithFormat:@"Motion Lock Speed threshold is: %@",
value]);

CopilotMgr.setMotionLockSpeedThreshold

Overview
Description Sets the threshold (in mph) for enabling and disabling Motion Lock. Motion Lock prevents user interaction with CoPilot while driving at or above a specified speed threshold.
The values for this API can be found in the MotionLockSpeedThreshold Enum API.
Supported Since Version 9.6.0.821
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Syntax

void setMotionLockThreshold(MotionLockSpeedThreshold speedThreshold)
+(void) setMotionLockThreshold:(enum CP_MotionLockThreshold)

Parameters

speedThreshold – An Enum indicating the speed limit which, once reached, will enforce Motion Lock.

Sample Code

try {
  // Set motion lock to enable at speeds over 5 MPH
  CopilotMgr.setMotionLockSpeedThreshold(MotionLockSpeedThreshold.LEVEL_1);
  // Set motion lock to enable at speeds over 15 MPH
  CopilotMgr.setMotionLockSpeedThreshold(MotionLockSpeedThreshold.LEVEL_3);
} catch (CopilotException e) {
  System.out.println("Exception! : " + e.toString());
}
[CopilotMgr setMotionLockSpeedThreshold:CP_LEVEL_1];
[CopilotMgr setMotionLockSpeedThreshold:CP_LEVEL_4];

CopilotMgr.getUnitsOfMeasure

Overview
Description Returns the measurement type currently set within CoPilot, metric or imperial. Units of Measurement are used for functions including speed, distance and vehicle dimensions.
Supported on Android Since Version 9.6.0.821
Supported on Android Since Version 10.9
Type Method
Package com.alk.cpik
Measure Metric Imperial
Speed Kilometers per Hour (KPH) Miles per Hour (MPH)
Distance Kilometers, Meters, Centimeters Miles, Feet, Inches
Vehicle Dimensions Meters, Centimeters, Ton Feet, Inches, Ton, 000’s Pounds (US)

Syntax

UnitsOfMeasure getUnitsOfMeasure()
+(CP_UnitsOfMeasure) getUnitsOfMeasure

Return Value

UnitsOfMeasure - An Enum representing either metric or imperial units.

Sample Code

try {
  // Print which measurement system CoPilot is using
  UnitsOfMeasure currentUnits = CopilotMgr.getUnitsOfMeasure();
  if (currentUnits == UnitsOfMeasure.METRIC)
    System.out.println("CoPilot is using the metric units");
  else if (currentUnits == UnitsOfMeasure.IMPERIAL)
    System.out.println("CoPilot is using the imperial units");
} catch (CopilotException e) {
  e.printStackTrace();
NSString *isMetric;
if([CopilotMgr getUnitsOfMeasure] == CP_METRIC)
 isMetric = @"Units of measure: Metric";
else
 isMetric = @"Units of measure: Imperial";

NSLog(isMetric);

CopilotMgr.setUnitsOfMeasure

Overview
Description Sets whether metric or imperial values should be used within CoPilot. Units of Measurement are used for functions including speed, distance and vehicle dimensions.
Supported on Android Since Version 9.6.0.757
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik
Measure Metric Imperial
Speed Kilometers per Hour (KPH) Miles per Hour (MPH)
Distance Kilometers, Meters, Centimeters Miles, Feet, Inches
Vehicle Dimensions Meters, Centimeters, Ton Feet, Inches, Ton, 000’s Pounds (US)

Syntax

void setUnitsOfMeasure(UnitsOfMeasure)
+(void) setUnitsOfMeasure(enum CP_UnitsOfMeasure)

Parameters

UnitsOfMeasure - An Enum representing either metric or imperial units.

Return Value

Void

Sample Code

try {
  // Set CoPilot to use the metric unit system
  CopilotMgr.setUnitsOfMeasure(UnitsOfMeasure.METRIC);

  // Set CoPilot to use the imperial unit system
  CopilotMgr.setUnitsOfMeasure(UnitsOfMeasure.IMPERIAL);
} catch (CopilotException e) {
  e.printStackTrace();
}
[CopilotMgr setUnitsOfMeasure:CP_IMPERIAL];
[CopilotMgr setUnitsOfMeasure:CP_METRIC];

CopilotMgr.getVersionInfo

Overview
Description Returns a CoPilot version object, which includes details of the currently installed CoPilot application version number as well as the map data release (year and quarter).
Supported on Android Since Version 9.6.0.821
Supported on Android Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

CopilotVersion String getVersionInfo()
+(CoPilotVersion*) getVersionInfo

Return Value

CopilotVersion containing information about the version of the CoPilot application and map data.

Sample Code

try {
  // Print information about CoPilot
  CopilotVersion currVersion = CopilotMgr.getVersionInfo();
  System.out.println("CoPilot application version: " + currVersion.getAppVersion());
  System.out.println("CoPilot map data version: " + currVersion.getDataVersion());
  System.out.println("CoPilot map data year: " + currVersion.getDataYear());
  System.out.println("CoPilot map data quarter: " + currVersion.getDataQuarter());
} catch (CopilotException e) {
  e.printStackTrace();
}
CoPilotVersion *version = [CopilotMgr getVersionInfo];
NSLog(version.appVersion);
NSLog (version.dataVersion);

CopilotMgr.setTurnInstructionCallbackDelay

Overview
Description Allows the integrated application to set a time delay between the notification that a turn instruction is about to be played and when CoPilot actually starts to speak. This is used to delay the announcement, allowing for the muting of other audio such as a radio or a third-party application announcement.
The delay is in milliseconds, and will impact the onReadyToSpeakTurnInstruction and onSpeakTurnInstructionComplete.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void setTurnInstructionCallbackDelay(int delay)
+(void) setTurnInstructionCallbackDelay:(int)

Parameters

Delay – The number of milliseconds for which to delay the time between turn instruction callbacks and speech instructions. Must be between 0 and 2000, inclusive.

Sample Code

try {
  // Set the delay to 1.5 seconds
  int delayMilliSecond = 1500;
  CopilotMgr.setTurnInstructionCallbackDelay(delayMilliSecond);
  System.out.println("TurnInstructionCallbackDelay is set for " + delayMilliSecond + " millisecond");
} catch (CopilotException e) {
  e.printStackTrace();
}
[CopilotMgr setTurnInstructionCallbackDelay:500];

CopilotMgr.getTurnInstructionCallbackDelay

Overview
Description Retrieves the current time delay between the notification a turn instruction is about to be played and when CoPilot actually starts to speak. The delay is in milliseconds.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

int getTurnInstructionCallbackDelay ()
+(int) getTurnInstructionCallbackDelay

Return Value

Returns an int value to represent delay in milliseconds.

Sample Code

try {
  // Print the current turn instruction delay
  int currDelayMs = CopilotMgr.getTurnInstructionCallbackDelay();
  System.out.println("Current delay: " + String.valueOf(currDelayMs) + "milliseconds");
} catch (CopilotException e) {
  e.printStackTrace();
}
NSLog(@%d, [CopilotMgr getTurnInstructionCallbackDelay]);

CopilotMgr.getView

Overview
Description Retrieves the view associated with the CoPilot service. CoPilot only has one view; multiple calls to this function will return the same instance. In order to reuse the view, it must be removed from its parent. If CoPilot should have focus, requestFocus() must be used instead.
Supported on Android Since Version 9.6.0.821
Type Method
Package com.alk.cpik

Syntax

View getView

Parameters

None

Return Value

android.view.View object

Sample Code

// getting current CoPilot view
View v = CopilotMgr.getView();

// View needs focus in order to bring up the keyboard and handle navigation within CoPilot with the back button
v.requestFocus();

CopilotMgr.isActive

Overview
Description Determines whether or not CoPilot is able to receive API calls. APIs can be called only after onCPStartup is sent and before onCPShutdown returns.
Supported on Android Since Version 9.6.0.821
Type Method
Package com.alk.cpik

Syntax

boolean isActive()

Parameters

None.

Return Value

Boolean - True if CoPilot is ready to receive API calls, false otherwise.

Sample Code

// Print whether or not CoPilot is ready to receive API calls
if (CopilotMgr.isActive())
  System.out.println("CoPilot is ready to receive API calls.");
else
  System.out.println("CoPilot is NOT ready to receive API calls.");

CopilotMgr.setCopilotStartupParameters

Overview
Description Sets a CopilotStartupParams object that contains overridden methods used during CoPilot Startup.
Supported on Android Since Version 9.6.0.821
Type Method
Package com.alk.cpik

Syntax

Java void setCopilotStartupParameters(CopilotStartupParams copilotStartupParams)

Parameters

copilotStartupParams - object that contains overridden methods used during CoPilot Startup.

Return Value

void

Sample Code

CopilotStartupParams mStartupParams = new CopilotStartupParams() {
  @Override
  protected boolean useTabletLayout() {
    boolean xlarge =((getApplicationContext().getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE);
    boolean large = ((getApplicationContext().getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);

    return (xlarge || large);
  }
};
CopilotMgr.setCopilotStartupParameters(mStartupParams);

CopilotMgr.enableGPS

Overview
Description Restarts the CoPilot GPS Service and resumes all suspended activities following the API call CopilotMgr.disableGPS(). CoPilot will register with the GPS receiver to initiate listening and processing the current position again.
Supported on Android Since Version 9.6.0.1184
Supported on Android Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void enableGPS()

Parameters

None.

Return Value

void

Sample Code

try {
  // Resume CoPilot GPS Service
  CopilotMgr.enableGPS();
  System.out.println("GPS is enabled.");
} catch (CopilotException e) {
    e.printStackTrace();
}
[CopilotMgr enableGPS];

CopilotMgr.disableGPS

Overview
Description Attempts to minimize CPU usage by suspending background GPS/routing processing and unregistering the CoPilot GPS Service. Background navigation will not work after this API call; this will mean that your application cannot retrieve updated ETA or distance information.
Supported on Android Since Version 9.6.0.1184
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void disableGPS()

Parameters

None.

Return Value

void

Sample Code

try {
    // Unregister the CoPilot GPS service
    CopilotMgr.disableGPS();
    System.out.println("GPS is disabled.");
} catch (CopilotException e) {
    e.printStackTrace();
}
[CopilotMgr disableGPS];

CopilotMgr.setBillingProvider

Overview
Description Sets a third-party, in-app billing provider that should be used by CoPilot for in-app billing operations. This requires implementation of the IBillingProviderInterface interface. This requires integration with googleplaybilling.jar which is included in the “Library and Resources/jars” folder of the initial application delivery.
Supported on Android Since Version 9.6.0.821
Type Method
Package com.alk.cpik

Syntax

void setBillingProvider(IBillingProviderInterface billingProvider)

Parameters

billingProvider - Implementation of the com.alk.copilot.IBillingProviderInterface interface.

Return Value

void

Sample Code Java

// Set billing provider
final int billingRequestCode = 1;
Activity activityPointer = new MainActivity();
IBillingProviderInterface billingProvider = new BillingManager(activityPointer, billingRequestCode); // user can use 'this' instead of activityPointer
CopilotMgr.setBillingProvider(billingProvider);

CopilotMgr.addFavorite

Overview
Description Adds a new favorite location (address or point of interest) to CoPilot’s favorite list. FavoriteStop must be geocoded and the lat/long set within FavoriteBuilder before calling this API.
Once favorites have been successfully added, they will be available for the driver to select in the CoPilot address entry screen. Favorites can be assigned a name and address, and they can also be set to different types, including Home, Work, and General.

Favorites should be built using a FavoriteBuilder object.

Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void addFavorite(Favorite)
+(void) addFavorite:(Favorite*)

Parameters

favorite - A favorite object built with FavoriteBuilder.

Return Value

void

Sample Code

// Add a new favorite to CoPilot
FavoriteBuilder favoriteBuilder = new FavoriteBuilder();
favoriteBuilder.setName("Trimble MAPS");
favoriteBuilder.setStreetAddress("457 N Harrison St");
favoriteBuilder.setCity("Princeton");
favoriteBuilder.setState("NJ");
favoriteBuilder.setZip("08540");
favoriteBuilder.setFavoriteType(Favorite.FavoriteType.GENERAL);
Favorite favorite = favoriteBuilder.build();
CopilotMgr.addFavorite(favorite);
FavoriteBuilder *favoriteBuilderA = [[FavoriteBuilder alloc] init];
favoriteBuilderA.name = @FavoriteA;
favoriteBuilderA.favoriteType = CP_FAVORITE_WORK;
Coordinate *coordinateA =
[[Coordinate alloc] initWithLatLon:40.368420 withLon:-74.655036];
favoriteBuilderA.location = coordinateA;
Favorite *favoriteA = [favoriteBuilderA getFavorite];
FavoriteBuilder *favoriteBuilderB = [[FavoriteBuilder alloc] init];
favoriteBuilderB.name = @FavoriteB;
favoriteBuilderB.favoriteType = CP_FAVORITE_HOME;
favoriteBuilderB.streetAddress = @457 N Harrison St;
favoriteBuilderB.country = @USA;
favoriteBuilderB.zipOrPostalCode = @08540;
Favorite *favoriteB = [favoriteBuilderB getFavorite];
[CopilotMgr addFavorite:favoriteA];
  [CopilotMgr addFavorite:favoriteB];

CopilotMgr.removeFavorite

Overview
Description Removes unwanted locations from CoPilot’s favorite list. The favorite list can be retrieved by calling CopilotMgr.getFavoritesList(). Once successfully removed, the driver will no longer see the unwanted locations in CoPilot.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik.trip

Syntax

void removeFavorite(int)
(void)removeFavorite:(int)

Parameters

Index - The index of the location to be removed within the favorites list, as returned by a call to CopilotMgr.getFavoritesList().

Sample Code

// Remove a favorite
List<Favorite> favoriteList = CopilotMgr.getFavoritesList();
// Remove the first favorite in above favoriteList
int indexToRemove = 0;
CopilotMgr.removeFavorite(indexToRemove);
System.out.println("Favorite " + favoriteList.get(indexToRemove).toString() +" is removed.");
[CopilotMgr removeFavorite:0];

CopilotMgr.getFavoritesList

Overview
Description Returns the list of all favorites currently stored in CoPilot's favorites list. This list will match the complete list available within the CoPilot address search menu.
Supported on AndroidSince Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

java.util.List getFavoritesList()
+(NSArray*) getFavoriteList

Return Value

java.util.List - Returns the list of favorites currently stored in CoPilot's favorites list.

Sample Code

// Print out the list of favorites
List<Favorite> favoriteList = CopilotMgr.getFavoritesList();
for (int currFavIndex = 0; currFavIndex < favoriteList.size(); currFavIndex++) {
    Favorite currentFavorite = favoriteList.get(currFavIndex);
    System.out.println("Favorite Type " + currentFavorite.getFavoriteType());
    System.out.println("Favorite Name " + currentFavorite.getName());
    System.out.println("Favorite Address " + currentFavorite.getAddress());
    System.out.println("Favorite City " + currentFavorite.getCity());
    System.out.println("Favorite Country " + currentFavorite.getCountry());
    System.out.println("Favorite Zip " + currentFavorite.getZip());
    System.out.println("Favorite State " + currentFavorite.getState());
    System.out.println("Favorite Coordinate " + currentFavorite.getCoordinate());

    //to get all  values at the same time we can use
    System.out.println(currentFavorite.toString());
}
NSArray *favoriteList = [CopilotMgr getFavoritesList];

 for(Favorite *favorite in favoriteList)
 {
 NSLog(@"Favorite");
 NSLog([NSString stringWithFormat:@"Name: %@", favorite.name]);
 NSLog(NSString stringWithFormat:@"Address: %@",
favorite.address]);
 NSLog(NSString stringWithFormat:@"City: %@", favorite.city]);
 NSLog(NSString stringWithFormat:@"State: %@", favorite.state]);
 NSLog(NSString stringWithFormat:@"Country: %@",
favorite.country]);
 NSLog(NSString stringWithFormat:@"Zip: %@", favorite.zip]);
 NSLog(NSString stringWithFormat:@"Type: %d",
favorite.favoriteType]s);
 }

CopilotMgr.allowCellularDataForGlobalUsage

Overview
Description Sets the global configuration for the use of cellular data for CoPilot services that require an Internet connection, such as ActiveTraffic. This configuration setting needs to be true before any other cellular data configuration settings can be changed.
These settings only configure cellular connections and do not affect the use of Wi-Fi for CoPilot services.
Control over the use of cellular data for specific features can be set with the following APIs: allowCellularDataForFeedback, allowCellularDataForMapDownloads, allowCellularDataForNewsAndUpdates, allowCellularDataForSearch, allowCellularDataForSystemFiles,allowCellularDataForTrafficServices
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void allowCellularDataForGlobalUsage(boolean bEnable)
+(void)allowCellularDataForGlobalUsage:(bool)bEnable

Parameters

bEnable – Enables or disables the global use of cellular data.

Sample Code

try {
    boolean bEnable = true;
    CopilotMgr.allowCellularDataForGlobalUsage(bEnable);
    if(bEnable)
        System.out.println("allowCellularDataForGlobalUsage is set as enabled");
    else
        System.out.println("allowCellularDataForGlobalUsage is set as disabled");
} catch (CopilotException e) {
    e.printStackTrace();
}
[CopilotMgr allowCellularDataForGlobalUsage:true];

CopilotMgr.isAllowingCellularDataForGlobalUsage

Overview
Description Retrieves the current setting for global cellular data usage, enabled or disabled. This needs to return true before any other cellular data configurations can be changed.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

boolean isAllowingCellularDataForGlobalUsage ()
+(bool) isAllowingCellularDataForGlobalUsage

Return Value

Boolean - True if CoPilot is using cellular data, false otherwise.

Sample Code

try {
    boolean bEnabled = CopilotMgr.isAllowingCellularDataForGlobalUsage();
    if(bEnabled)
        System.out.println("CellularDataForGlobalUsage is allowed.");
    else
        System.out.println("CellularDataForGlobalUsage is not allowed. ");
} catch (CopilotException e) {
    e.printStackTrace();
}
bool b = [CopilotMgr isAllowingCellularDataForGlobalUsage];

CopilotMgr. allowCellularDataForFeedback

Overview
Description Sets whether or not cellular data can be used when providing map data feedback to Trimble MAPS. If disabled, users will only be able to provide map data feedback via a Wi-Fi connection. This feature is only available for Trimble’s own data for North America.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

allowCellularDataForFeedback (boolean bEnable)
+(bool) isAllowingCellularDataForGlobalUsage

Parameters

bEnable – Enables or disables the use of cellular data for feedback.

Sample Code

try {
    boolean bEnable = true;
    CopilotMgr.allowCellularDataForFeedback(bEnable);
    if(bEnable)
        System.out.println("allowCellularDataForFeedback is set as enabled" );
    else
        System.out.println("allowCellularDataForFeedback is set as disabled" );

} catch (CopilotException e) {
    e.printStackTrace();
}
[CopilotMgr allowCellularDataForFeedback:true];

CopilotMgr.isAllowingCellularDataForFeedback

Overview
Description Retrieves the current setting from CoPilot of whether or not cellular data is enabled for providing map data feedback to Trimble MAPS. This feature is only available for Trimble’s own data for North America.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

boolean isAllowingCellularDataForFeedback ()
+(bool) isAllowingCellularDataForFeedback

Return Value

Boolean - True if CoPilot is using cellular data for feedback, false otherwise.

Sample Code

try {
    boolean bEnabled = CopilotMgr.isAllowingCellularDataForFeedback();
    if(bEnabled)
        System.out.println("CellularDataForFeedback is allowed." );
    else
        System.out.println("CellularDataForFeedback is not allowed. ");
} catch (CopilotException e) {
    e.printStackTrace();s
}
bool b = [CopilotMgr isAllowingCellularDataForFeedback];

CopilotMgr.allowCellularDataForMapDownloads

Overview
Description Sets whether or not cellular data can be used to download map data to the device. CoPilot map data is stored locally on a device. Due to the potential size of map data, it is recommended that cellular data use should not be allowed for map downloads without considering the monthly cellular data limits for the device.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Note

Map data sizes vary per region, but can be up to 5 GB.

Syntax

void allowCellularDataForMapDownloads(boolean bEnable)
+(void)allowCellularDataForMapDownloads:(bool)bEnable

Parameters

Boolean - Set to true to use cellular data for map data downloads, false otherwise.

Sample Code

try {
    boolean bEnable = true;
    CopilotMgr.allowCellularDataForMapDownloads(bEnable);
    if(bEnable)
        System.out.println("allowCellularDataForMapDownloads is set as enabled" );
    else
        System.out.println("allowCellularDataForMapDownloads is set as disabled" );

} catch (CopilotException e) {
    e.printStackTrace();
}
[CopilotMgr allowCellularDataForMapDownloads:true];

CopilotMgr.isAllowingCellularDataForMapDownloads

Overview
Description Retrieves the current setting from CoPilot of whether or not map data can be downloaded using the cellular network.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

boolean isAllowingCellularDataForMapDownloads()
+(bool) isAllowingCellularDataForMapDownloads

Return Value

Boolean - True if CoPilot is using cellular data for map downloads, false otherwise.

Sample Code

try {
    boolean bEnabled = CopilotMgr.isAllowingCellularDataForMapDownloads();
    if(bEnabled)
        System.out.println("CellularDataForMapDownloads is allowed." );
    else
        System.out.println("CellularDataForMapDownloads is not allowed. ");
} catch (CopilotException e) {
    e.printStackTrace();
}
bool b = [CopilotMgr isAllowingCellularDataForMapDownloads];

CopilotMgr.allowCellularDataForNewsAndUpdates

Overview
Description Sets whether or not cellular data can be used to retrieve news and updates. News and Updates can be found within the MyCoPilot Menu.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void allowCellularDataForNewsAndUpdates(boolean bEnable)
+(void)allowCellularDataForNewsAndUpdates:(bool)bEnable

Parameters

bEnable – Enables or disables the use of cellular data for news and updates.

Sample Code

try {
    boolean bEnable = true;
    CopilotMgr.allowCellularDataForNewsAndUpdates(bEnable);
    if(bEnable)
        System.out.println("allowCellularDataForNewsAndUpdates is set as enabled" );
    else
        System.out.println("allowCellularDataForNewsAndUpdates is set as disabled" );
} catch (CopilotException e) {
    e.printStackTrace();
}
[CopilotMgr allowCellularDataForNewsAndUpdates:true];

CopilotMgr.isAllowingCellularDataForNewsAndUpdates

Overview
Description Retrieves the current setting in CoPilot for whether or not cellular data can be used for news and updates.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

boolean isAllowingCellularDataForNewsAndUpdates()
+(bool) isAllowingCellularDataForNewsAndUpdates

Return Value

Boolean - True if CoPilot is using cellular data for news and updates, false otherwise.

Sample Code

try {
  boolean bEnabled = CopilotMgr.isAllowingCellularDataForNewsAndUpdates();
  if(bEnabled)
  System.out.println("CellularDataForNewsAndUpdates is allowed.");
  else
  System.out.println("CellularDataForNewsAndUpdates is not allowed.");
} catch (CopilotException e) {
  e.printStackTrace();
}
bool b = [CopilotMgr isAllowingCellularDataForNewsAndUpdates];

CopilotMgr.allowCellularDataForSearch

Overview
Description Sets whether or not cellular data can be used for destination searches using third-party suppliers. Address and point of interest (POI) search is managed locally on the device using the onboard maps, but CoPilot also has plug-ins to third-party suppliers for extra locations and information. These third-party searches require an Internet connection.
If you disable cellular data for Address and POI searches, it would also be advisable to disable that search menu option in CoPilot. (The feature is likely to be required while the driver is not connected to Wi-Fi.) To do this, please see additional documentation for customizing the CoPilot user interface.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void allowCellularDataForSearch(boolean bEnable)
+(void)allowCellularDataForSearch:(bool)bEnable

Parameters

bEnable – Enables or disables the use of cellular data for searches.

Sample Code

try {
  boolean bEnable = true;
  CopilotMgr.allowCellularDataForSearch(bEnable);
  if(bEnable)
  System.out.println("allowCellularDataForSearch is set as enabled");
  else
  System.out.println("allowCellularDataForSearch is set as disabled");
} catch (CopilotException e) {
  e.printStackTrace();
}
[CopilotMgr allowCellularDataForSearch:true];

Related APIs


CopilotMgr.isAllowingCellularDataForSearch

Overview
Description Retrieves the current setting in CoPilot of whether or not cellular data can be used for destination searches using third-party suppliers.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

boolean isAllowingCellularDataForSearch()
+(bool) isAllowingCellularDataForSearch

Return Value

Boolean - True if CoPilot is using cellular data for searches, false otherwise.

Sample Code

try {
  boolean bEnabled = CopilotMgr.isAllowingCellularDataForSearch();
  if(bEnabled)
  System.out.println("CellularDataForSearch is allowed.");
  else
  System.out.println("CellularDataForSearch is not allowed.");
} catch (CopilotException e) {
  e.printStackTrace();
}
bool b = [CopilotMgr isAllowingCellularDataForSearch];

Related APIs


CopilotMgr.allowCellularDataForSocial

Overview
Description Sets whether or not cellular data can be used for social media.
Supported Since Version 9.6.0.821
Deprecated Last Supported 9.6.8.2000
Platforms Supported Android
Type Method
Package com.alk.cpik

Syntax

Java void allowCellularDataForSocial(boolean bEnable)

Parameters

bEnable – Enables or disables the use of cellular data for social media.

Sample Code

try {
  CopilotMgr.allowCellularDataForSocial(true);
} catch (CopilotException e) {
  e.printStackTrace();
}

Related APIs

CopilotMgr.isActive() CoPilotMgr.allowCellularDataForGlobalUsage(boolean)


CopilotMgr.isAllowingCellularDataForSocial

Overview
Description Retrieves the current setting in CoPilot of whether or not cellular data can be used for social media.
Supported Since Version 9.6.0.821
Deprecated Last Supported 9.6.8.2000
Platforms Supported Android
Type Method
Package com.alk.cpik

Syntax

Java boolean isAllowingCellularDataForSocial ()

Return Value

Boolean - True if CoPilot is using cellular data for social media, false otherwise.

Sample Code

boolean isAllowingCellularDataForSocial ()

Related APIs

CopilotMgr.isActive() CoPilotMgr.allowCellularDataForGlobalUsage(boolean)


CopilotMgr.allowCellularDataForSystemFiles

Overview
Description Sets whether or not cellular data can be used to download the required system files. CoPilot system files include translated text languages as well as voice files used for guidance instructions.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void allowCellularDataForSystemFiles(boolean bEnable)
+(void)allowCellularDataForSystemFiles:(bool)bEnable

Parameters

bEnable – Enables or disables the use of cellular data for system files.

Sample Code

try {
  boolean bEnable = true;
  CopilotMgr.allowCellularDataForSystemFiles(bEnable);
  if(bEnable)
  System.out.println("allowCellularDataForSystemFiles is set as enabled");
  else
  System.out.println("allowCellularDataForSystemFiles is set as disabled");
} catch (CopilotException e) {
  e.printStackTrace();
}
[CopilotMgr allowCellularDataForSystemFiles:true];

Related APIs

CopilotMgr.isActive() CoPilotMgr.allowCellularDataForGlobalUsage(boolean) CopilotMgr.isallowingCellularDataForSystemFiles()


CopilotMgr.isAllowingCellularDataForSystemFiles

Overview
Description Retrieves the current setting in CoPilot of whether or not cellular data can be used for downloading required system files.
Supported Since Version 9.6.0.821
Platforms Supported Android
Type Method
Package com.alk.cpik

Syntax

boolean isAllowingCellularDataForSystemFiles()
+(bool) isAllowingCellularDataForSystemFiles

Return Value

Boolean - True if CoPilot is using cellular data for system files, false otherwise.

Sample Code

try {
  boolean bEnabled = CopilotMgr.isAllowingCellularDataForGlobalUsage();
  if(bEnabled)
  System.out.println("CellularDataForGlobalUsage is allowed.");
  else
  System.out.println("CellularDataForGlobalUsage is not allowed. ");
} catch (CopilotException e) {
  e.printStackTrace();
}
bool b = [CopilotMgr isAllowingCellularDataForGlobalUsage];

Related APIs

CopilotMgr.isActive() CoPilotMgr.allowCellularDataForGlobalUsage(boolean) CopilotMgr.allowCellularDataForSystemFiles()


CopilotMgr.allowCellularDataForTrafficServices

Overview
Description Sets whether or not cellular data can be used for the CoPilot ActiveTraffic service. CoPilot’s ActiveTraffic service requires a regular connection to the Internet. If ActiveTraffic is enabled but this setting is disabled, it will make using the live traffic service inconsistent and unreliable. Using Wi-Fi only is likely to cause breaks in the communication, and traffic data that is older than 15 minutes since the last synchronization is flushed as expired.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void allowCellularDataForTrafficServices(boolean bEnable)
+(void)allowCellularDataForTrafficServices:(bool)bEnable

Parameters

bEnable – Enables or disables the use of cellular data for traffic services.

Sample Code

try {
  boolean bEnable = true;
  CopilotMgr.allowCellularDataForTrafficServices(bEnable);
  if(bEnable)
  System.out.println("allowCellularDataForTrafficServices is set as enabled");
  else
  System.out.println("allowCellularDataForTrafficServices is set as disabled" );
} catch (CopilotException e) {
  e.printStackTrace();
}
[CopilotMgr allowCellularDataForTrafficServices:true];

Related APIs

CopilotMgr.isActive() CoPilotMgr.allowCellularDataForGlobalUsage(boolean) CopilotMgr.isallowingCellularDataForTrafficServices()


CopilotMgr.isAllowingCellularDataTrafficServices

Overview
Description Retrieves the current setting in CoPilot of whether or not cellular data can be used for the ActiveTraffic service.
Supported on Android Since Version 9.6.0.821
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

boolean isAllowingCellularDataForTrafficServices()
+(bool) isAllowingCellularDataForTrafficServices

Return Code Boolean value to retrieve the setting being used for cellular data for traffic services

Sample Code

try {
  boolean bEnabled = CopilotMgr.isAllowingCellularDataForTrafficServices();
  if(bEnabled)
  System.out.println("CellularDataForTrafficServices is allowed.");
  else
  System.out.println("CellularDataForTrafficServices is not allowed. ");
} catch (CopilotException e) {
  e.printStackTrace();
}
bool b = [CopilotMgr isAllowingCellularDataForTrafficServices];

Related APIs

CopilotMgr.isActive() CopilotMgr.allowCellularDataForTrafficServices()


CopilotMgr.getPOICategories

Overview
Description Returns a list of all of the point of interest (POI) categories in CoPilot.
Supported on Android Since Version 9.6.4.
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

List getPOICategories()
+(NSArray*) getPOICategories

Return Value

List - The list of CoPilot’s POI categories.

Sample Code

List<POICategory> poiCategoryList = CopilotMgr.getPOICategories();
for (POICategory poiCategory : poiCategoryList)
  System.out.println("POI Category ID: " + String.valueOf(poiCategory.getID()) + "\n POI Category Name :" + poiCategory.getName());

Related APIs

CopilotMgr.isActive() CopilotMgr.GetPOICategories() CopilotMgr.CancelPOISearch() CopilotMgr.SearchPOIsNearLocation() CopilotMgr.SearchPOIsAlongRoute() CopilotMgr.setPOIAlertSettings() CopilotMgr.getPOIAlertSettings()

--

CopilotMgr.searchPOIsNearLocation

Overview
Description Searches for points of interest (POIs) in one or more specific categories (such as restaurant, fuel or hotels) near a location. The results of the search are sent to POIListener.onPOISearchResult for each listener passed in and registered with POIListener.
Supported on Android Since Version 9.6.8
Type Method
Package com.alk.cpik

Syntax

void searchPOIsNearLocation(String poiSearchName, ArrayList<Integer> typeIDs, Stop stopToSearchNear, int radius, int maxResults, List<POIListener> resultCallbacks)

Parameters

poiSearchName - The text name of the POI to search for. If left blank, will search all POIs meeting the other criteria.

typeIDs - One or more categories in which to search. IDs can be obtained via CopilotMgr.getPOICategories

stopToSearchNear - A stop representing the location to search near.

radius - The radius around the location for which to search within. Units are miles or kilometers, depending on CoPilot’s unit setting.

maxResults - The maximum number of results to return.

resultCallbacks - A List of POIListener for which to send the onPOISearchResults callback as search results are found.

Sample Code

List<POIListener> listenerList = new ArrayList<POIListener>();
POIListener mPOIListener = new POIListener() {
  @Override
  public void onPOISearchResults(List<POISearchResult> poiSearchResult, boolean bSearchComplete) {
  }
};
POIListener.registerListener(mPOIListener);
listenerList.add(mPOIListener);
int allCategoryID = 2;
int radius = 5;
int maxResults = 5;
try {
  double latitude = 40.368420;
  double longitude = -74.655036;
  StopBuilder stopBuilder = StopBuilder.fromLatLon(new Coordinate(latitude, longitude));
  Stop stop = stopBuilder.setName("Trimble MAPS").geocode(GeocodeSearchType.BEST_MATCH).get(0);
  ArrayList<Integer> poiCatList = new ArrayList<Integer>();
  poiCatList.add(allCategoryID);
  CopilotMgr.searchPOIsNearLocation("", poiCatList, stop, radius, maxResults, listenerList);
catch(GeocodingException e){
  e.printStackTrace();
}

Related APIs

CopilotMgr.isActive() CopilotMgr.GetPOICategories() CopilotMgr.CancelPOISearch() CopilotMgr.SearchPOIsAlongRoute() CopilotMgr.setPOIAlertSettings() CopilotMgr.getPOIAlertSettings()


CopilotMgr.searchPOIsAlongRoute

Overview
Description Searches for points of interest (POIs) in one or all categories (such as restaurant, fuel or hotels) along the planned route. The results of the search are sent to POIListener.onPOISearchResult for each listener passed in and registered with POIListener.
Supported on Android Since Version 9.6.4
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void searchPOIsAlongRoute(String poiSearchName, int typeID, int maxResults,List resultCallbacks)
+(void)searchPOIsAlongRoute: (NSString *)poiName poiTypeID:(int)typeID maxNumberOfResults:(int)maxResults;

Parameters

String searchName - The text name of the POI to search for. If left blank, will search all POIs meeting the other criteria.

typeID - The category in which to search. IDs can be obtained via CopilotMgr.getPOICategories

maxResults - The maximum number of results to return.

resultCallbacks - A List of POIListener for which to send the onPOISearchResults callback as search results are found.

Sample Code

List<POIListener> listenerList = new ArrayList<POIListener>();
POIListener mPOIListener = new POIListener() {
  @Override
  public void onPOISearchResults(List<POISearchResult> poiSearchResult, boolean bSearchComplete) {
  }
};
POIListener.registerListener(mPOIListener);
listenerList.add(mPOIListener);
int allCategoryID = 2;
int maxResults = 10;

// Support only in 9.6.8 version
CopilotMgr.searchPOIsAlongRoute("All Categories", allCategoryID, maxResults, listenerList);

Related APIs

CopilotMgr.isActive() CopilotMgr.GetPOICategories() CopilotMgr.CancelPOISearch() CopilotMgr.SearchPOIsAlongRoute() CopilotMgr.setPOIAlertSettings() CopilotMgr.getPOIAlertSettings()


CopilotMgr.cancelPOISearch

Overview
Description Cancels the point of interest (POI) search that is running following the initial request.
Supported Since Version 9.6.4.
Platforms Supported Android, Linux
Type Method
Package com.alk.cpik

Syntax

 void cancelPOISearch()
+(void)cancelPOISearch;

Sample Code

List<POIListener> listenerList = new ArrayList<POIListener>();
POIListener mPOIListener = new POIListener() {
  @Override
  public void onPOISearchResults(List<POISearchResult> poiSearchResult, boolean bSearchComplete) {
  }
};
int allCategoryID = 2;
int maxResults = 10;
ArrayList<Integer> poiCatList = new ArrayList<Integer>();
  poiCatList.add(allCategoryID);
  CopilotMgr.searchPOIsAlongRoute("All Categories", poiCatList, maxResults, listenerList);
  CopilotMgr.cancelPOISearch();

Related APIs

CopilotMgr.isActive() CopilotMgr.GetPOICategories() CopilotMgr.CancelPOISearch() CopilotMgr.SearchPOIsNearLocation() CopilotMgr.setPOIAlertSettings() CopilotMgr.getPOIAlertSettings()


CopilotMgr.setPOIAlertSettings

Overview
Description Enables or disables point of interest (POI) alerts, see POI Settings. POI alerts are provided to the driver during guidance to inform him or her of specific POI categories. These alerts are received via POIListener.onPOIAlert.
Supported on Android Since Version 9.6.0.
Supported on Android Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void setPOIAlertSettings(POIAlertSettings poiSettings)
+(void)setPOIAlertSettings: (POISettings*) settingsToSet;

Parameters

poiSettings - The POISettings to set in CoPilot.

Sample Code

//for disable POI alerts
POISettings disablePOIAlerts = new POISettings();
disablePOIAlerts.setPOIAlertEnabled(false);
CopilotMgr.setPOIAlertSettings(disablePOIAlerts);
System.out.println("POIAlert disabled.");

//for enable POI alerts
POISettings enablePOIAlerts = new POISettings();
enablePOIAlerts.setPOIAlertEnabled(true);
CopilotMgr.setPOIAlertSettings(enablePOIAlerts);
System.out.println("POI Alerts Enabled");

Related APIs

CopilotMgr.isActive() CopilotMgr.GetPOICategories() CopilotMgr.CancelPOISearch() CopilotMgr.SearchPOIsNearLocation() CopilotMgr.SearchPOIsAlongRoute() CopilotMgr.setPOIAlertSettings() CopilotMgr.getPOIAlertSettings()


CopilotMgr.getPOIAlertSettings

Overview
Description Gets settings in relation to POI alerts, see POISettings. These alerts are received via POIListener.onPOIAlert(List).
Supported on Android Since Version 9.6.0.
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

POISettings getPOIAlertSettings()
+(POISettings*)getPOIAlertSettings;

Return Value

POISettings - representing current CoPilot POI alert settings.

Sample Code

POISettings currentSettings = CopilotMgr.getPOIAlertSettings();

System.out.println("POI Alerts " + (currentSettings.getPOIAlertEnabled()? "Enabled":"Disabled"));
System.out.println("Location " + currentSettings.getPOIAlertLocation());
System.out.println("Distance " + currentSettings.getPOIAlertDistance());
System.out.println("Category " + currentSettings.getPOIAlertCategories());

//and to print all at the same time we can use
System.out.println("POI Alerts all values " + currentSettings.getPOIAlertCategories());

Related APIs

CopilotMgr.isActive() CopilotMgr.SetPOIAlertsEnabled() CopilotMgr.SetPOIAlertLocation() CopilotMgr.SetPOIAlertCategories() CopilotMgr.GetPOICategories() CopilotMgr.GetPOIAlertLocation() CopilotMgr.GetPOIAlertDistance()


CopilotMgr.integrateCustomPOIs

Overview
Description his API is used to draw custom POIs in JSON format on the map. Below is a complete contents of a JSON message describing CoPilot POI sets. This will expect POI images will to be preprocessed for each of the categories.
Supported on Android Since Version 10.9
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

JSON Example

[
  {
    "Name": "my set name",
    "Persist": false,
    "Replace": true,
    "Categories": [
      {
        "Name": "Custom Fuel",
        "MaxZoomLevel": 4,
        "Options": 21
      },
      {
        "Name": "Custom Restaurant",
        "MaxZoomLevel": 4,
        "Options": 21
      }
    ],
    "Places": [
      {
        "Address": {
          "StreetAddress": "14807 Crain Hwy",
          "City": "Clinton",
          "Zip": "20735",
          "State": "MD",
          "County": null
        },
        "Coords": {
          "Lat": "38.6825",
          "Lon": "-76.87278"
        },
        "PlaceName": "My Restaurant",
        "CategoryName": "Custom Restaurant",
        "Phone": ""
      },
      {
        "Address": {
          "StreetAddress": "1720 Route 309",
          "City": "Coopersburg",
          "Zip": "18036",
          "State": "PA",
          "County": null
        },
        "Coords": {
          "Lat": "40.50306",
          "Lon": "-75.38667"
        },
        "PlaceName": "My Fuel Stop",
        "CategoryName": "Custom Fuel",
        "Info": "",
        "Phone": ""
      }
    ]
  }
]

Json Field Explanation The JSON schema is defined below. All fields not marked as Optional are required.

  • Set (array)
  • Name (string) - The unique set name; not visible anywhere in CoPilot, used for organizational purposes.
  • Persist (bool) - Whether the place set and all its data will be serialized to disk and persist through a restart of the CoPilot application. Setting this to false will keep the set in-memory only, and significantly improve the performance of this API by eliminating disk I/O.
  • Replace (bool) - Whether an existing set with this name will be replaced (all places will be deleted before adding the new places) or whether the new places will be appended to the current set.
  • Deleted (bool) Will delete a current set with the same name.
  • Categories (array)
    • Name (string) The name of the POI category. Visible in CoPilot in the POI Search dialog as long as at least one place mapped to this category exists on the device.
    • Icon (string; optional) The name of the place category icon that will be used when display this category. If this value is not provided, CoPilot will search for user provided images within the Region/Save folder, looking for a matching category name.
    • MaxZoomLevel (integer) The maximum zoom level that POIs of this category will be visible on the map. Range is 0 (zoomed in to a very small portion of the map) to 7 (zoomed out to a much larger portion of the map.)
    • Options (integer) Bitwise OR of three possible values. Use 21 to enable all options.
    • 1 - Display on Map
    • 4 - Searchable Whether this category appears in the POI search dialog
    • 16 - Alertable Whether this category appears in the POI alert settings
  • Places (array)
    • Address (object) Displayed when viewing the POI
    • StreetAddress (string; optional; 128 char max)
    • City (string; optional; 128 char max)
    • Zip (string; optional; 16 char max)
    • State (string; optional; 4 char max) State (US) or Country (EU) abbreviation
    • County (string; optional; 64 char max)
    • Coords (object) Used to draw the POI on the map, and when routing to the POI
    • Lat (string) decimal degrees, positive for North, negative for South
    • Lon (string) decimal degrees, positive for East, negative for West
  • CategoryName (string) Assigns this POI to a category (category name must exist in the category array described above for this set).
  • PlaceName (string; 128 char max); Displayed when viewing the POI.
  • Phone (string; optional; 64 char max) Displayed when viewing the POI.

Syntax

static PoiIntegrationResult integrateCustomPOIs(String poiJSON)
+(enum PoiIntegrationResult ) integrateCustomPOIs:(NSString*)poiJSON

Parameters

String - A string in json format which custom POI informations

Return Value

PoiIntegrationResult

Sample Code

String poiJSON = "you custom poi json string";
PoiIntegrationResult res = CopilotMgr.integrateCustomPOIs(poiJSON);
NSString *poiJSON = @"you custom poi json string";
enum PoiIntegrationResult res = [CopilotMgr integrateCustomPOIs:poiJSON]

PoiIntegrationResult

Overview
Description This Enum is the return value of CopilotMgr.integrateCustomPOIs which provides the result of the API call
Supported on Android Since Version 10.9
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Values

Values Description
SUCCESS POIs integration is successful
JSON_PARSE_ERROR Cannot parse the JSON. The JSON is invalid
INVALID_POI_JSON The JSON is not in a valid format for the integration of POIs, please review the format detailed within CopilotMgr.integrateCustomPOIs
UNKNOWN_ERROR Unknown Error, please contact Trimble MAPS support

CopilotMgr.setConfigurationSetting

Overview
Description Applies a setting specified by the given ConfigurationSetting object.
Supported on Android Since Version 9.6.0.
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

void setConfigurationSetting(ConfigurationSetting configurationSetting)
+(void)setConfigurationSetting: (ConfigurationSetting*) configurationSetting;

Parameters

configurationSetting - The ConfigurationSetting to apply in CoPilot.

Sample Code

try {
  ConfigurationSetting settingToSet = ConfigurationSetting.create(ConfigurationSetting.FLOW_TRAFFIC_AVAILABILITY, ConfigurationSetting.FLOW_TRAFFIC_ENABLED);
  CopilotMgr.setConfigurationSetting(settingToSet);
  System.out.println("ConfigurationSetting is completed.");
} catch (ConfigurationSetting.ConfigurationException configCreationException) {
  System.out.println("Exception thrown while creating configuration: " + configCreationException.toString());
}

Related APIs

CopilotMgr.isActive() CopilotMgr.getConfigurationSetting()


CopilotMgr.getConfigurationSetting

Overview
Description Get the current settings for the given configuration.
Supported on Android Since Version 9.6.0.
Supported on iOS Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

ConfigurationSetting getConfigurationSetting(String configuration) throws ConfigurationSetting.ConfigurationException
+(ConfigurationSetting*)getConfigurationSetting: (NSString *)configuration withError: (NSError*)error

Parameters

configuration - The configuration name for which to retrieve the current settings.

Return Value

ConfigurationSetting object representing the current setting for the given configuration.

Sample Code

try {
  ConfigurationSetting configSetting = CopilotMgr.getConfigurationSetting(ConfigurationSetting.FLOW_TRAFFIC_AVAILABILITY);
  if (configSetting.getBooleanValue())
    System.out.println("Flow traffic is enabled");
  else
    System.out.println("Flow traffic is not enabled");
} catch (ConfigurationSetting.ConfigurationException configCreationException) {
  System.out.println("Exception thrown while getting configuration: " + configCreationException.toString());
}

Related APIs

CopilotMgr.isActive() CopilotMgr.setConfigurationSetting()


MotionLockSpeedThreshold

Overview
Description An enum of the possible values for the driving speed required to activate Motion Lock, which locks the navigation map when the vehicle is in motion. This is a required parameter for the setMotionLockSpeedThreshold method.
Supported on Android Since Version 9.6.0.
Type Enum
Package com.alk.cpik

Values

Value Description
LEVEL_NOT_SET The threshold is not set.
NO_SPEED Motion Lock is controlled by the integrated application. Once set and enabled, Motion Lock functionality will be enabled when static. The widget within the UI will also be disabled and only API calls can update the Motion Lock functionality.
LEVEL_1 Motion Lock enables at 5 mph.
LEVEL_2 Motion Lock enables at 10 mph.
LEVEL_3 Motion Lock enables at 15 mph.
LEVEL_4 Motion Lock enables at 20 mph.

MotionLockSpeedThreshold

Overview
Description An enum of the possible values for the driving speed required to activate Motion Lock, which locks the navigation map when the vehicle is in motion. This is a required parameter for the setMotionLockSpeedThreshold method.
Supported on iOS Since Version 10.9
Type Enum
Package com.alk.cpik

Values

Value Description
CP_LEVEL_NOT_SET The threshold is not set.
CP_LEVEL_1 Motion Lock enables at 5 mph.
CP_LEVEL_2 Motion Lock enables at 10 mph.
CP_LEVEL_3 Motion Lock enables at 15 mph.
CP_LEVEL_4 Motion Lock enables at 20 mph.

GeocodingError.PlaceError

Overview
Description An enum of the place error codes when geocoding a stop. Place errors deal with the city/state/postal code portion of the address.
Supported on Android Since Version 9.6.0.821
Type Enum
Package com.alk.cpik

Values

Value Description
INVALID Invalid error code.
PLACE_PARSE_NOTOKEN Input place is empty
PLACE_PARSE_STATEONLY Input is missing a city and/or postal code, only has a state
PLACE_PARSE_BADZIP Postal code in an unknown format
PLACE_CALC_BADSTATE State is in a bad format or not found in region
PLACE_CALC_BADZIP Postal code is in a bad format or not found in region
PLACE_CALC_BADCITY City is in a bad format or is not found in region
PLACE_CALC_STATEZIP Postal code not found in input state
PLACE_CALC_CITYZIP Postal code not found in input city
PLACE_CALC_NOEXACT Exact match of city name not found
PLACE_CALC_NOZIPS No postal code found for city, state
PLACE_CALC_NOGRIDS No addresses found for input place
PLACE_CALC_POBOXNOADDR Input has a P.O. Box postal code but no address.
PLACE_CALC_DIFFADDRLATLONG Input latitude/longitude is far from input address.
PLACE_CALC_BADSPLC Input SPLC is bad or not found in region. SPLC (Standard Point Location Code) is a 9-digit geographical code used in North America

GeocodingError.AddressError

Overview
Description An enum of address error codes when geocoding a stop. These error codes relate to the address position of the input.
Supported on Android Since Version 9.6.0.821
Type Enum
Package com.alk.cpik

Values

Value Description
INVALID Invalid error code.
ADDR_PARSE_NOTOKEN Input address is empty.
ADDR_PARSE_NONUM Input does not contain a house or building number.
ADDR_PARSE_NONAME Input does not contain a street name.
ADDR_CALC_MULTOK Multiple best matches for input.
ADDR_CALC_NAMEMATCH No match found for input street name.
ADDR_CALC_NAMESPELL_1 Input street name spelling differs slightly from match.
ADDR_CALC_NAMESPELL_2 Input street name spelling differs somewhat from match.
ADDR_CALC_NAMESPELL_3 Input street name spelling differs significantly from match.
ADDR_CALC_NAMESPELL Input street name spelling differs from match.
ADDR_CALC_ZIPMATCH Postal code differs from match.
ADDR_CALC_ZIPCENT Location is postal code centroid.
ADDR_CALC_AFXPARITY Street name prefix/suffix differs from match.
ADDR_CALC_AFXNOINPUT Input does not contain a street name prefix/suffix but match does.
ADDR_CALC_AFXNODATA Input includes a street name prefix/suffix but name does not.
ADDR_CALC_AFXNOMATCH Input street name prefix/suffix differed from match.
ADDR_CALC_AFXBAD Multiple errors regarding street name prefix/suffix.
ADDR_CALC_NUMPAR Side of street is uncertain in location returned.
ADDR_CALC_NUMUNKNOWN Location along street returned is uncertain.
ADDR_CALC_NUMRANGE Location along street is approximate.
ADDR_CALC_TYPBAD Input street type differs from match.

TruckDimensions

Overview
Description An object representing the length, width, height and weight of a truck, used for setting a truck routing profile.
Supported on Android Since Version 9.6.0.821
Deprecated on Android in Version 10.9
Platforms Supported Android, Linux
Type Object
Package com.alk.cpik

Constructor

TruckDimensions(int lengthInches, int widthInches, int heightInches, int weightPounds, int nAxles)

Fields

Field Name Type Units
lengthInInches int Inches
widthInInches int Inches
heightInInches int Inches
weightInPounds int Pounds
numAxles int Count
maxWeightPerAxleGroupInPounds Int Pounds

Sample Code

// Set a truck that is 30' long, 8' wide, 12' high, and 26,500 lbs
TruckDimensions dim = new TruckDimensions(360, 96, 144, 26500, 2);

// Set a truck that is 53' long, 8.5' wide, 13.5' tall, and 80,000 lbs
TruckDimensions dim = new TruckDimensions(636, 102, 162, 80000, 5);

POICategory

Overview
Description An object representing a POI category in CoPilot. Examples of POI categories would be food, airports, hotels, etc.
Supported Since Version 9.6.4.
Platforms Supported Android, Linux
Type Object
Package com.alk.cpik

Methods

Method Name Return Type Description
getID() int Integer ID for the POI category. This is needed for CopilotMgr.searchPOIsNearLocation and CopilotMgr.searchPOIsAlongRoute.
getName() String String description of the POI category.

Hooks and Callbacks

Hooks and Callbacks related to POIs can be found below.

LicenseListener
onPOISearchResults
onPOIAlert

POISearchResult

Overview
Description An object representing a result of a point of interest (POI) search.
Supported on Android Since Version 9.6.4.
Type Object
Package com.alk.cpik

Methods

Method Name Return Type Description
getCategoryID() int Integer ID for the POI category.
getName() String String description of the POI name.
getDistanceAway() double The distance the POI is from the current location. This distance will be in either miles or kilometers, depending on CoPilot’s unit setting.
getPhoneNumber() String The phone number of the POI.
getMisc() String Miscellaneous information about the POI.
getStop() Stop A Stop representing the location of the POI

POISettings.POIAlertLocation

Overview
Description An enum of alerts for (points or interest) POIs on the route or near the route.
Supported on Android Since Version 9.6.4.
Type Enum
Package com.alk.cpik

Values

Value Description
ON_ROUTE Alert of POIs on the route.
NEAR_ROUTE Alert of POIs near the route.

POISettings.POIAlertDistance

Overview
Description An enum of how soon CoPilot will issue a point of interest (POI) alert. This is the distance away from the current location at which POI alerts will begin.
Supported on Android Since Version 9.6.4.
Type Enum
Package com.alk.cpik

Values

Value Description
TWOTENTHS_MILE Alert of POIs 2/10ths of a mile away.
HALF_MILE Alert of POIs ½ mile away.
ONE_MILE Alert of POIs 1 mile away.
THREE_MILES Alert of POIs 3 miles away.
TEN_MILES Alert of POIs 10 miles away.
TWENTYFIVE_MILES Alert of POIs 25 miles away.
HALF_KILOMETER Alert of POIs ½ km away.
ONE_KILOMETER Alert of POIs1 km away.
TWO_KILOMETERS Alert of POIs 2 km away.
FIVE_KILOMETERS Alert of POIs 5 km away.
SIXTEEN_KILOMETERS Alert of POIs 16 km away.
FOURTY_KILOMETERS Alert of POIs 40 km away.

POIAlert

Overview
Description An object representing a point of interest (POI) alert.
Supported on Android Since Version 9.6.4.
Type Object
Package com.alk.cpik

Methods

Method Name Return Type Description
getDistanceOffRoute() double The distance the POI is off of the route, in miles/km depending on CoPilot’s unit setting.
getDistanceToDestination() double The distance the POI is away from the destination, in miles/km depending on CoPilot’s unit setting.
getDescription() String A string description of the POI.
getCategoryID() Int The category ID representing the category to which this POI belongs.
getDistanceFromCurrent() Double The distance the POI is away from the current location, in miles/km depending on CoPilot’s unit setting.
getLon() Double The longitude of the POI.
getLat() Double The latitude of the POI.
getHeading() long The heading of the POI.

POISettings

Overview
Description An object representing POI alert settings in CoPilot. The only fields that will be set are the fields whose corresponding method is called on. If the set for a particular field is not called, that field will remain unchanged after a CopilotMgr.setPOIAlertSettings() call.
Supported on Android Since Version 9.6.4.
Type Object
Package com.alk.cpik

Methods

Method Name Parameter Return Description
setPOIAlertEnabled boolean Void Sets whether or not POI alerts should be enabled.
setPOIAlertLocation POIAlertLocation Void Sets whether or not to alert of POIs near route or on route.
setPOIAlertDistance POIAlertDistance Void Sets the distance away for which to alert of POIs.
setPOIAlertCategories List Void Sets which POI categories to alert.
getPOIAlertEnabled() none Boolean Returns whether or not POI alerts should be enabled.
getPOIAlertLocation() None POIAlertLocation Returns whether or not to alert of POIs near route or on route.
getPOIAlertDistance() None POIAlertDistance Returns the distance away for which to alert of POIs.
getPOIAlertCategories() None List Returns which POI categories to alert.
willPOIAlertEnabledBeSet() None Boolean Returns whether or not alert enabled will be changed if CopilotMgr.setPOIAlertSettings is called with this object.
willPOIAlertLocationBeSet() None Boolean Returns whether or not alert location will be changed if CopilotMgr.setPOIAlertSettings is called with this object.
willPOIAlertDistanceBeSet() None Boolean Returns whether or not alert distance will be changed if CopilotMgr.setPOIAlertSettings is called with this object.
willPOIAlertCategoriesBeSet() None boolean Returns whether or not alert categories will be changed if CopilotMgr.setPOIAlertSettings is called with this object.

ConfigurationSetting

Overview
Description An object representing a configuration setting. Only certain configurations can be set or retrieved using this object. The configuration value must be created using the create method and passed in an accepted configuration name and valid value for that configuration. The below table provides explanations of the three create methods, and the table of valid values.
Supported on Android Since Version 9.6.0.
Supported on iOS Since Version 10.9
Type Object
Package com.alk.cpik

Methods

Method Name Parameter 1 Parameter 2 Return Description
Static create String config Int value ConfigurationSetting Creates a ConfigurationSetting with an int value. Will throw an exception if the value is invalid for the config, or if the config is not valid.
Static create String config Boolean value ConfigurationSetting Creates a ConfigurationSetting with a boolean value. Will throw an exception if the value is invalid for the config, or if the config is not valid.
Static create String config String value ConfigurationSetting Creates a ConfigurationSetting with a string value. Will throw an exception if the value is invalid for the config, or if the config is not valid.
getBooleanValue() None Boolean Returns the boolean value associated with this configuration. If a boolean value is not associated with this configuration, will return null.
getIntegerValue() None Integer Returns the integer value associated with this configuration. If an integer value is not associated with this configuration, will return null.
getStringValue() None String Returns the string value associated with this configuration. If a string value is not associated with this configuration, will return null.

Values

Please see a full list of configuration settings in our Feature Guide.

Sample Code

try { // Create a Boolean configuration
  ConfigurationSetting boolConfig = ConfigurationSetting.create( ConfigurationSetting.FLOW_TRAFFIC_AVAILABILITY, ConfigurationSetting.FLOW_TRAFFIC_ENABLED);
  // Create an Integer configuration
  ConfigurationSetting intConfig = ConfigurationSetting.create( ConfigurationSetting.CHEVRON_DISPLAY, ConfigurationSetting.CHEVRON_DISPLAY_LAT_LON);
  // Create a String configuration
  ConfigurationSetting stringConfig = ConfigurationSetting.create( ConfigurationSetting.DRIVER_ID, "TestID");
  // Get the boolean value of a configuration
  System.out.println("Bool value for config: " + String.valueOf(boolConfig.getBooleanValue()));
  // Get the int value of a configuration
  System.out.println("Int value for config: " + String.valueOf(intConfig.getIntegerValue()));
  // Get the String value of a configuration
  System.out.println("String value for config: " + String.valueOf(stringConfig.getStringValue()));
} catch (ConfigurationSetting.ConfigurationExceptionconfigCreationException) {
  System.out.println("Exception thrown while creating configuration: " + configCreationException.toString());
}

ConfigurationSetting.ConfigurationException

Overview
Description Thrown if ConfigurationSetting.create is called with an invalid config, or an invalid value for that config.
Supported on Android Since Version 9.6.0.
Supported on iOS Since Version 10.9
Type Object
Package com.alk.cpik

Methods

Method Name Parameter Return Description
getConfigurationError None ConfigurationException.ConfigurationError A description of why the creation of the ConfigurationSetting failed.

ConfigurationSetting.ConfigurationException.ConfigurationError

Overview
Description An enum of error codes explaining why the creation of a ConfigurationSetting failed.
Supported on Android Since Version 9.6.0.
Supported on iOS Since Version Android, Linux
Type Enum
Package com.alk.cpik

Values

Value Description
INVALID_CONFIGURATION The configuration is not valid.
INVALID_SETTING_FOR_CONFIGURATION The configuration is valid, but the value is not valid for that configuration.

CopilotStartupParams

Overview
Description Functions that can be overridden at CoPilot startup.
Supported on Android Since Version 9.6.0.
Type Class
Package com.alk.cpik

Methods

Method Name Return Type
useTabletLayout boolean
getDPI integer

CopilotStartupParams.useTabletLayout

Overview
Description An overridable method that can be implemented to determine if CoPilot should use a tablet layout for its views.
Supported on Android Since Version 9.6.0.
Type Method
Package com.alk.cpik

Syntax

Boolean useTabletLayout

Return Value

boolean

Sample Code

private CopilotStartupParams mStartupParams = new CopilotStartupParams() {
    @Override
    // This returns true when app is running on large screen device
    protected boolean useTabletLayout() {
        boolean xlarge = ((getApplicationContext().getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE);

        boolean large = ((getApplicationContext().getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);

        return (xlarge || large);
    }
}

CopilotStartupParams.getDPI

Overview
Description An overridable method to set the dots per inch (DPI) value for the resolution of CoPilot on a device.
Supported on Android Since Version 10.9.0.1049
Type Method
Package com.alk.cpik

Syntax

int getDPI()

Return Value

integer

Sample Code

private CopilotStartupParams mStartupParams = new CopilotStartupParams() {
    @Override
    // Returns the DPI value to use
    protected int getDPI() {
        // This would be the default DPI value CoPilot would use
        int defaultValueForDevice = super.getDPI();
        // Optionally, a multiplier can be applied here, or a custom value can be returned on a per device model basis.
        double multiplier = 1.0;
        return (int)(defaultValueForDevice * multiplier);
    }
}

CoPilotMgr.updatePOICategoriesDisplayStatus

Overview
Description This API should be used to select the POI categories displayed on the map, for instance, Restaurant, or Gas/Fuel, etc. This has the same function as the tick boxes present on the Currently Displayed POIs screen available through the CoPilot UI. This API should be used in conjunction with UIMgr.setPOIDisplaySetting to manage when these POI categories are displayed.
Please note when using this API all POIs are defaulted to be displayed on the map. As a result, the first call to CoPilot needs to include the categories that you wish to hide. Within POICategory, isDisplayedOnMap can be used to identify the categories that are being shown on the map to determine those which you wish to hide. This can be returned via CoPilotMgr.getPOICategories.
Supported on Android Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

static void updatePOICategoriesDisplayStatus(List<POICategory> categories)

Parameters

List<POICategory - a list of POICategories that is going to be updated

Sample Code

 // Hide a POI Category in CoPilot UI
List<POICategory> poiCates = CopilotMgr.getPOICategories();
List<POICategory> poiCatesToUpdate = new List<POICategory>();
POICategory cat = poiCates.get(0);
cat.setDisplayOnMap(false);
poiCatesToUpdate.add(cat);
CopilotMgr.updatePOICategoriesDisplayStatus(poiCatesToUpdate);

POICategory

Overview
Description Object representing a POI category in CoPilot. Examples of POI categories would be Restaurant, Gas/Fuel, Hotel & Accommodation etc.
Supported on Android Since Version 10.9
Type Object
Package com.alk.cpik

Methods

Method Name Return Type Description
getID() int Integer ID for the POI category. This is needed for CopilotMgr.searchPOIsNearLocation and CopilotMgr.searchPOIsAlongRoute
getName() String String description of the POI category
isDisplayedOnMap() boolean Indicate this POI category is displaying in CoPilot map or not
setDisplayOnMap(boolean) void Set this POI category to display or hide in CoPilot map

Last update: August 24, 2020