StepInfo

  • StepInfo provides detailed information for each step within a navigation route, including instructions, distances, maneuvers, and lane guidance.

  • It offers methods to retrieve data like full instructions, road names, maneuver types, and estimated time/distance from the previous step.

  • Developers can access lane information, maneuver and lane bitmaps (if enabled), and roundabout exit numbers through StepInfo objects.

  • This API is currently in beta, and thus subject to change and backward compatibility is not guaranteed.

  • Use the builder() method to create a StepInfo instance and access the information through its getter methods.

public class StepInfo extends Object

Information about a single step along a navigation route.

Nested Class Summary

class StepInfo.Builder Builder for StepInfo. 

Public Method Summary

static StepInfo.Builder
builder()
Returns a builder for StepInfo.
Integer
getDistanceFromPrevStepMeters()
Returns the distance in meters from the previous step to this step.
int
getDrivingSide()
Returns whether this step is on a drive-on-right or drive-on-left route.
String
getExitNumber()
Returns the exit number if it exists.
String
getFullInstructionText()
Returns the full text of the instruction for this step.
String
getFullRoadName()
Returns the full road name for this step.
List<Lane>
getLanes()
Returns the list of available lanes at the end of this route step.
Bitmap
getLanesBitmap()
Returns a Bitmap that represents the lane guidance for this step.
int
getManeuver()
Returns the Maneuver for this step.
Bitmap
getManeuverBitmap()
Returns a Bitmap that represents the maneuver for this step.
Integer
getRoundaboutTurnNumber()
Returns the counted number of the exit to take relative to the location where the roundabout was entered.
String
getSimpleRoadName()
Returns the simplified version of the road name.
Integer
getStepNumber()
The index of the step in the list of all steps in the route.
Integer
getTimeFromPrevStepSeconds()
Returns time in seconds from the previous step to this step.
StepInfo.Builder

Inherited Method Summary

Public Methods

public static StepInfo.Builder builder ()

Returns a builder for StepInfo.

Returns
  • a builder for StepInfo.

public Integer getDistanceFromPrevStepMeters ()

Returns the distance in meters from the previous step to this step.

Returns
  • distance in meters from the previous step to this step if available, otherwise null.

public int getDrivingSide ()

Returns whether this step is on a drive-on-right or drive-on-left route. May be unspecified.

Returns
  • whether this step is on a drive-on-right or drive-on-left route.

public String getExitNumber ()

Returns the exit number if it exists.

Returns
  • the exit number for the step if it exists, otherwise null.

public String getFullInstructionText ()

Returns the full text of the instruction for this step.

Examples (each line is a separate step):

Turn left onto Lean Ave

Use the right lane to take the CA-85 ramp to Mtn View

Use the 2nd from the right lane to take exit 9A toward North First Street

Returns
  • the full text of the instruction for this step if available, otherwise null.

public String getFullRoadName ()

Returns the full road name for this step. This contains all identifying information for the road including direction.

Examples (each line is a separate step):

Lean Ave

CA-85 / Mtn View

Exit 9A / North First Street

Returns
  • the full road name for the step if it exists, otherwise null.

public List<Lane> getLanes ()

Returns the list of available lanes at the end of this route step.

Returns
  • the list of available lanes at the end of this route step if available, otherwise null.

public Bitmap getLanesBitmap ()

Returns a Bitmap that represents the lane guidance for this step. Result will be null if there is no lane guidance available for this step or the service is registered with a com.google.android.libraries.navigation.NavigationUpdatesOptions.GeneratedStepImagesType value of NONE.

Returns
  • Bitmap that represents the lane guidance for this step if available, otherwise null.

public int getManeuver ()

Returns the Maneuver for this step.

Returns

public Bitmap getManeuverBitmap ()

Returns a Bitmap that represents the maneuver for this step. Result will be null if there is no maneuver available for this step or the service is registered with a com.google.android.libraries.navigation.NavigationUpdatesOptions.GeneratedStepImagesType value of NONE.

Returns
  • Bitmap that represents the maneuver for this step if available, otherwise null.

public Integer getRoundaboutTurnNumber ()

Returns the counted number of the exit to take relative to the location where the roundabout was entered. Only set for roundabouts, otherwise -1.

Returns
  • the counted number of the exit to take relative to where the roundabout was entered if available, otherwise null.

public String getSimpleRoadName ()

Returns the simplified version of the road name. This is shorter than the full road name and may not contain all pieces of identifying information about the road such as direction or name of exit.

Examples (each line is a separate step):

Lean Ave

CA-85

Exit 9A

Returns
  • the simplified road name for the step if it exists, otherwise null.

public Integer getStepNumber ()

The index of the step in the list of all steps in the route. The first step has step number 0. Negative step numbers should be considered invalid.

Returns
  • the index of the step in the list of all steps in the route if available, otherwise null.

public Integer getTimeFromPrevStepSeconds ()

Returns time in seconds from the previous step to this step.

Returns
  • time in seconds from the previous step to this step if available, otherwise null.

public StepInfo.Builder toBuilder ()