How arlaudcyril/test-android-app works
Project type and purpose
• This is an Android mobile application project (the “app” module) that uses Kotlin and Java, coupled with an Android UI widget library (the “CountryCodePicker” module). The app appears to be a cryptocurrency/fiat wallet or trading client (package name com.Lyber) that interacts with remote REST APIs and Firebase Cloud Messaging.
File structure
• Top-level modules:
• CountryCodePicker: A standalone AAR library providing a country-picker UI component (BottomSheetDialogView, adapter, listeners, resources).
• app: The main Android application.
• app/src/main:
• AndroidManifest.xml, resources (layouts, drawables, navigation graph, animations, fonts).
• java/com/Lyber: subdivided into models, network, services, ui (activities, fragments, adapters), utils, viewmodels.
• assets and google-services.json (for FCM).
• Configuration/build files: build.gradle at project and module level, gradle wrapper, ProGuard rules, keystore, settings.gradle.
Architectural clues
• The code follows MVVM (Model-View-ViewModel):
• View layer: Activities & Fragments, Adapters
• ViewModel layer: NetworkViewModel, ProfileViewModel, etc.
• Model layer: data classes under models, localDataModels.
• Network: Api.kt and RestClient.kt likely wrap Retrofit/OkHttp to call remote RESTful endpoints.
• Services: MyFirebaseMessagingService handles push notifications.
• Utilities: PreferenceManager, EncryptionHelper, KeyStoreHelper for local storage/security; CommonMethods for business utilities.
Main components
a. App module
1) UI Layer
• Activities (e.g., SplashActivity, WebViewActivity)
• Fragments (hundreds of feature-specific fragments, bottom sheets, dialogs)
• Adapters (RecyclerView, bottom sheet list adapters)
2) ViewModels
• Exposed to UI via LiveData/StateFlow
3) Data Layer
• Models (remote and local data structures)
• Network (RestClient → Retrofit → HTTP)
• Local persistence (PreferenceManager, KeyStore, optional Room if present)
4) Services
• Firebase Cloud Messaging (push notifications)
b. CountryCodePicker library
• BottomSheetDialogView, adapter, listeners, XML layouts & drawables – consumed by UI Fragments for country selection
c. External services
• Remote REST API servers
• Firebase Cloud Messaging
d. Build & deployment
• Gradle build scripts, ProGuard/R8 obfuscation, signing with key.jks
• Output APK/AAB
Relationships and data flows
• UI (Activity/Fragment) → invokes ViewModel methods
• ViewModel → uses RestClient/Api to fetch/send data
• RestClient → HTTP → Remote API
• API response → parsed into Model → returned to ViewModel → updates UI via LiveData
• UI may call CountryCodePicker library component for country selection
• FirebaseMessagingService → receives push → notifies app via internal broadcast or LiveData → UI updates
Architectural patterns & principles
• MVVM separation of concerns
• Single-Activity pattern with Navigation Component (nav_graph.xml)
• Repository-style data access (RestClient hides network details)
• Modularization: reusable CountryCodePicker component
• Secure local storage: KeyStoreHelper, EncryptionHelper, PreferenceManager