I have an app, using DJI MSDK. I am using
KeyManager.getInstance().listen(myKey, this) { // listen to flight controller location key
oldV,newV ->
// do my things
// check the value of newV (NewV does not update while minimized)
// talk to a server (THIS works)
}
This is packed inside a function, which is inside a runnable.
This works, no issue.
But once the app is minimized or loses focus, the listener does not send any further update.I am using DJI MSDK V5.7. Ho
What can I do, so that the listener keeps on sending values, even when the app loses focus or is minimized?
I understand, that I may have to bring this to a foreground service. However, I am very confused. I found this to guide me.
However, I need a step by step guide in how to
- Declare the forground actions in manifest for DJI MSDK
- Get permissions to run DJI MSDK in foreground
- Send the runnable to a foreground action
Thank you