Unity Android app: How to run app in background? - c#

I'm working on a Unity app that targets Android as platform. It's necessary that this app continues to run even when it does not have the focus in Android. My research so far brought me these possibilities:
Export the project as an Android gradle project and manimpulate the app's lifecycle in the UnityPlayerActivity, as described here
Use a (native Android) service, as often described, e.g. here
So far I have not succeeded in getting to run any of the options, so:
Is there any 'native' Unity way to achieve that the app runs in background? And are there conditions that my Unity app has to satisfy for this?

Related

Running an .exe on Android using Xamarin.Forms

I'm trying to build an Android app using Xamarin.Forms based on a Windows Desktop Application that I programmed. In that program, I ran an .exe using Process.Start(), but it doesn't seem to work for Android. Google wasn't a great help, so now I'm wondering:
Is it even possible to run an .exe on Android? If so, whats the best way to do it?

Getting app to install emulator in a xamarin project without having the source code

I have looked through the Microsoft documentation but everything seems to want you to run everything with the development code. I used a bitbar tutorial to help start my C# xamarinui test framework. I have the emulators working I just want the apk and ios apps to install as the first test. I know how to drag and drop and put the app on the phone manually. I am looking for a way to get the app to install and launch through test code or by some operation. I do not have access to the source.
Only for the Android case, google for the apk, usually they are available on sites like apk pure etc. If the apk has executables for x86 inside you could install in on android simulator using just drag and drop.
For iOS this seems not possible as the installer has to be signed with appropriate profiles that only app developer has in his possession.

Unity3D: Build not working for Hololens (UWP)

I am developing an application for Hololens through Unity3D. When I run my Unity3d application on Editor, it works fine.
But when I try to build it on Universal Windows Platform, it gives me this error
Failed to find a placeholder ('Assets/JsonDotNet/Assemblies/Standalone
/Newtonsoft.Json.dll') for 'Assets/IBMSdkCore/ThirdParty/JsonDotNet
/AOT/Newtonsoft.Json.dll', ensure it exists, or change plugin settings for
'Assets/IBMSdkCore/ThirdParty/JsonDotNet/AOT/Newtonsoft.Json.dll' accordingly.
I am not sure why? When I build it on Windows Standalone, it generates an exe file. Not sure why it doesnt work only for UWP?

Unity WebGL Augmented Reality application not working on iOS, but works in Android

As the title suggests, I have made an application using Unity and WebGL platform. The application runs on:
Windows (Firefox, Microsoft edge)
Android (Chrome, Firefox)
MacOS (Safari, Chrome)
Unity (Edditor)
The app does NOT run on:
iOS (Chrome, Safari, Firefox)
The application is using WebCamTexture to get the camera of the device. Wen running on all platforms except iOS the application asks for permition to share the device's camera. However on the iOS it just gives a blue screen and no other info.
The application does not crash, nor give any errors during launch on all platforms. Please tell me if I should share any relative code that might help. How could I successfully run it on iOS using any browser? Please share your experience and knowledge, any help is appreciated.
PS: The plugin used for WebGL Augmented Reality is called NyARToolkitUnity-5.0.8. The git can be found here.
Another detail to mention: The application has been built and tested with both Windows (Unity) and MacOS (Unity). It's currently running on an Asure server.The build can be found here.Thanks!

How does Xamarin launch your Android project?

Android projects run natively on Java, and NDK projects basically work by having a special Activity that launches your native code. For example, SDL has an Activity that initializes SDL, sets up a display window, and then launches your project.
I'm trying to see how Xamarin does it. Technically, CLR code is managed code rather than native, but the CLR itself is native code and the whole thing would look like an NDK project to the Android runtime. I've been looking around, but I can't find where the Android project launcher is in Xamarin, and Googling it turns up nothing useful.
What is the mechanism by which Xamarin launches your CLR project on an Android device?
What is the mechanism by which Xamarin launches your CLR project on an Android device?
You can refer to Application Startup.
When an app is launched in Android device, Android will load it by specified #android:name in manifest, then usually all types will be instantiated by invoking ContentProvider.attachinfo() method, Xamarin.Android then here adding a mono.MonoRuntimeProvider ContentProvider during the build process. The mono.MonoRuntimeProvider.attachInfo() method will then replace the native ContentProvider.attachinfo() method to load Mono runtime into the process.
This is how I understand that document, please advise me if there is any mistake, many thanks.

Categories

Resources