Taking the App for a Drive
Explore how to implement and run a Kotlin airport status app using a main function with coroutines. Understand how to handle real-time data output, test various airport codes, and ensure graceful failure with network issues. This lesson prepares you to run and observe a function-driven Kotlin program locally.
We'll cover the following...
We'll cover the following...
Writing main() function
Let’s write a main() function to call the getAirportStatus() function with a few different airport codes and print the status of the airports with those codes to the console. In your local setup create a file named AirportApp.kt in the directory src/main/kotlin/com/agiledeveloper/ui and key in the following code:
Since ...