Keep Android Process (App) Running at All Times - android

Proglem:
Create custom Android App which will never be killed by the platform.
Given a Dialer app (or a phone-app), for making calls on Android Phone, is there a way to similarly create custom app and make it a system app, so that Android always keep it running?
In other words, the problem we have is to deploy an app which will never be killed by AOSP due to lack of resources or anything similar, which is what I think android does for Dialer and some other system apps/services.
Possible helpful hint: The device will always have power supply, as it is not a phone/tablet but rather a custom device running custom AOSP.

Related

Android foreground service that can't be killed?

Though it may look odd but I am developing an application that will ran on a one specific device with Android 6.0.1 and I don't care about other devices. The app should accomplish a long (very long) running work without any user's interaction as a service in the foreground. In other words I'm trying to use the device as a small server. I don't have much experience in developing mobile aplication but I found out that Android OS interferes too much in applications life circle. And though application starts and works properly for some time it can be unexpectably killed with vague reasons.
So the question is how to prohibit Android system to interfere with my application? Is it enough to make the application an administrator of the device? Or may be Android devices can't be used in such cases and it's a waste of time?

Android app closing automatically

I have an android app installed on device (4.2.2).
The device will never go to power save mode.
If i leave the app open for more than 30 minutes, the app closes automatically.
And no exception found in the log.
Is this default android behaviour?
If possible please share any links about this issue.
That is just part of how Android manages memory for activities using the Low Memory Killer, even if as of today devices running Android have vast amounts of memory, the same rules are still applied as when it was designed, and it was designed to run on devices with low memory, if you want to keep it alive without user interaction you might have to either use a Service, or maybe find a way to simulate user interaction.
If you have this behaviour just only 4.x, but under 4.x don't, try in Manifest to turn true largeHeap. You have to turn it on in apllications tag attribute. I hope it will help.

How to prevent Android from killing my Unity app?

I'm developing an augmented reality app with Unity where users can shoot a photo with their mobile device to add 3D objects on it. The problem is that on Android, when the user chooses to shoot a photo from my app, the app is put on the background and often closed instead of being kept in memory to handle the photo taken. I know it is because of Android killing apps to free ram.. But is there a way to prevent the killing of my app ? Even on Ipad 2 with its 512Mo of ram IOS doesn't do this brutal killing thing : after the shooting it goes back smoothly to the app. Whereas Android does it with my 1Go of ram phone.
Also I do not want my app being killed and restarted by a service to handle the photo because it is pretty heavy to load and so really far from starting instantly.
Application.runInBackground is disabled on mobile platforms and therefore Unity cannot guarantee that your game/app is kept running. This behaviour is normal as the OS kills activities as needed. Sadly Android is resource hungry and therefore apps that stay in the background on iOs might be killed on Android, even with better hardware.
As hinted in this thread you have a few options: use states to handle pause/resume, create a service that will keep running in the background (it will have to be created outside of Unity either via a plugin or in eclipse) and/or use Android's intents mechanism.

How to run flex mobile application in background?

I need to run my android application (written in Flex) in the system background, so that periodically performs some defined task. Unfortunately I can not find any hints on the Internet:( I would also like to know how such an application to restore from the system background?
Please help if you know the solution.
Thank you.
Best,
Martin
I need to run my android application (written in Flex) in the system
background, so that periodically performs some defined task
Technically you should be able to minimized it on launch; however for performance issues non active applications are throttled. That means everything--including timers--will run slower than expected. So, 1 second on your timer will not necessarily equal 1 second in the real world when the application is inactive.
Unless it will be okay for the user to manually trigger your tasks; you should consider an alternate technology for the implementation. AIR is just not usually suitable for background applications.

Is there any specific time before android automatically closes the application?

As the title says, is there any predefined time set in the operating system that will close any application after some time? in my application I have a process that takes around 5 seconds to complete in pure java. And I know that I should put this in a AsyncTask, just asking the clearify this. Thanks!
It varies from device to device and depends on what is running on the device.
Hope this example gives you a fair idea of what can happen.I'm currently developing an app that uses the camera via intent.
On the Acer Liquid, it went to the camera and returned but on the Sony Ericson Arc, the app was killed in the background almost immediately after the it left my app to go to the camera.
After a restart of the Arc and running the app again, it wasn't killed. Started a few other apps and tried again and it was killed. The Liquid on the other hand would keep the app running four hours in the background even if I started a bunch of other apps.
There is no standard, it varies from device to device, manufacturer to manufacturer and what's currently running at the time.

Categories

Resources