Android Flight Data (PED)#
The Flight Data service is available in two versions:
-
V1: Provides raw data without any formatting.
-
V2: Enhances the data presentation by formatting it into more usable forms, such as:
-
Displaying flight altitude in both feet and meters.
-
Structuring data for better clarity and usability.
-
Why Use V2?#
The V2 Flight Data service offers several advantages over V1:
1. Improved Data Formatting:
-
Converts raw data into human-readable formats, reducing the need for additional processing.
-
Example: Flight altitude is available directly in feet and meters.
2. Enhanced Usability:
-
Organised data structure makes integration and data parsing simpler.
-
Designed with user experience in mind, ensuring easier interpretation of flight metrics.
3. Future Support:
- V2 is the actively supported version and will receive updates and enhancements.
FlightData#
FlightData offers on-demand access to flight data and event notifications when flight data is updated.
The type of flight data available depends on the aircraft and system type. Some flight data points may not be available for every aircraft, so the data provided can vary depending on the specific setup.
The FlightData API is read-only and supports both on-demand requests and subscriptions to an event stream.
-
On-demand requests: You can query specific flight data as needed.
-
Event stream subscriptions: You can subscribe to receive real-time updates when the flight data changes.
If no data is available for a specific request or event, the API will return null values:
FlightDataInfo#
The FlightDataInfo enum provides real-time flight information, such as flight number, flight ID, altitude, and more. Applications can subscribe to receive updates for real-time flight data.
Here is the list of available flight data information:
Available Flight Data Information :
| Field Name | Description |
|---|---|
| TAIL_NUMBER | Aircraft tail number. |
| ALTITUDE | Flight altitude in feet and meters. |
| DEPARTURE_COORDINATES | GPS coordinates of the departure location. |
| DESTINATION_COORDINATES | GPS coordinates of the destination location. |
| DISTANCE_FROM_DEPARTURE | Distance from the departure point. |
| DISTANCE_TO_DESTINATION | Distance to the destination point. |
| FLIGHT_NUMBER | Assigned flight number. |
| GROUND_SPEED | Speed of the aircraft relative to the ground. |
| HEAD_WIND_SPEED | Headwind speed encountered by the aircraft. |
| FLIGHT_SPEED | Aircraft speed expressed as a Mach number. |
| OUTSIDE_AIR_TEMP | Current outside air temperature. |
| CURRENT_COORDINATES | GPS coordinates of the aircraft's current position. |
| TIME_AT_DESTINATION | Estimated time of arrival at the destination. |
| TIME_AT_ORIGIN | Time of departure from the origin. |
| TIME_TO_DESTINATION | Remaining time to reach the destination. |
| TRUE_HEADING | Aircraft's true heading. |
| WIND_DIRECTION | Direction of the wind relative to the aircraft. |
| WIND_SPEED | Speed of the wind relative to the aircraft. |
| DEPARTURE_IATA | Departure airport IATA code. |
| DEPARTURE_ICAO | Departure airport ICAO code. |
| TIME_AT_TAKEOFF | Time the aircraft took off. |
| ESTIMATED_ARRIVAL_TIME | Estimated arrival time at the destination. |
| DESTINATION_IATA | Destination airport IATA code. |
| DESTINATION_ICAO | Destination airport ICAO code. |
| DESTINATION_UTC_OFFSET | UTC offset for the destination location. |
| DEPARTURE_UTC_OFFSET | UTC offset for the departure location. |
| FLIGHT_PHASE | Current phase of the flight (e.g., takeoff, cruise, landing). |
| FLIGHT_ID | Unique identifier for the flight. |
| DISTANCE_COVERED_PERCENTAGE | Percentage of the total flight distance covered. |
| CURRENT_UTC_DATE | Current UTC date during the flight. |
| FLIGHTDATA_ERROR | Error details, if any, in the flight data. |
| AIRCRAFT_TYPE | Type of aircraft used for the flight. |
Step 1: Initialize FlightData#
Before accessing flight data, the service needs to be initialized. Here’s how you can initialize the FlightData service in your application:
// Declare mFlightData at the class level
private FlightData mFlightData;
FlightData.initService(this, new IInFlightCallback() {
@Override
public void onInitServiceComplete(Object serviceInstance, String s) {
// The service initialization is complete.
// 'serviceInstance' is the initialized FlightDataV1 instance.
mFlightData = (FlightData) serviceInstance;
}
@Override
public void onInitServiceFailed(String errorMessage, InFlight.Error error) {
// The service initialization has failed.
// 'errorMessage' contains the error details.
// 'error' provides the specific error encountered during initialization.
}
}, new InFlight());
- Initialize FlightData Service:
The initService method is called on FlightData, passing an IInFlightCallback to handle the initialization process.
- Handle Initialization Completion:
When the service initialization completes successfully, the initialized FlightData instance is stored in the mFlightData class-level property, making it available for other parts of the app to interact with the flight data service.
- Handle Initialization Failure:
If the initialization fails, the onInitServiceFailed callback is triggered, providing an error message and the specific error details. This allows the app to handle failure scenarios appropriately.
- Service Ready for Use:
Once the FlightData service is initialized, the app can perform actions related to flight data, such as retrieving flight information or interacting with in-flight services.
Step 2 : Subscribe to Flight Data#
The subscribe method is used to register for updates on specific data points. It takes a list of data points to subscribe to and a listener that will be notified whenever any of the subscribed data points change. The listener's callback methods are invoked with the updated data whenever a change occurs. This allows the application to respond dynamically to changes in the flight data.
private void subscribeToFlightData() {
// Create a list to hold the data points for subscription
List<FlightDataInfo> subscribeList = new ArrayList<>();
// Add all available data points to the subscription list
for (FlightDataInfo flightDataInfo : FlightDataInfo.values()) {
subscribeList.add(flightDataV1Info);
}
// Create a flight data listener to handle the updates
flightDataListener = new FlightDataListener() {
@Override
public void onFlightDataChanged(FlightData flightData, FlightDataInfo flightDataInfo) {
// Handle the flight data update
// For example, update UI or perform operations with the new data
}
};
// Subscribe to the flight data listener
mFlightData.subscribe(subscribeList, flightDataListener);
}
Step 3 : Listener#
The FlightDataListener listens for changes in flight data points and processes updates whenever a specific data point is updated. It reacts to changes in various flight data fields and triggers actions based on the updated information.
Listener Description:
-
onFlightDataChanged: This method is invoked when a flight data point has changed. It receives two parameters:
-
flightData: Contains all the available flight data. -
flightDataInfo: Specifies the particular flight data point that has been updated.
-
Inside this method, the listener checks the specific type of flight data (flightDataInfo) and updates the appropriate value accordingly.
private final FlightData.FlightDataListener flightDataListener = new FlightData.FlightDataListener() {
@Override
public void onFlightDataChanged(FlightData flightData, FlightDataInfo flightDataInfo) {
// Process each case based on the FlightDataInfo type
switch (flightDataInfo) {
case DISTANCE_COVERED_PERCENTAGE:
// Gets the percentage of the distance covered
int distanceCovered = mFlightData.getDistanceCoveredPercentage();
// Handle the updated distance covered value
break;
case TAIL_NUMBER:
// Gets the tail number
String tailNumber = mFlightData.getTailNumber();
// Handle the updated tail number value
break;
case ALTITUDE:
// Gets the flight's altitude
FlightData.Altitude altitude = mFlightData.getAltitude();
// Handle the updated altitude value
break;
case DEPARTURE_COORDINATES:
// Gets the origin coordinates (latitude and longitude)
FlightData.FlightDataCoordinates departureCoordinates = mFlightData.getDepartureCoordinates();
if (departureCoordinates != null) {
double latitude = departureCoordinates.getLatitude();
double longitude = departureCoordinates.getLongitude();
// Handle the updated origin coordinates value
}
break;
case DESTINATION_COORDINATES:
// Gets the destination coordinates (latitude and longitude)
FlightData.FlightDataCoordinates destinationCoordinates = mFlightData.getDestinationCoordinates();
if (destinationCoordinates != null) {
double latitude = destinationCoordinates.getLatitude();
double longitude = destinationCoordinates.getLongitude();
// Handle the updated destination coordinates value
}
break;
case DISTANCE_FROM_DEPARTURE:
// Gets the distance from origin
FlightData.Distance distanceFromDeparture = mFlightData.getDistanceFromDeparture();
// Handle the updated distance from origin value
break;
case DISTANCE_TO_DESTINATION:
// Gets the distance to destination
FlightData.Distance distanceToDestination = mFlightData.getDistanceToDestination();
// Handle the updated distance to destination value
break;
case FLIGHT_NUMBER:
// Gets the flight number
String flightNumber = mFlightData.getFlightNumber();
// Handle the updated flight number value
break;
case FLIGHT_PHASE:
// Gets the flight phase (ascending, cruising, etc.)
FlightData.FlightPhase flightPhase = mFlightData.getFlightPhase();
// Handle the updated flight phase value
break;
case GROUND_SPEED:
// Gets the ground speed
FlightData.Speed groundSpeed = mFlightData.getGroundSpeed();
// Handle the updated ground speed value
break;
case HEAD_WIND_SPEED:
// Gets the head wind speed
FlightData.Speed headWindSpeed = mFlightData.getHeadWindSpeed();
// Handle the updated head wind speed value
break;
case OUTSIDE_AIR_TEMP:
// Gets the outside air temperature
FlightData.Temperature outsideAirTemp = mFlightData.getOutsideAirTemp();
// Handle the updated outside air temperature value
break;
case CURRENT_COORDINATES:
// Gets the current position coordinates (latitude and longitude)
FlightData.FlightDataCoordinates currentCoordinates = mFlightData.getCurrentCoordinates();
if (currentCoordinates != null) {
double latitude = currentCoordinates.getLatitude();
double longitude = currentCoordinates.getLongitude();
// Handle the updated current coordinates value
}
break;
case TIME_AT_DESTINATION:
// Gets the local time at destination
String timeAtDestination = mFlightData.getTimeAtDestination();
// Handle the updated time at destination value
break;
case TIME_AT_ORIGIN:
// Gets the local time at origin
String timeAtOrigin = mFlightData.getTimeAtOrigin();
// Handle the updated time at origin value
break;
case TIME_TO_DESTINATION:
// Gets the remaining flight time to the destination airport
int timeToDestination = mFlightData.getTimeToDestination();
// Handle the updated time to destination value
break;
case TRUE_HEADING:
// Gets the path of the flight in true degrees
int trueHeading = mFlightData.getTrueHeading();
// Handle the updated true heading value
break;
case WIND_DIRECTION:
// Gets the wind direction
int windDirection = mFlightData.getWindDirection();
// Handle the updated wind direction value
break;
case WIND_SPEED:
// Gets the wind speed
FlightData.Speed windSpeed = mFlightData.getWindSpeed();
// Handle the updated wind speed value
break;
case DEPARTURE_IATA:
// Gets the departure IATA code
String departureIata = mFlightData.getDepartureIata();
// Handle the updated departure IATA code value
break;
case DEPARTURE_ICAO:
// Gets the departure ICAO code
String departureIcao = mFlightData.getDepartureIcao();
// Handle the updated departure ICAO code value
break;
case TIME_AT_TAKEOFF:
// Gets the departure date and time in UTC
Date timeAtTakeoff = mFlightData.getTimeAtTakeoff();
// Handle the updated takeoff time value
break;
case ESTIMATED_ARRIVAL_TIME:
// Gets the estimated arrival time in UTC
String estimatedArrivalTime = mFlightData.getEstimatedArrivalTime();
// Handle the updated estimated arrival time value
break;
case DESTINATION_IATA:
// Gets the destination IATA code
String destinationIata = mFlightData.getDestinationIata();
// Handle the updated destination IATA code value
break;
case DESTINATION_ICAO:
// Gets the destination ICAO code
String destinationIcao = mFlightData.getDestinationIcao();
// Handle the updated destination ICAO code value
break;
case DESTINATION_UTC_OFFSET:
// Gets the destination UTC offset in minutes
int destinationUtcOffset = mFlightData.getDestinationUtcOffset();
// Handle the updated destination UTC offset value
break;
case DEPARTURE_UTC_OFFSET:
// Gets the departure UTC offset in minutes
int departureUtcOffset = mFlightData.getDepartureUtcOffset();
// Handle the updated departure UTC offset value
break;
case FLIGHT_ID:
// Gets the unique flight ID
String flightId = mFlightData.getFlightId();
// Handle the updated flight ID value
break;
case AIRCRAFT_TYPE:
// Gets the aircraft type
String aircraftType = mFlightData.getAirCraftType();
// Handle the updated aircraft type value
break;
default:
// Handle unrecognized flight data info
break;
}
}
};
Flight Information Methods#
| Method Name | Return Type | Explanation |
|---|---|---|
getTailNumber |
String |
Gets the airplane tail number (string size: 12). Returnsnullif data is not available or no subscription. |
getDateTimeUtc |
Date |
Gets the current date and time in UTC. Returnsnullif data is not available or no subscription. |
getAirCraftType |
String |
Gets the aircraft type. Returnsnullif data is not available or no subscription. |
getAltitude |
FlightData.Altitude |
Gets the flight altitude in feet or meters. Returnsnullif data is not available or no subscription. |
getDepartureCoordinates |
FlightData.FlightDataCoordinates |
Gets the departure airport coordinates (latitude and longitude). Returnsnullif data is not available. |
getDestinationCoordinates |
FlightData.FlightDataCoordinates |
Gets the destination airport coordinates (latitude and longitude). Returnsnullif data is not available. |
getDistanceFromDeparture |
FlightData.Distance |
Gets the distance from the departure airport in nautical miles. Returnsnullif data is not available. |
getDistanceToDestination |
FlightData.Distance |
Gets the distance to the destination airport in nautical miles. Returnsnullif data is not available. |
getFlightNumber |
String |
Gets the operating flight number (string size: 10). Returnsnullif data is not available or no subscription. |
getFlightPhase |
FlightData.FlightPhase |
Gets the current phase of the flight (e.g., cruising, descending). Returnsunknown_phaseif unavailable. |
getFlightState |
FlightData.FlightState |
Gets the state of the flight (e.g., open or closed). Returnsnullif data is not available or no subscription. |
getFlightId |
String |
Gets the unique flight ID (string size: 36). Returnsnullif data is not available or no subscription. |
getDistanceCoveredPercentage |
Integer |
Gets the distance covered as a percentage of the total flight distance (range 0 to 100). Returnsnullif unavailable. |
getGroundSpeed |
FlightData.Speed |
Gets the ground speed of the airplane in knots. Returnsnullif data is not available or no subscription. |
getHeadWindSpeed |
FlightData.Speed |
Gets the speed of the headwind in knots. Returnsnullif data is not available or no subscription. |
getFlightSpeed |
FlightData.Speed |
Gets the speed of the current flight in mach. Returnsnullif data is not available or no subscription. |
getOutsideAirTemp |
FlightData.Temperature |
Gets the temperature of the outside air in Celsius. Returnsnullif data is not available or no subscription. |
getCurrentCoordinates |
FlightData.FlightDataCoordinates |
Gets the current coordinates of the flight. Returnsnullif data is not available or no subscription. |
getEstimatedArrivalTime |
String |
Gets the estimated arrival time in UTC in 24-hour format. Returnsnullif data is not available or no subscription. |
getTimeAtDestination |
String |
Gets the local time at the destination airport in 24-hour format. Returnsnullif data is not available or no subscription. |
getTimeAtOrigin |
String |
Gets the local time at the origin airport in 24-hour format. Returnsnullif data is not available or no subscription. |
getTimeAtTakeoff |
Date |
Gets the departure date and time in UTC. Returnsnullif data is not available or no subscription. |
getTimeToDestination |
Integer |
Gets the remaining flight time to the destination airport in minutes. Returnsnullif data is not available or no subscription. |
getTrueHeading |
Integer |
Gets the true heading of the flight path in degrees (range 0 to 360). Returnsnullif data is not available or no subscription. |
getWindDirection |
Integer |
Gets the wind direction in degrees (range 0 to 360). Returnsnullif data is not available or no subscription. |
getWindSpeed |
FlightData.Speed |
Gets the wind speed in knots. Returnsnullif data is not available or no subscription. |
getDestinationIata |
String |
Gets the IATA code of the destination airport (3-letter code). Returnsnullif data is not available or no subscription. |
getDestinationIcao |
String |
Gets the ICAO code of the destination airport (4-letter code). Returnsnullif data is not available or no subscription. |
getDepartureIata |
String |
Gets the IATA code of the departure airport (3-letter code). Returnsnullif data is not available or no subscription. |
getDepartureIcao |
String |
Gets the ICAO code of the departure airport (4-letter code). Returnsnullif data is not available or no subscription. |
getDestinationUtcOffset |
Integer |
Gets the UTC offset for the destination airport in minutes. Returnsnullif data is not available or no subscription. |
getDepartureUtcOffset |
Integer |
Gets the UTC offset for the departure airport in minutes. Returnsnullif data is not available or no subscription. |
Use Case: Retrieve Nearby City Names for Destination Airport#
Overview
Inform passengers about nearby cities to the destination airport using the requestCityNamesByIcao API from the AirportInfo module.
Flow
-
Retrieve
destinationICAOfrom flight data (availability depends on aircraft/system type). -
Call
requestCityNamesByIcaowithdestinationICAOas the parameter. -
Parse the API response to extract nearby city names.
-
Display the city names to passengers.
FlightDataV1#
The FlightDataV1 API is read-only and supports both on-demand requests and subscriptions to an event stream.
-
On-demand requests: You can query specific flight data as needed.
-
Event stream subscriptions: You can subscribe to receive real-time updates when the flight data changes.
If no data is available for a specific request or event, the API will return default values:
-
""for Strings -
-1for integers (int) -
falsefor boolean values
FlightDataV1Info#
The FlightDataV1Info enum provides real-time flight information, such as flight number, flight ID, altitude, and more. Applications can subscribe to receive updates for real-time flight data.
Step 1: Initialize FlightDataV1#
Before accessing flight data, the service needs to be initialized. Here’s how you can initialize the FlightDataV1 service in your application:
// Declare mFlightDataV1 at the class level
private FlightDataV1 mFlightDataV1;
FlightDataV1.initService(this, new IInFlightCallback() {
@Override
public void onInitServiceComplete(Object serviceInstance, String s) {
// The service initialization is complete.
// 'serviceInstance' is the initialized FlightDataV1 instance.
mFlightDataV1 = (FlightDataV1) serviceInstance;
}
@Override
public void onInitServiceFailed(String errorMessage, InFlight.Error error) {
// The service initialization has failed.
// 'errorMessage' contains the error details.
// 'error' provides the specific error encountered during initialization.
}
}, new InFlight());
- Initialize FlightData Service:
The initService method is called on FlightDataV1, passing an IInFlightCallback to handle the initialization process.
- Handle Initialization Completion:
When the service initialization completes successfully, the initialized FlightDataV1 instance is stored in the mFlightDataV1 class-level property, making it available for other parts of the app to interact with the flight data service.
- Handle Initialization Failure:
If the initialization fails, the onInitServiceFailed callback is triggered, providing an error message and the specific error details. This allows the app to handle failure scenarios appropriately.
- Service Ready for Use:
Once the FlightDataV1 service is initialized, the app can perform actions related to flight data, such as retrieving flight information or interacting with in-flight services.
Step 2 : Subscribe to Flight Data#
The subscribe method is used to register for updates on specific data points. It takes a list of data points to subscribe to and a listener that will be notified whenever any of the subscribed data points change. The listener's callback methods are invoked with the updated data whenever a change occurs. This allows the application to respond dynamically to changes in the flight data.
private void subscribeToFlightData() {
// Create a list to hold the data points for subscription
List<FlightDataV1Info> subscribeList = new ArrayList<>();
// Add all available data points to the subscription list
for (FlightDataV1Info flightDataV1Info : FlightDataV1Info.values()) {
subscribeList.add(flightDataV1Info);
}
// Create a flight data listener to handle the updates
flightDataListener = new FlightDataListener() {
@Override
public void onFlightDataChanged(FlightDataV1 flightDataV1, FlightDataV1Info flightDataV1Info) {
// Handle the flight data update
// For example, update UI or perform operations with the new data
}
};
// Subscribe to the flight data listener
mFlightDataV1.subscribe(subscribeList, flightDataListener);
}
Step 3 : Listener#
The FlightDataListener listens for changes in flight data points and processes updates whenever a specific data point is updated. It reacts to changes in various flight data fields and triggers actions based on the updated information.
Listener Description#
-
onFlightDataChanged: This method is invoked when a flight data point has changed. It receives two parameters:
-
flightDataV1: Contains all the available flight data. -
flightDataV1Info: Specifies the particular flight data point that has been updated.
Inside this method, the listener checks the specific type of flight data (flightDataV1Info) and updates the appropriate value accordingly.
private final FlightDataV1.FlightDataListener flightDataListener = new FlightDataV1.FlightDataListener() {
@Override
public void onFlightDataChanged(FlightDataV1 flightDataV1, FlightDataV1Info flightDataV1Info) {
// Process each case based on the FlightDataV1Info type
switch (flightDataV1Info) {
case DISTANCE_COVERED_PERCENTAGE:
// Gets the percentage of the distance covered
int distanceCovered = mFlightDataV1.getDistanceCoveredPercentage();
// Handle the updated distance covered value
break;
case TAIL_NUMBER:
// Gets the tail number
String tailNumber = mFlightDataV1.getTailNumber();
// Handle the updated tail number value
break;
case ALTITUDE:
// Gets the flight's altitude
int altitude = mFlightDataV1.getAltitude();
// Handle the updated altitude value
break;
case DEPARTURE_COORDINATES:
// Gets the origin coordinates (latitude and longitude)
FlightDataCoordinate originCoordinates = mFlightDataV1.getOriginCoordinates();
if (originCoordinates != null) {
double latitude = originCoordinates.getLatitude();
double longitude = originCoordinates.getLongitude();
// Handle the updated origin coordinates value
}
break;
case DESTINATION_COORDINATES:
// Gets the destination coordinates (latitude and longitude)
FlightDataCoordinate destinationCoordinates = mFlightDataV1.getDestinationCoordinates();
if (destinationCoordinates != null) {
double latitude = destinationCoordinates.getLatitude();
double longitude = destinationCoordinates.getLongitude();
// Handle the updated destination coordinates value
}
break;
case DISTANCE_FROM_DEPARTURE:
// Gets the distance from origin
int distanceFromOrigin = mFlightDataV1.getDistanceToOrigin();
// Handle the updated distance from origin value
break;
case DISTANCE_TO_DESTINATION:
// Gets the distance to destination
int distanceToDestination = mFlightDataV1.getDistanceToDestination();
// Handle the updated distance to destination value
break;
case FLIGHT_NUMBER:
// Gets the flight number
String flightNumber = mFlightDataV1.getFlightNumber();
// Handle the updated flight number value
break;
case FLIGHT_PHASE:
// Gets the flight phase (ascending, cruising, etc.)
FlightDataV1.FlightPhase flightPhase = mFlightDataV1.getFlightPhase();
// Handle the updated flight phase value
break;
case GROUND_SPEED:
// Gets the ground speed
int groundSpeed = mFlightDataV1.getGroundSpeed();
// Handle the updated ground speed value
break;
case HEAD_WIND_SPEED:
// Gets the head wind speed
int headWindSpeed = mFlightDataV1.getHeadWindSpeed();
// Handle the updated head wind speed value
break;
case MACH:
// Gets the flight speed in Mach
int machSpeed = mFlightDataV1.getFlightdataMach();
// Handle the updated Mach speed value
break;
case OUTSIDE_AIR_TEMP:
// Gets the outside air temperature
int outsideAirTemp = mFlightDataV1.getOutsideAirTemp();
// Handle the updated outside air temperature value
break;
case CURRENT_COORDINATES:
// Gets the current position coordinates (latitude and longitude)
FlightDataCoordinate currentCoordinates = mFlightDataV1.getCurrentCoordinates();
if (currentCoordinates != null) {
double latitude = currentCoordinates.getLatitude();
double longitude = currentCoordinates.getLongitude();
// Handle the updated current coordinates value
}
break;
case TIME_AT_DESTINATION:
// Gets the time at destination in UTC
String timeAtDestination = mFlightDataV1.getFlightdataTimeAtDestination();
// Handle the updated time at destination value
break;
case TIME_AT_ORIGIN:
// Gets the time at origin in UTC
String timeAtOrigin = mFlightDataV1.getFlightdataTimeAtOrigin();
// Handle the updated time at origin value
break;
case TIME_TO_DESTINATION:
// Gets the time to destination in minutes
int timeToDestination = mFlightDataV1.getTimeToDestination();
// Handle the updated time to destination value
break;
case TRUE_HEADING:
// Gets the true heading degree
int trueHeading = mFlightDataV1.getTrueHeadingDegree();
// Handle the updated true heading degree value
break;
case WIND_DIRECTION:
// Gets the wind direction degree
int windDirection = mFlightDataV1.getWindDirection();
// Handle the updated wind direction value
break;
case WIND_SPEED:
// Gets the wind speed in knots
int windSpeed = mFlightDataV1.getWindSpeed();
// Handle the updated wind speed value
break;
case DEPARTURE_IATA:
// Gets the departure IATA code
String departureIata = mFlightDataV1.getOriginIata();
// Handle the updated departure IATA code value
break;
case DEPARTURE_ICAO:
// Gets the departure ICAO code
String departureIcao = mFlightDataV1.getOriginIcao();
// Handle the updated departure ICAO code value
break;
case TIME_AT_TAKEOFF:
// Gets the takeoff time in UTC
String timeAtTakeoff = mFlightDataV1.getTimeAtTakeOff();
// Handle the updated takeoff time value
break;
case ESTIMATED_ARRIVAL_TIME:
// Gets the estimated arrival time in UTC
String estimatedArrivalTime = mFlightDataV1.getEstimatedArrivalTime();
// Handle the updated estimated arrival time value
break;
case DESTINATION_IATA:
// Gets the destination IATA code
String destinationIata = mFlightDataV1.getDestinationIata();
// Handle the updated destination IATA code value
break;
case DESTINATION_ICAO:
// Gets the destination ICAO code
String destinationIcao = mFlightDataV1.getDestinationIcao();
// Handle the updated destination ICAO code value
break;
case DESTINATION_UTC_OFFSET:
// Gets the destination UTC offset in minutes
int destinationUtcOffset = mFlightDataV1.getDestinationUtcOffset();
// Handle the updated destination UTC offset value
break;
case DEPARTURE_UTC_OFFSET:
// Gets the departure UTC offset in minutes
int departureUtcOffset = mFlightDataV1.getDepartureUtcOffset();
// Handle the updated departure UTC offset value
break;
case FLIGHT_ID:
// Gets the flight ID
String flightId = mFlightDataV1.getFlightId();
// Handle the updated flight ID value
break;
case OPEN_FLIGHT:
case CLOSE_FLIGHT:
// Gets the flight state (open or close)
String flightState = mFlightDataV1.getFlightState();
// Handle the updated flight state value
break;
case AIRCRAFT_TYPE:
// Gets the aircraft type
String aircraftType = mFlightDataV1.getAirCraftType();
// Handle the updated aircraft type value
break;
default:
break;
}
}
};
Flight Information Methods#
- getTailNumber
Returns the tail number of the aircraft. Returns an empty string if no data is available.
- getDateTimeUtc
Returns the current date and time in UTC. Returns an empty string if no data is available.
- getAirCraftType
Returns the type of the aircraft. Returns null if data is not available or no subscription exists.
- getAltitude
Returns the altitude of the flight in feet. Returns Integer.MIN_VALUE if no data is available.
- getOriginCoordinates
Returns the coordinates of the origin. Returns Double.NEGATIVE_INFINITY for both coordinates if no data is available.
- getDestinationCoordinates
Returns the coordinates of the destination. Returns Double.NEGATIVE_INFINITY for both coordinates if no data is available.
- getDistanceToOrigin
Returns the distance from the origin. Returns Integer.MIN_VALUE if no data is available.
- getDistanceToDestination
Returns the distance to the destination in nautical miles. Returns Integer.MIN_VALUE if no data is available.
- getFlightNumber
Returns the flight number. Returns an empty string if no data is available.
-
getFlightPhase
Returns the current phase of the flight.
FlightDataV1.FlightPhase- The current phase of the flight. The possible flight phases include: -
ACCELERATING: The aircraft is accelerating during takeoff. -
APPROACH: The aircraft is approaching the destination for landing. -
CLIMB: The aircraft is climbing after takeoff. -
CRUISING: The aircraft is in the cruising phase at altitude. -
DESCENDING: The aircraft is descending towards the destination. -
ENGINES_START: The engines are starting. -
ENGINES_STOP: The engines are stopped. -
FLARE: The aircraft is in the flare phase during landing. -
GO_AROUND: The aircraft is going around for another landing attempt. -
LIFT_OFF: The aircraft has lifted off the ground. -
MAINTENANCE: The aircraft is in maintenance. -
POWER_UP: The engines are powering up. -
TAKE_OFF_POWER: The aircraft is applying full power for takeoff. -
TAXI_TO_STOP: The aircraft is taxiing to a stop position. -
TOUCHDOWN: The aircraft has touched down on the runway. -
UNKNOWN_PHASE: The phase of the flight is unknown or unclassified. -
getFlightState
Returns the state of the flight ("open" or "close").
- getFlightId
Returns the ID of the flight.
- getDistanceCoveredPercentage
Returns the percentage of the distance covered by the flight.
- getGroundSpeed
Returns the ground speed of the flight in knots. Returns Integer.MIN_VALUE if no data is available.
- getHeadWindSpeed
Returns the headwind speed in knots. Returns Integer.MIN_VALUE if no data is available.
- getFlightdataMach
Returns the flight speed in Mach. Returns Integer.MIN_VALUE if no data is available.
- getOutsideAirTemp
Returns the outside air temperature in degrees Celsius. Returns Integer.MIN_VALUE if no data is available.
- getCurrentCoordinates
Returns the current position coordinates of the flight. Returns Double.NEGATIVE_INFINITY for both coordinates if no data is available.
- getFlightdataTimeAtDestination
Returns the time at destination in UTC in ISO 8601 format (hh:mm). Returns an empty string if no data is available.
- getFlightdataTimeAtOrigin
Returns the time at origin in UTC in ISO 8601 format (hh:mm). Returns an empty string if no data is available.
- getTimeToDestination
Returns the time in minutes remaining until arrival at the destination. Returns Integer.MIN_VALUE if no data is available.
- getTrueHeadingDegree
Returns the true heading degree of the flight, representing the direction it is headed (0-360). Returns Integer.MIN_VALUE if no data is available.
- getWindDirection
Returns the direction of the wind in degrees (0-360). Returns Integer.MIN_VALUE if no data is available.
- getWindSpeed
Returns the wind speed in knots. Returns Integer.MIN_VALUE if no data is available.
- getDestinationIata
Returns the 3-letter IATA code of the destination airport. Returns an empty string if no data is available.
- getDestinationIcao
Returns the 4-letter ICAO code of the destination airport. Returns an empty string if no data is available.
- getTimeAtTakeOff
Returns the time of take-off in UTC in ISO 8601 format (hh:mm). Returns an empty string if no data is available.
- getEstimatedArrivalTime
Returns the estimated arrival time in UTC in ISO 8601 format (hh:mm). Returns an empty string if no data is available.
- getOriginIata
Returns the 3-letter IATA code of the origin airport. Returns an empty string if no data is available.
- getOriginIcao
Returns the 4-letter ICAO code of the origin airport. Returns an empty string if no data is available.
- getDestinationUtcOffset
Returns the UTC offset in minutes for the destination. Returns Integer.MIN_VALUE if no data is available.
- getDepartureUtcOffset
Returns the UTC offset in minutes for the departure. Returns Integer.MIN_VALUE if no data is available.
Version 1.0