Interactive Maps
Relevant source files
The following files were used as context for generating this wiki page:
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/MapScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/maps/GoogleMapScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/ui/screens/maps/BluetoothMapScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/SettingsScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/rebuilt/ui/screens/HeatmapScreen.kt
- app/src/main/kotlin/com/shadowcheck/mobile/presentation/viewmodel/MainViewModel.kt
- app/src/main/AndroidManifest.xml
The Interactive Maps feature in ShadowCheck Mobile provides a comprehensive visualization suite for monitored signals, including WiFi networks, Bluetooth devices, and cellular towers. By integrating geographic data with signal intelligence, the system allows users to identify the physical location of emitters, analyze signal coverage through heatmaps, and toggle between different map providers like Mapbox and Google Maps.
This module is central to the application's wardriving and surveillance detection capabilities, enabling real-time spatial awareness of the surrounding radio frequency (RF) environment.
Map Architecture and Providers
The mapping system is designed to be provider-agnostic, supporting both Mapbox and Google Maps. Users can select their preferred provider through the application settings, which stores the preference in encrypted shared preferences.
Provider Configuration
The application initializes different map SDKs based on the map_provider setting. Mapbox is used for high-performance vector maps, while Google Maps serves as a secondary robust option. Both require specific API keys and metadata within the Android Manifest.
Sources: SettingsScreen.kt:53-81, AndroidManifest.xml:44-45
Data Flow for Map Markers
The system retrieves signal sightings from the Room database using Flow objects. These flows are collected and transformed into UI-ready marker models that include coordinates, signal strength, and identifiers.
Sources: MapScreen.kt:43-85, MainViewModel.kt:52-68
Map Components and Marker Logic
The maps use a custom data structure called NetworkMarker to standardize various signal types for geographic display.
NetworkMarker Data Structure
| Field | Type | Description |
|---|---|---|
| lat | Double | Latitude of the sighting |
| lon | Double | Longitude of the sighting |
| type | String | Signal category (WiFi, Bluetooth, Cellular) |
| name | String | SSID for WiFi, Device Name for BT, or Cell ID |
| signalStrength | Int | Signal intensity in dBm |
| id | String | BSSID, MAC Address, or Cell ID |
Sources: MapScreen.kt:23-30
Filtering and Visualization
Users can filter map views using chips to display specific signal types. The implementation defaults to an "All" view but provides granular control over WiFi, Bluetooth, and Cellular overlays.
- WiFi: Markers show SSID (or "Hidden") and signal level.
- Bluetooth: Markers display device name and RSSI.
- Cellular: Visualized with calculated signal strength based on tower data.
Sources: MapScreen.kt:104-111, GoogleMapScreen.kt:44-55
Temporal Heatmaps
Beyond static point markers, the application includes a HeatmapScreen for temporal analysis. This component visualizes network activity over time rather than just space, helping identify patterns of surveillance or movement.
Activity Analysis Flow
The heatmap queries data based on a weekOffset and selectedType. It groups records by the hour of the day and day of the week to create a 7x24 grid of activity.
Intensity Legend
| Color | Intensity Level | Logic |
|---|---|---|
| #263238 | No Activity | Zero sightings |
| #1A237E | Low | < 25% of max count |
| #0D47A1 | Medium | 25% - 50% of max count |
| #01579B | High | 50% - 75% of max count |
| #006064 | Very High | > 75% of max count |
Sources: HeatmapScreen.kt:164-171
Integration and Permissions
Interactive maps require extensive system permissions and background services to function correctly, particularly for location tracking and hardware-specific scans.
Manifest Requirements
The application requests ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION to place markers accurately. It also includes meta-data for MAPBOX_ACCESS_TOKEN and com.google.android.geo.API_KEY.
Sources: AndroidManifest.xml:6-7, AndroidManifest.xml:44-45
Navigation and State Management
The MainViewModel manages the global UI state for maps, including the current map provider, search queries, and toggle states for specific network layers.
| State Field | Type | Purpose |
|---|---|---|
| mapProvider | String | Currently active map SDK |
| currentLocation | Location | User's current coordinates |
| showWiFiOnMap | Boolean | Toggle state for WiFi layer |
| showBluetoothOnMap | Boolean | Toggle state for Bluetooth layer |
Sources: MainViewModel.kt:20-30
Conclusion
Interactive Maps in ShadowCheck Mobile serve as the primary interface for geographic signal intelligence. By combining multi-provider support with temporal heatmapping and real-time database collection, the system provides a robust platform for detecting and analyzing RF emitters in physical space.