Alexa Auto SDK  2.3.0
Public Member Functions | Protected Member Functions | List of all members
com.amazon.aace.navigation.Navigation Class Referenceabstract

Public Member Functions

boolean cancelNavigation ()
 
String getNavigationState ()
 
void startNavigation (String payload)
 
void announceManeuver (String payload)
 
void announceRoadRegulation (RoadRegulation roadRegulation)
 

Protected Member Functions

final void navigationError (ErrorType type, ErrorCode code, String description)
 
final void navigationEvent (EventName event)
 
final void showAlternativeRoutesSucceeded (String payload)
 

Detailed Description

Navigation should be extended to handle navigation directives from the Engine.

Member Function Documentation

◆ cancelNavigation()

boolean com.amazon.aace.navigation.Navigation.cancelNavigation ( )

Notifies the platform implementation to cancel navigation

Returns
true if the platform implementation successfully handled the call, else false

◆ getNavigationState()

String com.amazon.aace.navigation.Navigation.getNavigationState ( )

Retrieve the navigation state from the platform. NOTE: You may return an empty string to default the payload to NOT_NAVIGATING

Returns
the current NavigationState JSON payload
)
"state": "{{STRING}}", //NAVIGATING or NOT_NAVIGATING
"waypoints": [
{
"type": "{{STRING}}", //Type of the waypoint - SOURCE, DESTINATION or INTERIM
"estimatedTimeOfArrival": {
"ideal": {{STRING}}, //Expected clock time ETA based on the ideal conditions. ISO 8601 UTC format
"predicted": {{STRING}} //predicted clock time ETA based on traffic conditions. ISO 8601 UTC format
},
"address": "{{STRING}}",
"coordinate": [{{LATITUDE_DOUBLE}},{{LONGITUDE_DOUBLE}}],
},
{
"type": "{{STRING}}", //Type of the waypoint - SOURCE, DESTINATION or INTERIM
"estimatedTimeOfArrival": {
"ideal": {{STRING}}, //Expected clock time ETA based on the ideal conditions. ISO 8601 UTC format
"predicted": {{STRING}} //predicted clock time ETA based on traffic conditions. ISO 8601 UTC format
},
"address": "{{STRING}}",
"coordinate": [{{LATITUDE_DOUBLE}},{{LONGITUDE_DOUBLE}}],
"poiOfInterest": {
"id": "{{STRING}}", //POI lookup Id vended from Alexa
"name": "{{STRING}}", // POI Name
"hoursOfOperation": [
{
"dayOfWeek": "{{STRING}}",
"hours": [
{
"open": "{{STRING}}", // ISO-8601 time with timezone format
"close": "{{STRING}}" // ISO-8601 time with timezone format
}
],
"type": "{{STRING}}" // Can be: OPEN_DURING_HOURS, OPEN_24_HOURS, etc.
}
],
"phoneNumber": "{{STRING}}"
}
},
...
],
"shapes": [
[
{{LATITUDE_DOUBLE}},
{{LONGITUDE_DOUBLE}}
],
...
]
  • state (required) : current navigation state
  • waypoints (required) : list of waypoints, which can be empty
  • shapes (required) : list of route shapes, which can be empty or limited to 100 entries

◆ startNavigation()

void com.amazon.aace.navigation.Navigation.startNavigation ( String  payload)

Notifies the platform implementation to start the navigation

