How palachzzz/wheellogandroid works
Main Components
• Mobile Frontend (Android UI)
• This includes Activity classes (e.g., MainActivity, ScanActivity), fragments (e.g., MainPreferencesFragment), and view components (in the “views” and “presentation” packages).
• Resource files for layouts, drawables, strings, and other UI assets are located under app/src/main/res.
• Core Services and Utilities
• Services such as BluetoothLeService, LoggingService, and other utility classes (Constants, FileUtil, MathsUtil) form the application’s core functionality.
• These handle data acquisition from sensors, logging, and processing.
• External Integration Modules
• Specific integrations for different platforms: GarminConnectIQ, PebbleService, GearService, and specific adapters for Gotway, InMotion, Kingsong, Ninebot (and NinebotZ).
• These modules enable connectivity with external accessories and watches.
• Data/Library Components
• The app/libs folder includes JAR files like accessory-v2.5.1.jar, connectiq.jar, and sdk-v1.0.0.jar which provide external SDKs or libraries necessary for interfacing with the hardware or third-party services.
• Build and Configuration Components
• Gradle files, .gitignore, and GitHub Actions workflows (.github/workflows) are used for build automation and continuous integration.
Out the Relationships and Interactions
• The Android UI layer interacts with the service layer to trigger data collection (e.g., initiating Bluetooth scans or logging operations).
• The BluetoothLeService and other background services provide data from external sensors. The processed data is then fed into the LoggingService which may save data locally or forward it for further processing.
• The connectivity modules (GarminConnectIQ, PebbleService, GearService) are separate integration points that allow the mobile app to communicate with various wearable devices.
• The adapters (GotwayAdapter, InMotionAdapter, KingsongAdapter, NinebotAdapter, NinebotZAdapter) abstract details specific to different hardware types and allow the LoggingService or related components to handle various device protocols.
• A configuration or settings layer (files like preferences.xml, Preferences fragments) enables the user to customize which service or adapter to use and to set parameters.
Architectural Patterns
• MVC/MVP or a clear separation between UI (Activities, Fragments) and the Service/Business logic (Bluetooth services, logging services, and external integrations).
• Modularity through distinct packages that separate core functionality (services, utilities) from presentation or integration-specific code.
• Dependency on third-party libraries (via the libs folder) that extend functionality to external devices.
• Use of Gradle for building and continuous integration workflows as seen in the .github folder and gradle wrapper files.
Technologies and Frameworks
• Android SDK – leveraging components such as Activities, Services, Broadcast Receivers.
• Gradle – for build automation and dependency management.
• External SDKs from the JAR files (accessory, connectiq, sdk) for integrations with wearables and accessories.
• Native Android resource management (res folders for layouts, values, etc.) indicating strong adherence to Android app development conventions.
Specific Elements
• Use clear labels for each component: