services
"/home/yossef/notes/git/projects/inguide/modules/services.md"
path: inguide/modules/services.md
- **fileName**: services
- **Created on**: 2026-06-16 00:48:42
services
cs# services
Purpose: Background services — indoor positioning via magnetic fingerprinting and foreground service for location.
IndoorPositioningService
File: app/src/main/java/com/inguide/app/services/IndoorPositioningService.kt
- Extends
SensorEventListenerforTYPE_MAGNETIC_FIELD - Euclidean distance matching against pre-loaded
MagneticFingerprintDB - Below 0.3 confidence threshold → position nulled (rejects far/missing matches)
- Exposes
currentPosition: StateFlow<IndoorPosition?>(grid x,y) andcurrentPositionGeo: StateFlow<GeoPosition?>(lng,lat) loadFingerprints(data)— call this with DB data to enable positioning- Lifecycle:
start()/stop()methods exist but are never called — sensors never register. The object is created inMainScreen(line 153) but not activated.
GeoPosition
File: app/src/main/java/com/inguide/app/data/model/Models.kt
data class GeoPosition(
val longitude: Double,
val latitude: Double,
val floorId: String? = null,
val confidence: Float = 0f
)
LocationService
File: app/src/main/java/com/inguide/app/services/LocationService.kt
- Foreground service shell (foregroundServiceType="location")
- Shows notification "Indoor positioning active"
- Declared in manifest but not yet wired into the app flow
Known Issues
loadFingerprints()is never called in production — fingerprints stay emptyLocationServiceis not started by any code — declared but unused
Related: ./ar.md, ../flows/ar-navigation-flow.md
continue:[[]]
before:[[]]