adobe air application how to run in background - android

I need to make my air app to disappear when I press a button or to run in background for about 5 seconds and close it after that.
How can I do this? thank you very much!

You cannot force close your AIR app by simply calling
NativeApplication.nativeApplication.exit()
That doesn't work in AIR. For that you will have to write a simple ANE and call android code to exit application. We also forced closed our AIR android app by ANE.

I don't believe it's possible to control if your app is visible, the android OS controls that.
You can detect if your app is about to be suspended by listening for the Event.DEACTIVATE from the NativeApplication.nativeApplication object.
You can close your app with NativeApplication.nativeApplication.exit(), however it wont be a "background" process.

Related

Cordova - disable background mode or multi-tasking in Android

Is there a way to disable multi-tasking in Android? In iOS, you can set UIApplicationExitOnSuspend to YES in info.plist will do the job. Is there an equivalent setting I can set for Android to achieve the same thing? Basically I want to kill the app the moment it goes into background, and start fresh when they come back.
I am using Cordova.

AS3 Application fades out while running

I'm developing a game in AS3 for Android. For some reason when I'm testing it on an Android device, after, lets say, 3 or 4 seconds, the screens starts to fade out till it's completely black while app is still running.
I have the "Stay Active/Awake" on "Android Developers Option".
I'm hoping you can help me with this problem.
Thank you!
As I'm using only Accelerometer it doesn't count as a feature to stay awake. We have to force Android to stay awake by code. Basically when app is running it triggers stayAwake mode else it triggers normal mode.

Android: Make app not closeable (kiosk) under certain circumstances

I have a problem that I don't really know how to solve and also the threads here at SO haven't fully helped me.
Here's the issue: I want to have an android app that I can start whenever I want, and then, when I click on a button, I want the app to be somewhat "locked". By that I mean: after this button was pressed, the user is not able to close(see edit below) the app. Also, the app should immediately start after rebooting the device.
This lock can then be revoked by, say, entering a passcode, which makes the app run normally again.
So far I understand how to build kiosk applications. However, a kiosk application needs a particular manifest which will make it always a kiosk app, and not "on demand".
I'd greatly appreciate any hints and tips on this topic. Thank you so much!
EDIT: by "close" I really only mean completely turning the app off, not only going back to your home screen. Such that the app is always running in the background
You can programmatically lock and unlock the App in Android 5.0 http://developer.android.com/about/versions/android-5.0.html#ScreenPinning

Is there somethign similar to the Windows Task Manager for the android emulator

I was studying some tutorials on Android programming and I realized that pressing the Home button on the emulator takes me tot he phones Desktop, but my sample that was running at the time only goes to the background and does not get destroyed. However, if I press the return button, the app is destroyed as well. So I am assuming there might be other apps running int he background as well, those which I am not aware of. Is there something in the android emulator resembling the task manager from windows, which shows what apps are currently running on the phone? I don't have a smartphone with me, but I remember seeing something like that on my friend's smartphone a few days ago. It wasn't an external app but was something built into the phone, I could access it by going to Settings or something.
Is there a task manager built into the android emulator, or is there any other way I can see such things through the SDK debugger?
Inside the settings, there is a list of currently running processes.
First , Leaving the activity does not mean the process ends, It is just not invisible . When the Os needs more memory ,it will be recovered.
If you want to have a backup process, you can start a back service.
http://developer.android.com/reference/android/app/Service.html
Here is how I end a process (only works on Android 4.0+).
Instead of pressing home, press recent and swipe away the process you want to end. Then press home (or back).
You can also use this to close those nasty apps that prevent you from closing them by not allowing back button to work on their main screens.
This is much quicker than having to go to settings, etc.

Phonegap persistent app in background, how to?

i have a Phonegap and JQM app.
Problem is, if I switch to another app and then back to my app, App is completely reloaded and start again.
Is posible this disable?
Thanks for any advice.
This is happening because there is a lack of memory for the app to run. So as soon as u go to home the app dies and on opening again it reloads the app from the start. To confirm that this is indeed happening i would suggest that you close all running apps on your phone and then run your app. Im sure it would run properly even after switching to home screen and coming back.I don't think its possible to get around this behavior. Design your app so that it has a small startup time so that its usable even on phones with less ram where such problems would come.

Categories

Resources