Disclaimer: The application IS NOT GOING TO BE released on Google Play Store. For this reason, the API key used is "1" as specified in the TheCocktailDB API documentation
This application presents information about different cocktails to the user. The information is obtained from the TheCocktailDB API by using retrofit for the REST calls.
There are two main sections to explore:
This screen is what the user sees when the application is started, it contains information about the desired cocktail. The cocktail is shown is chosen randomly. This includes:
- Name
- Photo
- Type of drink
- Ingredients
- Instructions
It also provides the option to share the cocktail and get a different one (random)
This screen presents a list of cocktails categories and also provides the option to search for a specific drink by its name. The option of search by ingredients will be added in the future.
In this section, the technical details about the app are going to be discussed.
The application contains 1 Activity and some fragments. For the navigation between the different fragments, the Navigation Component has been used.
The architecture followed is the Model-View-ViewModel (MVVM). The app has 1 ViewModel, 1 Repository, and 1 class (MainController) in order to get the necessary data. The flow is the following:
The ViewModel class has an instance of the Repository class. This last one has an instance of the MainController class, which is in charge of calling to TheCocktailDB API GET methods by using retrofit.
The cocktail data is obtained in run time performing calls to the TheCocktailDB API GET methods using retrofit.
There is not data stored in the device. This may change in the future.
The application contains JUnit testing for testing the MainController and Repository classes. The ViewModel class has not associated testing because it only calls to Repository methods that have been already testing. It would be duplicate code, which doesn't seem right.
Instrumented testing will be added soon.
-
Dice logo from:
Icons made by Good Ware from www.flaticon.com -
Cocktail logo from:
Icons made by Freepik from www.flaticon.com -
List logo from:
Icons made by Kiranshastry from www.flaticon.com