We managed to make Unity run from a class that extends UnityNativePlayerActivity, got it to make and show Toasts on window change, to be sure that it is actually set up properly.
Updating Unity3D frame by frame doesn’t work entirely while in background mode( it works as intended when the game is focused), the logging console shows me that it tries to, but it will skip the current frame because the Unity window itself isn’t focused. Some parts of the code seem to be working, but for one, the audio system doesn’t work at all. The console throws those errors every single update:
Are there any solutions that anyone has encountered related to my problem? Is it even possible to run a Unity game in background on Android?
E/Unity ( 4285): [EGL] Failed to create surface
E/Unity ( 4285):
E/Unity ( 4285): (Filename: Line: 132)
E/Unity ( 4285):
E/Unity ( 4285): [EGL] Error:: EGL_BAD_NATIVE_WINDOW: A NativeWindowType argument does not refer to a valid native window.
E/Unity ( 4285):
E/Unity ( 4285): (Filename: ./PlatformDependent/AndroidPlayer/ContextGLES.cpp Line: 132)
E/Unity ( 4285):
I/Unity ( 4285): Skipped rendering frame because GfxDevice is in invalid state (device lost)
I/Unity ( 4285):
I/Unity ( 4285): (Filename: Line: 1539)
Thanks in advance for the help.