What I learnt
DESIGN EVOLUTION - Apple sucks because it costs £££. Google ain’t much better but doesn’t cost as much £££.
Basically - time to just focus on Android development is the shorthand version.
Get Android done, and then we can figure out a solution to the iOS problem.
Probably going to cost £1,000-1,600 depending on the solution 🙄
And Google needs to be more consistent… having to switch between like 3 unharmonised documentation sets is definitely annoying 🙄
REVISED DESIGN ARCHITECTURE: Thanks Jetpack! You just threw everything upside-down!
Anyway here’s a revised idea on how we can design the layers without too much difference in it’s implementation.
Presentation Layer:
- Jetpack Compose: This is the modern way to build native UIs for Android. It’s fully declarative, meaning you describe your UI in terms of its appearance and behavior without having to deal with the framework details.
**androidx.compose.ui**
**androidx.compose.material**
(for Material Design components)**androidx.compose.animation**
(for animations)**androidx.compose.foundation**
(basic building blocks for UI)
Abstraction between Presentation and Logic:
- Kotlin interfaces or abstract classes.
Logic Layer:
- ViewModel: This is part of the Android Architecture Components and helps manage UI-related data in a lifecycle-conscious way.
**androidx.lifecycle**
(for**ViewModel**
and other lifecycle-aware components)
Abstraction between Logic and Data:
- Kotlin interfaces or abstract classes.
Data Access Layer:
- Repository Pattern: Use Kotlin classes to implement this pattern.
- Room: For local database storage.
**androidx.room**
- Retrofit: Not part of Jetpack, but commonly used with Kotlin for network operations.
- Paging: For efficient data loading and displaying large datasets.
**androidx.paging**
- DataStore: A modern data storage solution that can replace SharedPreferences.
**androidx.datastore**
Abstraction between Data Access and Database:
- Room DAOs: Room inherently provides this abstraction.
**androidx.room**
Database:
- Room: For local database storage.
**androidx.room**
- Firebase’s Firestore: For cloud storage (if you decide to use it).
**com.google.firebase**
Additional Libraries and Components:
- Navigation: Manage app navigation.
**androidx.navigation**
- Hilt: Dependency injection library tailored for Android.
**androidx.hilt**
- WorkManager: For background tasks.
**androidx.work**
- Biometrics: For biometric authentication.
**androidx.biometric**
- CameraX: For camera operations.
**androidx.camera**
- Testing:
**androidx.test**
**androidx.test.espresso**
(for UI tests)
General Steps: We’re now working front to back instead of back to front:
- Design your UI with Jetpack Compose: Start with mockups, then implement using Composable functions.
- Define UI-Logic Abstractions: Determine the actions/events the UI can trigger and define interfaces for them.
- Implement Logic in ViewModels: Use the
**ViewModel**
class from the Android Architecture Components. - Define Data Abstractions: Determine what data operations are needed and define interfaces for them.
- Implement Data Access with Repositories: Use the Repository pattern and integrate with Room, Retrofit, or other data sources.
- Set up your Database with Room: For local storage, and integrate Firebase SDK or other preferred solutions for cloud storage.
HEADACHE AREA: Use let Android Studio handle a lot of the navigation - etc. You’ll want to kill yourself otherwise.
Seriously. Just use the integrated solutions as much as possible.