Brief App Overview
-
This is a demo app that uses a Foreground Service to perform long running Wifi Scans and sends this data to an imaginary Api.
-
The WorkManager was used to schedule these periodic Wifi Scans for RSSI values.
-
The UI is meant to display the latest queried Received Signal Strength Indicator values, and the corresponding SSID name.
Solution Considerations
- MVVM Architecture Pattern
- Segregation of the app into the following layers:
(1) UI Layer - this is where we have views like Activities/Fragments
(2) Domain Layer - this is where we have ViewModels
(3) Data Layer - this is where we have our repositories and data sources (WifiManager) - Ability to test the above mentioned layers
- Use of WorkManager for scheduling tasks
Mechanism for demonstrating the application making requests
-
Two approaches have been used:
(1) The RSSI values are displayed in the MainActivity UI within 15 minutes (this is the min time WorkManager enforces between tasks)(2) Check Logcat statements using the filter: "OkHttpClient". The Json payload for the network request and response are logged.
Testing Instructions
-
In Android Studio, find the "test" folder which exists under "src" directory
-
Right click this folder and select "Run 'Tests in 'RSSI.app'"
-
Alternatively run the below command in the Terminal:
./gradlew test