Skip to main content

CoPilotMgr - CoPilot Settings (CPIK Libraries)

Contents

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)
Deprecated, use setMotionLockMode.
void
Enables or disables Motion Lock, which locks the navigation map when the vehicle is in motion.
getMotionLockEnabled()
Deprecated, use getMotionLockMode
Boolean
Returns whether Motion Lock is enabled or disabled.
setMotionLockMode(MotionLockMode)
void
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.
getMotionLockMode()
MotionLockMode
Returns the current Motion Lock mode.
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<Favorite>
Returns the list of favorites currently stored in CoPilot’s favorites list.

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


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

Values

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.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, // Searchtype filters search results so that the API only returns certain types of matching locations.
  // Possible values are: 0 - ALL (Default), 1- ADDRESS_ONLY, 2- POI_ONLY, 3- CITY_ONLY, 4- CUSTOM_PLACE_ONLY
  "PoiCategories":["Airport", "bank", "CAT scales"],
  "Countries":["CA", "US", "GL"],
  "States":["NJ", "NM"]

Sample Code


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


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


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


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

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


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

Return Values - MotionLockMode

Sample Code


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
Deprecated on Android Since Version 10.9
Type Method
Package com.alk.cpik

Syntax

Return Value

Boolean - True if enabled, false if disabled.

Sample Code


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
Deprecated on Android in Version 10.9
Type Method
Package com.alk.cpik

Syntax

Parameters

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

Sample Code


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

Return Value

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

Sample Code


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

Parameters

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

Sample Code

Java


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

Return Value

UnitsOfMeasure - An Enum representing either metric or imperial units.

Sample Code


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

Parameters

UnitsOfMeasure - An Enum representing either metric or imperial units.

Return Value

Void

Sample Code


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

Return Value

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

Sample Code


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

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


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

Return Value

Returns an int value to represent delay in milliseconds.

Sample Code


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

Parameters

None

Return Value

android.view.View object

Sample Code


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

Parameters

None.

Return Value

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

Sample Code


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


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

Parameters

None.

Return Value

void

Sample Code


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

Parameters

None.

Return Value

void

Sample Code


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

Parameters

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

Return Value

void

Sample Code


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

Parameters

favorite - A favorite object built with FavoriteBuilder.

Return Value

void

Sample Code


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

Parameters

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

Sample Code


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

Return Value

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

Sample Code


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

Parameters

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

Sample Code


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

Return Value

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

Sample Code


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

Parameters

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

Sample Code


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

Return Value

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

Sample Code


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

Parameters

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

Sample Code


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

Return Value

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

Sample Code


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

Parameters

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

Sample Code


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

Return Value

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

Sample Code


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

Parameters

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

Sample Code


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

Return Value

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

Sample Code

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

Related APIs


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

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

Parameters

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

Sample Code


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

Return Value

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

Sample Code

Related APIs


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

Parameters

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

Sample Code


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

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

Sample Code

Related APIs


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

Return Value

List - The list of CoPilot’s POI categories.

Sample Code


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

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


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. CoPilot will search for POIs up to 5 miles away from 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

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


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

Sample Code


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

Parameters

poiSettings - The POISettings to set in CoPilot.

Sample Code


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

Return Value

POISettings - representing current CoPilot POI alert settings.

Sample Code


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

Parameters

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

Sample Code


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

CopilotMgr.integrateCustomPOIs

Overview
Description This API is used to draw custom places of interest (POIs) on the map. POIs are grouped into sets and each set is described using the JSON format shown below. You can display POIs on the map using CoPilot’s default icons for each POI category or by adding your own custom icons in the icon field.
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,
        "Icon": "fuel", //The default CoPilot icon for fuel
        "Options": 21
      },
      {
        "Name": "Custom Restaurant",
        "MaxZoomLevel": 4,
        "Icon": "restaurant", //The default CoPilot icon for restaurant
        "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 POI category icon that will be displayed. To use a custom icon, import the image into the Region/Save folder and add the prefix “usr_” to the value in the icon field. For example: To use an icon named coolcustom.png, the icon field should be "Icon": "usr_coolcustom". Alternatively, you can leave this field blank and CoPilot will search for user-provided images within the Region/Save folder, looking for an icon name that matches the 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

Parameters

String - A string in JSON format with custom POI information

Return Value

PoiIntegrationResult

Sample Code


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 ALK support
Last updated January 11, 2024.
Contents