- Display all vehicles in a list
- Display the location of all vehicles in a map
- When vehicle clicked from the list show the location of the vehicle in the map
- When vehicle clicked inside the map show the id of that vehicle
- When MainActivity created
VehiclePresenter.fetchVehicles()
is called and pushed the results toListFragment
andVehicleMapFragment
usingVehicleViewModel
when vehicles are available.
- Q: How to update the list?
- A: Go to
List
and pull down the list of vehicles to refresh. - Q: How did the fragments (
ListFragment
andVehicleMapFragment
) connected toMainActivity
- A: Using
Koin's
viewmodel
. Key functions areviewModel()
declared from yourActivity
andsharedViewModel()
fromFragment
- Network handling, make sure you have internet connection before using the app. It will show network error when you don't.
koin
for dependency injection withkoin-androidx-viewmodel
to supportviewmodel
retrofit
together withrxjava2
andrxandroid
for networking taskplay-services-maps
for mapscore-ktx
andanko-commons
for utilitiesnavigation-fragment-ktx
andnavigation-ui-ktx
to support navigation
$./gradlew clean
$./gradlew build
- Output apk file can be found in
/app/build/outputs/apk
debug
andrelease
folders.