Parameters
payloadJSON data containing the destination information
)
"transportationMode":"{{STRING}}",
"waypoints":[
{
"type":"{{STRING}}",
"estimatedTimeOfArrival":{
"ideal":"{{STRING}}", //ISO-8601 time format
"predicted":"{{STRING}}" //ISO-8601 time format
},
"address": {
"addressLine1": "{{STRING}}", //Address line 1
"addressLine2": "{{STRING}}", //Address line 2
"addressLine3": "{{STRING}}", //Address line 3
"city": "{{STRING}}", //city
"districtOrCounty": "{{STRING}}", //district or county
"stateOrRegion": "{{STRING}}", // state or region
"countryCode": "{{STRING}}", //3 letter country code
"postalCode": "{{STRING}}", // postal code
},
"coordinate":[
"{{LATITUDE_DOUBLE}}",
"{{LONGITUDE_DOUBLE}}"
],
"name":"{{STRING}}"
},
{
"type":"{{STRING}}",
"estimatedTimeOfArrival":{
"ideal":"{{STRING}}",
"predicted":"{{STRING}}"
},
"address":"{{STRING}}",
"coordinate":[
"{{LATITUDE_DOUBLE}}",
"{{LONGITUDE_DOUBLE}}"
],
"name":"{{STRING}}"
"poiOfInterest":{
"id":"{{STRING}}",
"hoursOfOperation":[
{
"dayOfWeek":"{{STRING}}",
"hours":[
{
"open":"{{STRING}}",
"close":"{{STRING}}"
}
],
"type":"{{STRING}}"
}
],
"phoneNumber":"{{STRING}}"
}
}
]
  • transportationMode (optional) : Indicates the means by which to navigate to the destination (Values: BIKING, DRIVING, TRANSIT, WALKING)
  • waypoints (required) : list of waypoints, which can be empty
  • waypoints.type (required) : String from Enum Type of the waypoint - SOURCE, DESTINATION or INTERIM
  • estimatedTimeOfArrival (optional) : Arrival time at the destination
  • estimatedTimeOfArrival.ideal (optional) : Expected arrival time to the destination without considering any other signals such as traffic, diversions etc
  • estimatedTimeOfArrival.predicted (required) : Predicted arrival time to the destination based on traffic etc. In the case of actual and current matching, only current ETA will be populated
  • address (optional) : Waypoint address
  • address.addressLine1 (optional) : address line 1
  • address.addressLine2 (optional) : address line 2
  • address.addressLine3 (optional) : address line 3
  • address.city (optional) : city of destination address
  • address.stateOrRegion (optional) : city of destination address
  • address.countryCode (optional) : 3 letter country code in ISO 3166-1 alpha-3 format
  • address.districtOrCounty (optional) : district or county
  • address.postalCode (optional) : postal code
  • coordinate (required) : Contains the geolocation information of the destination
  • coordinate.latitudeInDegrees (required) : Latitude coordinate in degrees
  • coordinate.longitudeInDegrees (required) : Longitute coordinate in degrees
  • name (optional) : waypoint name
  • pointOfInterest (optional) : POI information related to the waypoint
  • pointOfInterest.id (optional) : Lookup Id for the POIs vended by Alexa
  • metadata.hoursOfOperation (optional) : Hours of operation for the business
  • hoursOfOperation.dayOfWeek (required) : Day of the week (Values: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY)
  • hoursOfOperation.hours (required): List of opening (open) and closing (close) hours for the day. Hours are in ISO-8601 time with timezone format
  • hoursOfOperation.type (required) : Indicates whether the location is open on this day or not (Values: OPEN_DURING_HOURS, OPEN_24_HOURS, CLOSED, UNKNOWN, HOLIDAY)
  • metadata.phoneNumber (optional) : The phone number of the location in E.164 format

◆ announceManeuver()

void com.amazon.aace.navigation.Navigation.announceManeuver ( String  payload)

Notifies the platform implementation to give details about a maneuver to next waypoint on the route or a completely different waypoint off route.

Parameters
payloadJSON data containing the manueuver information
)
"maneuverType": "{{STRING}}", // requested maneuver type
"queryTarget" : {
"name": "{{STRING}}" // name of the requested location
"address": { // address of requested location
"addressLine1": "{{STRING}}", //Address line 1
"addressLine2": "{{STRING}}", //Address line 2
"addressLine3": "{{STRING}}", //Address line 3
"city": "{{STRING}}", //city
"districtOrCounty": "{{STRING}}", //district or county
"stateOrRegion": "{{STRING}}", // state or region
"countryCode": "{{STRING}}", //3 letter country code
"postalCode": "{{STRING}}", // postal code
},
"coordinate": [{{LATITUDE_DOUBLE}},{{LONGITUDE_DOUBLE}}]
}
  • maneuverType (required) : Can take values : TURN, EXIT, ENTER, MERGE, LANE
  • queryTarget (optional) : Contains information about the targeted location on the route. If the location is a POI / user place / street address, Alexa will resolve and provide all 3 fields in the directive. If Alexa is not able to resolve the target, then at least one of the three fields will be present if a target was specified.
  • queryTarget.name (optional) : name of the requested location
  • queryTarget.coordinate (optional) : The geographic coordinates (lat, long) of the location as an ordered double list. (The order of the lat/long double list → [Latitude double , Longitude double])
  • queryTarget.address (optional) : Address of the requested location
  • queryTarget.address.addressLine1 (optional) : address line 1
  • queryTarget.address.addressLine2 (optional) : address line 2
  • queryTarget.address.addressLine3 (optional) : address line 3
  • queryTarget.address.city (optional) : city of destination address
  • queryTarget.address.stateOrRegion (optional) : city of destination address
  • queryTarget.address.countryCode (optional) : 3 letter country code in ISO 3166-1 alpha-3 format
  • queryTarget.address.districtOrCounty (optional) : district or county
  • queryTarget.address.postalCode (optional) : postal code

◆ announceRoadRegulation()

void com.amazon.aace.navigation.Navigation.announceRoadRegulation ( RoadRegulation  roadRegulation)

Notifies the platform implementation to give details about road regulations about the road segments that the user is on

Parameters
roadRegulationType of road regulation requested.(Values: SPEED_LIMIT, CARPOOL_RULES)

◆ navigationError()

final void com.amazon.aace.navigation.Navigation.navigationError ( ErrorType  type,
ErrorCode  code,
String  description 
)
protected

Notifies the Engine of error in handling a Navigation directive.

