android: native GPS tracking with foreground service for screen-off support

Move GPS collection from WebView JS (watchPosition) to native Android
LocationForegroundService, which survives screen-off. JS polls native
side for accumulated points. Also: auto-enable GPS for cardio exercises,
filter saved track to workout duration only, fix live map batch updates,
notification tap opens active workout, and fix build script for pnpm.
This commit is contained in:
2026-03-23 13:39:45 +01:00
parent 748537dc74
commit 4ba3960607
3 changed files with 69 additions and 36 deletions

View File

@@ -119,6 +119,7 @@
$effect(() => {
const len = gps.track.length;
if (len > prevTrackLen && liveMap && gps.latestPoint) {
// Add all new points since last update (native polling delivers batches)
for (let i = prevTrackLen; i < len; i++) {
const p = gps.track[i];
livePolyline.addLatLng([p.lat, p.lng]);