Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitchtabian/Open-API-Android-App
Kotlin, MVI, Hilt, Retrofit2, Coroutines, Room Persistence, REST API, Token Authentication
https://github.com/mitchtabian/Open-API-Android-App
android-jetpack-components coroutines-android dagger2 jetpack-android jetpack-lifecycle-components jetpack-navigation kotlin mvvm-architecture navigation-component rest-api retrofit2 room-persistence
Last synced: 2 months ago
JSON representation
Kotlin, MVI, Hilt, Retrofit2, Coroutines, Room Persistence, REST API, Token Authentication
- Host: GitHub
- URL: https://github.com/mitchtabian/Open-API-Android-App
- Owner: mitchtabian
- Created: 2019-07-16T15:18:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-18T16:03:50.000Z (almost 2 years ago)
- Last Synced: 2024-08-03T17:11:05.652Z (6 months ago)
- Topics: android-jetpack-components, coroutines-android, dagger2, jetpack-android, jetpack-lifecycle-components, jetpack-navigation, kotlin, mvvm-architecture, navigation-component, rest-api, retrofit2, room-persistence
- Language: Kotlin
- Homepage:
- Size: 2.01 MB
- Stars: 689
- Watchers: 26
- Forks: 227
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-android-kotlin-apps - Open-API-Android-App
README
# "Clean" Refactor Notes
In July 2021 I did a major refactor. Here's what I did:
1. Migrate from Dagger to [Hilt](https://developer.android.com/training/dependency-injection/hilt-android).
1. Update [Navigation Component](https://developer.android.com/guide/navigation).
- Now supports [multiple backstacks](https://medium.com/androiddevelopers/multiple-back-stacks-b714d974f134) by default.
1. Decoupling.
- Avoid sharing viewmodels. It makes unit testing easier when I can test fragments in isolation.
1. Splitting business models into Entities and Dto's. This way I have a clear [business model](https://github.com/mitchtabian/Open-API-Android-App/blob/master/app/src/main/java/com/codingwithmitch/openapi/business/domain/models/BlogPost.kt), [network model](https://github.com/mitchtabian/Open-API-Android-App/blob/master/app/src/main/java/com/codingwithmitch/openapi/business/datasource/network/main/BlogPostDto.kt), and [caching model](https://github.com/mitchtabian/Open-API-Android-App/blob/master/app/src/main/java/com/codingwithmitch/openapi/business/datasource/cache/blog/BlogPostEntity.kt).
1. Writing use cases.
- Unidirectional data flow with MVI and kotlin sealed classes. (See [Interactors](https://github.com/mitchtabian/Open-API-Android-App/tree/master/app/src/main/java/com/codingwithmitch/openapi/business/interactors))
1. Refactor message handling system to a [Queue](https://github.com/mitchtabian/Open-API-Android-App/blob/master/app/src/main/java/com/codingwithmitch/openapi/business/domain/util/Queue.kt).
1. Migrate from Shared Preferences to [DataStore](https://developer.android.com/topic/libraries/architecture/datastore).
1. Migrate from Kotlin synthetics to [ViewBinding](https://developer.android.com/topic/libraries/view-binding).
1. Write [Unit tests](https://github.com/mitchtabian/Open-API-Android-App/tree/master/app/src/test/java/com/codingwithmitch/openapi/interactors) for use-cases.# TODO
1. Check out the new [splash screen APIs](https://developer.android.com/about/versions/12/features/splash-screen)
1. Do a [Compose](https://developer.android.com/jetpack/compose) refactor
- I will create a new repo for this# Test Account
email: `[email protected]`
password: `password`
Powerful Android Apps with Jetpack Architecture
Watch the video course here: Powerful Android Apps with Jetpack Architecture.
In this course you'll learn to build a real application that interacts with the website open-api.xyz.
Open-api.xyz is a sandbox website for codingwithmitch members to practice interacting with a Rest API.
Prerequisites (Recommended not required):
What you'll learn:
-
Kotlin: -
Coroutines:
- Advanced coroutine management using jobs
- Cancelling active jobs
- Coroutine scoping
-
Navigation Components:
- Bottom Navigation View with fragments
- Leveraging multiple navigation graphs (this is cutting edge content)
-
Dagger 2:
- custom scopes, fragment injection, activity injection, Viewmodel injection
-
MVI architecture:
- Basically this is MVVM with some additions
- State management
- Building a generic BaseViewModel
- Repository pattern (NetworkBoundResource)
-
Room Persistence:
- SQLite on Android with Room Persistence library
- Custom queries, inserts, deletes, updates
- Foreign Key relationships
- Multiple database tables
-
Cache:
- Database caching (saving data from network into local cache)
- Single source of truth principal
-
Retrofit 2:
- Handling any type of response from server (success, error, none, etc...)
- Returning LiveData from Retrofit calls (Retrofit Call Adapter)
-
ViewModels:
- Sharing a ViewModel between several fragments
- Building a powerful generic BaseViewModel
-
WebViews:
- Interacting with the server through a webview (Javascript)
-
SearchView:
- Programmatically implement a SearchView
- Execute search queries to network and db cache
-
Images:
- Selecting images from phone memory
- Cropping images to a specific aspect ratio
- Setting limitations on image size and aspect ratio
- Uploading a cropped image to server
-
Network Request Management:
- Cancelling pending network requests (Kotlin coroutines)
- Testing for network delays
-
Pagination:
- Paginating objects returned from server and database cache
-
Material Design:
- Bottom Navigation View with Fragments
- Customizing Bottom Navigation Icon behavior
- Handling Different Screen Sizes (ConstraintLayout)
- Material Dialogs
- Fragment transition animations