Bitcoin tech test project app
- OVERVIEW
- Download and display the list of coins from this API endpoint:
- Get Coins: https://api.coinpaprika.com/v1/coins
- Get Coin By Id: https://api.coinpaprika.com/v1/coins/{id}
- FUNCTIONALITY
- When the app is started, load and display a list of coins
- Order entries by name
- Filter the list based on tags.
- Display a divider between each entry
- Display any extra coin info in some kind of popup/fragment when coin entry is clicked based on the second API request, with said id as the query.
- Provide some kind of refresh option that reloads the list.
- Display an error message if the list cannot be loaded (e.g. no network).
- (Extra credit) Animate list items (hint – Jetpack Compose allows this easily.
- DELIVERABLES
- Write the app using Kotlin only.
- Use Jetpack Compose for UI.
- Use MVVM design pattern, combined with RxJava or Coroutines (remember; keep it simple!)
- Write unit tests against the ViewModel (and anywhere you feel necessary, using i.e. Mockito), so it’s tested that i.e. entries are ordered by name, etc.
- Try to avoid using any 3rd party libraries
- Deliver your final project via Git. We’d like to see your process so please leave in your commit history
- PROJECT EXPLANATION:
- The project initially makes two requests to the given APIs to get all the information from the bitcoins searched by Id.
- The repository filters the list by tags and sorted by name.
- A double request needs to be made to get the extra information for the bitcoin.
- API restriction in the number of request for the free version, filter applied to take only the first 10 bitcoins (this can be changed at any time, but we have a limitation there for the free version).
- The repository is also responsible to add any new bitcoins to the database (Room database applied for easiness and convenience, reusing the same list later on for faster loading).
- The repository gets the information for the coin selected by id from the database.
- MVVM applied with coroutines to propagate states(loading, data an error messages) to the composable view.
- The UI is built in Jetpack compose for the list representation and easiness of features added like swipe to refresh and animation of lists.
- Elements used in jetpack compose: Lazy column for the list representation, columns as main layouts, AsynImage for image representation with place holders, Texts, Cards and Dividers.
- Material components for reusable colors, theming, animation and typography used in the app.
- Unit tests were applied in the repository and view model to check the list representation, getting a coin information by Id and testing the states of the view model.
- DESIGN PATTERS:
- Builder - Retrofit API as a creational pattern.
- Dependency Injection - Dagger Hilt for simplicity as it works well with the VM.
- Singleton pattern as dependency injection modules.
- Factory - Gson converter factory in Retrofit for parsing HTTP responses into an object.
- Facade - GsonConverterFactory, working behind the scenes as a JSON deserializer.
- States - Added along VM to propagate a wrap the flow results.
- APP ARCHITECTURE:
- Model View ViewModel - Stores data and updates the views and models accordingly.
- Clean architecture - Data, Business logic, Presentation - VM and UI layers.
- TECHNOLOGIES USED AND DEPENDENCIES:
- Kotlin - Main language of programming.
- Jetpack Compose - Jetpack Compose is Android’s modern toolkit for building native UI.
- Coroutines - Fetching async data along flow.
- Flow - A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.
- Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps.
- ViewModel - Stores UI-related data that isn't destroyed on UI changes.
- Dependency Injection - Hilt - Easier way to incorporate Dagger DI into Android apps.
- Retrofit - A type-safe HTTP client for Android and Java.
- Room database for caching data within the app and representing some data faster.
- Material Components - Theming, layouts and animations.
- Mockito - Main testing tool for mocking object injections and unit testing the presentation and repositories of the project.