Call Unity functions from a foreground service in Android

Hi,

I am wondering if this is at all possible with unity right now. I want to be able to use unitysendmessage from within my android application while its in a background state or better still run the update function in the background (only while this service is active)

I do have a separate foreground service running when we need Android to talk to the app but Unity still never appears to pickup on the call from the foreground service.

For IOS I used UnityBatchPlayerLoop() this did exactly what I needed but can’t seem to find an android alternative.

Any help here would be greatly appreciated

Not super-familiar with how Android does this sort of IPC but I think it’s at a granularity of something called an “activity.”

I imagine your service would tickle a special activity in the Unity-built game, which could then wake up and/or launch the main one? Or maybe just launch the main activity??

You might find more domain knowledge about this stuff in the Platforms/Android area of this board.

1 Like