How madhavraj2004/ipollusense_nit works
Project Type and Purpose
• This is a single-module Android mobile app (“app/”) built with Java (and a bit of C++ via a.cpp), following MVVM principles.
• It connects to physical devices over Bluetooth, displays data in the UI via Fragments/Activities, and integrates with Firebase for cloud messaging and services (per google-services.json).
File Structure
Top-level:
– app/: Android module
– build.gradle, gradle/: Build scripts and wrapper
In app/:
– src/main/java/com/example/ipollusen/:
• Activities (e.g., LoginActivity, MainActivity, SplashActivity)
• Fragments (e.g., RoomsFragment, MapsFragment, RecommendationFragment)
• ViewModels (e.g., RoomDetailsViewModel, AssistantViewModel)
• Services (e.g., BluetoothService, MyFirebaseMessagingService)
• Data models/adapters (e.g., ApplianceModel, RoomModel, ApplianceJsonAdapter)
– src/main/res/: layouts, drawables, navigation graph (mobile_navigation.xml), values, menus
– libs/serviceLibrary-release.aar: packaged helper library (likely for device/service communication)
– a.cpp: native code (NDK) used by the app—possibly sensor data processing
README for Insights
• Confirms it is an Android Studio project using Gradle, with Firebase integration.
a. Main Components
1. UI Layer
– Activities & Fragments
– Navigation Component
2. Presentation Layer
– ViewModels (MVVM)
– LiveData / Observers
3. Data & Domain Layer
– Data models & JSON adapters
– Local/native code (a.cpp)
– serviceLibrary.aar
4. Services & Business Logic
– BluetoothService (scans/connects to IoT sensors)
– MyFirebaseMessagingService (push notifications)
5. External Systems
– Bluetooth Devices (sensors)
– Firebase (Cloud Messaging, Analytics, possibly Realtime Database)
– Google Maps API (in MapsFragment)
b. Relationships & Interactions
– UI → ViewModel: user events and data binding
– ViewModel → Service/Library: invokes BluetoothService or native code via JNI
– BluetoothService ↔ Physical Sensors (BLE)
– ViewModel → FirebaseMessagingService: registers for/handles push notifications
– Data flow: Sensor data → BluetoothService → ViewModel → UI
– Push flow: Firebase → MyFirebaseMessagingService → ViewModel → NotificationFragment/UI
c. Architectural Patterns
– MVVM: clear separation of UI (Activities/Fragments) and business logic (ViewModels)
– Android Navigation Component for in-app routing
– JNI bridge for C++ sensor processing (a.cpp)
– External AAR (serviceLibrary) encapsulates device-specific logic
d. Key Technologies & Frameworks
– Android SDK (Activities, Fragments, Services)
– Android Jetpack: ViewModel, LiveData, Navigation
– Firebase Cloud Messaging
– Bluetooth LE APIs
– Google Maps Android API
– Gradle build system
– Native code via NDK (C++)