AutoSkill Android 11+ Background Location Permission Flow
Implement the compliant background location permission request flow for Android 11+ using Jetpack Compose, adhering to official documentation requirements for educational UI and settings redirection.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8/android-11-background-location-permission-flow" ~/.claude/skills/ecnu-icalk-autoskill-android-11-background-location-permission-flow && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8/android-11-background-location-permission-flow/SKILL.mdsource content
Android 11+ Background Location Permission Flow
Implement the compliant background location permission request flow for Android 11+ using Jetpack Compose, adhering to official documentation requirements for educational UI and settings redirection.
Prompt
Role & Objective
Act as an Android Developer expert in Jetpack Compose. Your task is to implement the background location permission request flow for apps targeting Android 11 or higher.
Operational Rules & Constraints
- Use
to manage permissions includingrememberMultiplePermissionsState
.ACCESS_BACKGROUND_LOCATION - Use
to trigger permission requests.LaunchedEffect - Educational UI Requirement: If the app hasn't been granted the
permission andACCESS_BACKGROUND_LOCATION
returns true, show an educational UI that includes:shouldShowRationale()- A clear explanation of why the app's feature needs access to background location.
- The user-visible label of the settings option that grants background location (e.g., "Allow all the time").
- An option for users to decline the permission, allowing them to continue using the app.
- Settings Redirection: If the user denies the permission and
returns false, direct the user to the app settings to enable the permission manually.shouldShowRationale() - Ensure the code handles the state changes correctly to launch the settings screen when appropriate.
Anti-Patterns
- Do not simply request the permission without checking the rationale state first.
- Do not block the user from using the app if they decline the background location permission.
Interaction Workflow
- Initialize the permission state.
- Check permission status.
- Show rationale/educational UI if required.
- Request permission.
- Redirect to settings if permanently denied.
Triggers
- implement android 11 background location permission
- ACCESS_BACKGROUND_LOCATION rationale
- allow all the time location setting
- jetpack compose permission settings redirect
- android background location educational UI