love.system.syncHealthSteps() now exists on Android, matching the iOS
Health bridge merged in #452 and using the same JNI route as the SAF
picker (wrap_System.cpp -> System.cpp -> common/android.cpp ->
GameActivity over JNI):
- GameActivity.syncHealthSteps: one-shot read of the hardware
TYPE_STEP_COUNTER sensor (cumulative since boot, counted by the OS
whether or not any app runs). The reading is anchored in
SharedPreferences so a walk is never credited twice; a reading below
the anchor means the phone rebooted, which re-anchors without
crediting. Deltas (50k clamp) merge into steps_pending.json in the
save identity dir - the same contract as the iOS GRHealthBridge, so
the Pokewalker mod works unchanged on both platforms.
- ACTIVITY_RECOGNITION declared in the app manifest (Android 10+
runtime prompt on first sync; granted -> the sensor read runs
immediately via onRequestPermissionsResult). The build script's
permission trim leaves it alone.
- Nothing in the base game calls the new seam; without a consumer mod
the only cost is one dormant manifest permission.
- build_android.sh: shadow-build from a space-free temp dir when the
checkout path contains spaces - ndk-build is GNU make underneath and
cannot cope with paths like "xCode Projects".
- mobile/ANDROID.md: step-bridge dev notes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The manifest asks for android:screenOrientation="fullUser", but SDL
overrides it at window creation: SDLActivity.setOrientationBis, given a
resizable window and no SDL_HINT_ORIENTATIONS -- which is what conf.lua
produces on Android -- requests SCREEN_ORIENTATION_FULL_SENSOR. The
*_SENSOR constants follow the accelerometer even when the player has
turned auto-rotate off, so the game rotated anyway on a locked device.
Override setOrientationBis in GameActivity to remap SDL's request onto
the matching *_USER constant after super has run. The same orientations
stay allowed and SDL keeps deciding which ones those are; only the
tie-break changes, from the sensor to the system rotation setting.