Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicosnicolaou16/sampleforegroundserviceflutter
This sample project demonstrates the setup for a foreground service. The service in this project is a foreground service used to request location. The required permissions depend on the type of foreground service.
https://github.com/nicosnicolaou16/sampleforegroundserviceflutter
android android-application background-service channels dart flutter flutter-apps foreground-service kotlin kotlin-android location-services service
Last synced: 24 days ago
JSON representation
This sample project demonstrates the setup for a foreground service. The service in this project is a foreground service used to request location. The required permissions depend on the type of foreground service.
- Host: GitHub
- URL: https://github.com/nicosnicolaou16/sampleforegroundserviceflutter
- Owner: NicosNicolaou16
- Created: 2024-01-19T20:49:39.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-12-24T23:39:39.000Z (24 days ago)
- Last Synced: 2024-12-25T00:23:28.268Z (24 days ago)
- Topics: android, android-application, background-service, channels, dart, flutter, flutter-apps, foreground-service, kotlin, kotlin-android, location-services, service
- Language: C++
- Homepage: https://medium.com/@nicosnicolaou/foreground-service-in-android-9ff18be69ef6
- Size: 129 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample Foreground Service Flutter
This sample project demonstrates the setup for a foreground service, specifically for requesting
location data. The permission `` depends on the type of foreground service being
used.
Communication between Android Native and Flutter is handled via a channel (refer to the
documentation for more details). If you need additional examples on using channels, please check my
repository for more information.
[ExampleChannelNativeAndroidWithCustomData](https://github.com/NicosNicolaou16/ExampleChannelNativeAndroidWithCustomData)> [!IMPORTANT]
> NOTE: EXAMPLE FOR ANDROID ONLY.# Setup
## Manifest Setup
```xml
```
> [!IMPORTANT]
> Check my article for the setup :point_right: [Foreground Service in Android - Medium](https://medium.com/@nicosnicolaou/foreground-service-in-android-9ff18be69ef6) :point_left:> [!IMPORTANT]
> Similar project with (Kotlin Language) :point_right: [SampleForegroundService](https://github.com/NicosNicolaou16/SampleForegroundService) :point_left:## Versioning
Flutter SDK version: 3.27.1
Dart Version: 3.6.0# References
https://developer.android.com/about/versions/14/changes/fgs-types-required
https://stackoverflow.com/questions/14385231/android-broadcastreceiver-auto-run-service-after-reboot-of-device
https://medium.com/@shreebhagwat94/flutter-platform-channel-46578d21e69
https://blog.devgenius.io/use-flutter-screens-in-native-android-app-share-data-among-them-d97d670807a6