The repository has contains the Sonder Technical test solution, where an Android project is created and followed the steps which were mentioned in the document. I named the application is Sonder Trip
Here is the screenshots of the application:
APK and Screen Video Link: https://drive.google.com/drive/folders/1xpdpaIYAnuIzitle6UmSv9NYvyimvFGS?usp=sharing
- A splash screen will be appeared
- After splash screen loaded successfully then Location Permission screen will be appeared.
- When location permission given then Home page will appear with a Bottom Navigation Bar where Map and Passenger items are available.
- In MAP screen current location will be auto selected, if user route different place then click on "Current location" button then current location will be marked. Then long press in the map will add another marker and "Get Direction" button will be appeared. Clicking on Get Direction button user will see a line of the direction. *Note: The Map API key is used here is not billing/active project so direction API is given Billing error.
- Under the passenger tab user can see the passenger list
- Clicking on passenger item user will see the details of the flight.
Here is the list of technologies are used to build this application:
- Kotlin
- MVVM Architecture
- Motion Layout :
MotionLayout
is used for animate the app icon in the Splash screen. - Retrofit, OkHttp : To fetch the passenger data from API, I have used the network library which is Retrofit.
- Kotlin Coroutine : To reduce the main thread task we can divide the task in many thread asychronously using the Kotlin Coroutine using
lifecycle
scope. Here is the sample example:
lifecycleScope.launch {
viewModel.passengers.collectLatest { pagedData ->
passengersAdapter.submitData(pagedData)
}
}
- Jetpack Component - Pagging 3 : Why pagging is required this application, because the passenger list has a massive amount of data and If I wanted to fetch these data ata single time it will take huge amount of time. So that pagination is required, the jetpack component which is Pagging3 is one of the most used jetpack component to perform the paginated data in the
RecyclerView
. It also better with Kotlin Coroutine and Live Data. For that need to create Pagging adapter where we can detect the Success and Error state. - Google Map: Google Map API for Android, Places : Google Map is used for show the current location of the user. In this map user can add marker/point using long press. When the another marker added Get Direction will visibled. Click on get direction user can see the direction line using Google Places API and Direction API.
- Hilt (Dependancy Injection used)
- Unit test perform for a specific passenger view model.
- Jetpack Component - Navigation : Navigation is used for generate the
BottomNavigationView
, where I can see the clear view visibilty on the Android studio, here is the screenshot: