You need to use Services
on Android side ( Official Documentation ).
In few words, foreground service starts in app background (it can be separate process, depends on your features and specifics). Service cannot be started and live on Android device silently to user (you starting service and you have few second to pin it to notification, otherwise the system kill it immediately), you need to create a notification and pin service to it. In service you can update your notification by some action (user interact with notification and you updating it) or by time (per minute update battery level status, for example).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.