This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Product Requirement: The function SlowNetwork::getCountries returns a list of countries. Display the name of the first country on screen. | |
* Tapping on the country text will display a toast saying "The capital for <country name> is <country capital>" | |
* | |
* Things to note: | |
* + Start by creating a new project on Android Studio. Copy the entire contents of this file to your project. | |
* + You are not allowed to edit the contents of this file. | |
* + You are free to choose your path for implementing this solution. | |
* + You are allowed to look through any documentation and/or use a search engine for reference on syntax. | |
* + Please think out loud to keep the interviewers engaged in your solution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Product Requirement: The function SlowNetwork::getCountries returns a list of countries. Display the name of the first country on screen. | |
* Tapping on the country will display a toast saying "The capital for <country name> is <country capital>" | |
* | |
* Things to note: | |
* + Start by creating a new project on Android Studio. Copy the entire contents of this file to your project. | |
* + You are not allowed to edit the contents of this file. | |
* + You are free to choose your path for implementing this solution. | |
* + You are allowed to look through any documentation and/or use a search engine for reference on syntax. | |
* + Please think out loud to keep the interviewers engaged in your solution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Product Requirement: The following file returns a list of countries and a list of countries and capitals. Display the name of the first country on screen. | |
* Tapping on the country text will display a toast saying "The capital for <country name> is <country capital>" | |
* | |
* Things to note: | |
* + Start by creating a new project on Android Studio. Copy the entire contents of this file to your project. | |
* + You are not allowed to edit the contents of this file. | |
* + You are free to choose your path for implementing this solution. | |
* + You are allowed to look through any documentation and/or use a search engine for reference on syntax. | |
* + Please think out loud to keep the interviewers engaged in your solution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
implementation 'com.google.code.gson:gson:2.9.0' | |
} | |
val countryArrayType: Type = object : TypeToken<ArrayList<Country?>?>() {}.type | |
val outputList: ArrayList<Country> = Gson().fromJson(countriesString, countryArrayType) |