Parameters
typeErrorType describing which operation failed.
  • ErrorType values based on directive:
  • startNavigation(): NAVIGATION_START_FAILED
  • showPreviousWaypoints(): SHOW_PREVIOUS_WAYPOINTS_FAILED
  • navigateToPreviousWaypoint(): PREVIOUS_NAVIGATION_START_FAILED
  • controlDisplay(): ROUTE_OVERVIEW_FAILED, DIRECTIONS_LIST_FAILED, ZOOM_IN_FAILED, ZOOM_OUT_FAILED, CENTER_FAILED, ORIENT_NORTH_FAILED, SCROLL_NORTH_FAILED, SCROLL_UP_FAILED, SCROLL_EAST_FAILED, SCROLL_RIGHT_FAILED, SCROLL_SOUTH_FAILED, SCROLL_DOWN_FAILED, SCROLL_WEST_FAILED, SCROLL_LEFT_FAILED, MUTED_ROUTE_GUIDANCE_FAILED, UNMUTED_ROUTE_GUIDANCE_FAILED
  • showAlternativeRoutes(): DEFAULT_ALTERNATE_ROUTES_FAILED, SHORTER_TIME_ROUTES_FAILED, SHORTER_DISTANCE_ROUTES_FAILED,
  • announceManeuver(): TURN_GUIDANCE_FAILED, EXIT_GUIDANCE_FAILED, ENTER_GUIDANCE_FAILED, MERGE_GUIDANCE_FAILED, LANE_GUIDANCE_FAILED,
  • announceRoadRegulation(): SPEED_LIMIT_REGULATION_FAILED, CARPOOL_RULES_REGULATION_FAILED
codeErrorCode describing the type of failure. (Values: INTERNAL_SERVICE_ERROR, ROUTE_NOT_FOUND, NO_PREVIOUS_WAYPOINTS, NOT_SUPPORTED, NOT_ALLOWED)
descriptionString providing additional information.

◆ navigationEvent()

final void com.amazon.aace.navigation.Navigation.navigationEvent ( EventName  event)
protected

Notifies the Engine of successful handling of a Navigation directive.

Parameters
[in]eventEventName describing which operation was successful.
  • EventName values based on directive:
  • startNavigation(): NAVIGATION_STARTED
  • showPreviousWaypoints(): PREVIOUS_WAYPOINTS_SHOWN
  • navigateToPreviousWaypoint(): PREVIOUS_NAVIGATION_STARTED
  • controlDisplay(): ROUTE_OVERVIEW_SHOWN, DIRECTIONS_LIST_SHOWN, ZOOMED_IN, ZOOMED_OUT, MAP_CENTERED, ORIENTED_NORTH, SCROLLED_NORTH, SCROLLED_UP, SCROLLED_EAST, SCROLLED_RIGHT, SCROLLED_SOUTH, SCROLLED_DOWN, SCROLLED_WEST, SCROLLED_LEFT, ROUTE_GUIDANCE_MUTED, ROUTE_GUIDANCE_UNMUTED
  • showAlternativeRoutes(): DEFAULT_ALTERNATE_ROUTES_SHOWN, SHORTER_TIME_ROUTES_SHOWN, SHORTER_DISTANCE_ROUTES_SHOWN
  • announceManeuver(): TURN_GUIDANCE_ANNOUNCED, EXIT_GUIDANCE_ANNOUNCED, ENTER_GUIDANCE_ANNOUNCED, MERGE_GUIDANCE_ANNOUNCED, LANE_GUIDANCE_ANNOUNCED
  • announceRoadRegulation(): SPEED_LIMIT_REGULATION_ANNOUNCED, CARPOOL_RULES_REGULATION_ANNOUNCED

◆ showAlternativeRoutesSucceeded()

final void com.amazon.aace.navigation.Navigation.showAlternativeRoutesSucceeded ( String  payload)
protected

Notifies AVS of successful showing of alternative routes to the user

Parameters
payloadJSON data containing the alternative route information
)
"inquiryType": "{{STRING}}" // DEFAULT, SHORTER_TIME, SHORTER_DISTANCE
"alternateRoute":
{
"labels": ["{{STRING}}"],
"savings": [
{
"type": "{{STRING}}", // DISTANCE, TIME
"amount": "{{FLOAT}}",
"unit": "{{STRING}}" // MINUTE, HOUR, YARD, FOOT, MILE, METER, KILOMETER
}
]
}
  • inquiryType (required) : alternate route preference
  • alternateRoute (required) : The best route found that matches inquiryType.
  • labels (required) : Unique names within a route used to distinguish between alternative routes. The label might contain the direction of the route when passing by the detail.
  • savings (optional) : List of savings achieved by the route. Savings can be in: Time and/or Distance
  • savings.type (required) : The type of savings
  • savings.amount (required) : The amount of savings achieved by the route. Alexa will use prescribed unit to convert the amount of savings to improve the driver's experience, if needed.
  • savings.unit (required) : Measurement unit of the savings

Alexa Auto SDK 2.3.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0