What problem does this solve?
The app carries a 3.6★ from its earlier buggy behaviour. With the bugs fixed and the BattWatch relaunch (companion rebrand issue), the fastest way to move the displayed rating is fresh, positive reviews — Google Play weights recent ratings far more heavily than the lifetime average. Right now there's no in-app prompt, so only motivated (often unhappy) users leave reviews.
Proposed solution
Add the Google Play In-App Review API (ReviewManager, com.google.android.play:review:2.0.2 — this is Java, so the non-ktx artifact).
Trigger at a genuine positive moment
- e.g. when the user opens Battery Insights and sees healthy data, or after N successful app sessions / days with no crash.
- Never after an alert, mid-task, or on first launch.
- Cap to at most once per long interval and persist that we asked (SharedPreferences), independent of whether the sheet actually showed.
Respect Play policy (these are hard rules, not style)
- Do not gate by sentiment. You may not show a "Are you enjoying BattWatch? → only happy users go to the review sheet" pre-prompt that filters who sees it — that violates Play's In-App Review guidelines and risks enforcement.
- The API is quota-throttled and may silently no-op — the sheet is not guaranteed to appear. Never block UI on it, never tell the user "please rate now" expecting the dialog, and don't verify whether they reviewed.
F-Droid / non-Play safety (interacts with #4)
com.google.android.play:review is a proprietary Play library — it will conflict with F-Droid inclusion (#4) and is a no-op on degoogled devices. Handle deliberately:
- Preferred: a product flavor (
play vs foss) so the FOSS/F-Droid build has zero Play dependency and the code path is compiled out, or
- a runtime
GoogleApiAvailability guard that skips the Play path when Play Services/Store is absent.
- On the non-Play path, fall back to a plain "Rate us / Star on GitHub" action rather than nothing.
Wire into the existing feedback flow
Complement MainActivity's feedback chooser (GitHub / email) — the in-app review is an additional, unobtrusive prompt, not a replacement for the existing explicit feedback paths.
Acceptance criteria
Related: BattWatch rebrand (companion issue), #4 (F-Droid — the flavor/guard decision here affects inclusion).
What problem does this solve?
The app carries a 3.6★ from its earlier buggy behaviour. With the bugs fixed and the BattWatch relaunch (companion rebrand issue), the fastest way to move the displayed rating is fresh, positive reviews — Google Play weights recent ratings far more heavily than the lifetime average. Right now there's no in-app prompt, so only motivated (often unhappy) users leave reviews.
Proposed solution
Add the Google Play In-App Review API (
ReviewManager,com.google.android.play:review:2.0.2— this is Java, so the non-ktx artifact).Trigger at a genuine positive moment
Respect Play policy (these are hard rules, not style)
F-Droid / non-Play safety (interacts with #4)
com.google.android.play:reviewis a proprietary Play library — it will conflict with F-Droid inclusion (#4) and is a no-op on degoogled devices. Handle deliberately:playvsfoss) so the FOSS/F-Droid build has zero Play dependency and the code path is compiled out, orGoogleApiAvailabilityguard that skips the Play path when Play Services/Store is absent.Wire into the existing feedback flow
Complement
MainActivity's feedback chooser (GitHub / email) — the in-app review is an additional, unobtrusive prompt, not a replacement for the existing explicit feedback paths.Acceptance criteria
Related: BattWatch rebrand (companion issue), #4 (F-Droid — the flavor/guard decision here affects inclusion).