AlphaVantage is just an example of forex (currency) calculator Android application with Clean Architecture approach, integrated with AlphaVantage API. This application is still being maintained to keep updated with current technology standards.
As the time of writing, the application only has 2 pages, main pages, and currency pages. Since AlphaVantage doesn't provide the list of currencies, so i fetched it from here. Note: not all currencies can be calculated.
This project also uses API 16 as minimum API level.
This architecture mostly follows the mix of this and this. See those links for detailed explanation about Clean Architecture.
There are few additional points i will explain given the picture:
- LiveData<Event> is basically a LiveData that will not retrieve any values until the previous value is consumed. Refer to this.
- This app uses Navigation components to communicate between Fragments, but directly from ViewModel without sending callback to its Fragment. NavManager class contains
navigate(NavDirections)
to navigate current fragment to next destination fragment andgetArgs(): NavArgs?
to get arguments from previous fragment. retrieveNetwork()
is a function to integrate repository with asynchronous Flow (which will be converted to LiveData).retrieveNetworkAndSync()
is basically previously mentioned function with synchronization to local repository. See Usecase class.- Any exceptions retrieved from API client (Retrofit) will be handled in
getResult()
. See BaseImplementation class.