Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing a Sticky Service in android/flutter

I need to add a native sticky background service in a flutter application, in order to achieve 2 things:

  1. Starting at boot time and running in background indefinitely
  2. Exchange data with the main Dart activity, in a message passing fashion

However, I cannot find any kind of useful documentation. It seems that for now, you have to choose to go completely native or giving up using low level features and focus only on the UI (until someone pulls a specific plugin out of the hat).

Thus, my question is the following: what is the easiest way to achieve this sort of integration, starting with a basic flutter project ?

Thank you

like image 858
docdev Avatar asked Mar 01 '26 22:03

docdev


1 Answers

  1. Make a Sticky Service using native Android service.
  2. The easiest way to exchange data with the main Dart activity is to use deep links or intents.

Note: if you explain more why do you need that, I think I may be able to give you a better solution.

like image 58
Jabbar Avatar answered Mar 03 '26 10:03

Jabbar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!