Skip to content
Agentmart
Submit a tool

add-android-foreground-service

Add an Android foreground service (for music, fitness tracking, downloads).

Skill by khadinakbarlabs

IndexedMIT★ 3
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/khadinakbarlabs-add-android-foreground-service

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Add an Android foreground service (for music, fitness tracking, downloads). Requires FGSTYPE declaration in Android 14+. Use when the user says 'foreground service android', 'background tracking android', 'persistent notification android'.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/add-android-foreground-service

What's inside

Skill name
add-android-foreground-service
Description
Add an Android foreground service (for music, fitness tracking, downloads). Requires FGSTYPE declaration in Android 14+. Use when the user says 'foreground service android', 'background tracking android', 'persistent notification android'.
License
MIT
Instructions
90 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • openai.yaml · agents/

SKILL.md (first lines)

# Add Android Foreground Service

Run code that survives app background. Requires user-visible persistent notification.

## Android 14+ requirement

Must declare `foregroundServiceType` in `AndroidManifest.xml`:
- `location` — GPS tracking
- `mediaPlayback` — audio playback
- `phoneCall` — VoIP
- `connectedDevice` — Bluetooth, Watch
- `camera` — recording
- `mediaProjection` — screen recording
- `microphone` — voice recording
- `health` — fitness/health
- `dataSync` — file sync
- `shortService` — <3 min total

Each requires Play Console justification + video at submission!

## RN+Expo approach

```bash
pnpm add @notifee/react-native
```

Notifee wraps Android's NotificationCompat + foreground service. Best community option.

```tsx
import notifee from '@notifee/react-native';

await notifee.displayNotification({
  title: 'Tracking workout',
  body: 'Running for 23 min',
  android: {
    channelId: 'workout',
    asForegroundService: true,
    ongoing: true,
    smallIcon: 'ic_notification',
  },
});

// To stop:
await notifee.stopForegroundService();
```

## Service type declaration (config plugin needed)

Inject into `AndroidManifest.xml` via expo-build-properties:
```json
{
  "expo-build-properties": {
    "android": {
      "manifestPlaceholders": {
        "foregroundServiceType": "location"
      }
    }
  }
}
```

Or use a custom config plugin.

## When users will see the persistent notif

ALWAYS while service runs. User can tap to open app, can swipe-dismiss only on Android 14+ if you allow.

## Play Console justification

Submit a 30-sec video showing:
1. What the service does
2. Why the persistent notif is needed
3. How users start/stop it

Common rejections:
- "App doesn't need a foreground service for this" → use WorkManager instead
- "Type 'dataSync' used for analytics" → wrong type
- "User can't stop the service"

## When NOT to use

- Periodic background work → use WorkManager (no notif required)
- Push notifications → FCM
- Brief tasks (<10 sec) → use coroutine in app

## Pair with
- `add-expo-notifications-fcm` for push (different concern)
- `add-onesignal-push` for marketing push

From khadinakbarlabs/expo-mobile-app-builder, MIT.

More from khadinakbarlabs/expo-mobile-app-builder

Signals

Stars
3
Forks
0
Open issues
0
Last commit (this folder)
Aug 5, 2026 (2 months ago)
Last release
Oct 4, 2026 (24 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from khadinakbarlabs

Cite this page

add-android-foreground-service skill. Agent Mart. https://agentmart.dev/skills/khadinakbarlabs-add-android-foreground-service (last updated 2026-10-24)