Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
i want to do is that if my application is closed from the task manager my service won't stop and if stops another package that is also running and checking the application process will turn my service ON how can i do it
If you want to make sure that your service should keep running or should get recreated again after killed then you should return start_sticky from your onStartCommand() method which will make sure to recreate your service as soon as memory is free. check the following link for more detail. http://developer.android.com/reference/android/app/Service.html#START_STICKY
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to know if there is any class or Alarm in android or IOS that tells if the mobile is Down or UP, or just started or restarted. (and for how long!)
i'm creating a logging system, and i need to log the different state of the mobile all along the day.
Thanks in advance,
You need to add send notification from you app (native in iOS and Android) to your remote logging server.
Android as well as iOS have Application life cycle. Which provides you with callback if app is in running state , background , foreground etc.
There is a similar one for Android
The idea is that both of them have singleton for application and they have callbacks for app transition stage
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Hey friends,i am doing one android application:
-in that i want to read value from the users during an installation of application.
if any code for that please share a code and steps
Thank you.
in that i want to read value from the users during an installation of application.
This is not possible. Your app will not run at all until the user runs it from the home screen's launcher. At that point, you are welcome to prompt the user to supply you with information.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I want to upload some data using web services, I have created a service, but when phone is switch off services are getting kill and data are not uploaded, please guide me on how to create a service which run even after switch of and on android, and will they persist data which is passed in intent to start service.
You can use Broadcast Receiver on reboot. Then re-start your background server.
see this question Broadcast receivers on reboot?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
i want to detect that some application has started in android, such as when you have started YouTube application
Did you think of using a service that would be running all the time in background and would send a broadcast for the current running application.
Hope this thread solves your problem somehow.
Determining the current foreground application from a background task or service
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have application which have timers and if the timers are stopped the application will wont work I need to keep the application on all time even when the app is turn off (I know doesn't makes sense) and also to save the files if the phone is switched down.
I need to keep the application on all time even when the app is turn off
You can you Service. Its for the same purpose.
Save the files if the phone is switched down
You can receive an intent ACTION_SHUTDOWN in the broadcast receiver, when phone is about to switch off. Then you can do whatever you want to do there. See Is there any way to receive a notification when the user powers off the device? for details.
Hope this helps.
I suggest that you investigate Services.
A service can run in the background continuously.