I've seen that some apps only start working after a phone reset. Usually are apps that will run silent on the phone. The first time they run they'll ask for some info or prefs. How does those guys do it?
Welcome to SO!
These "apps" running at startup are basically Services that the Android framework invokes on startup. If you want your app to be invoked at startup.
Instead of Service, you could also call an Activity
http://www.androidcompetencycenter.com/2009/06/start-service-at-boot/
BTW, a similar question was posted here. To avoid your question being blocked/closed, it's best to follow the guidelines here.
Happy Coding! :)
Related
I want to code an app that hinders other app from launching. Can someone please help to start from the beginning. Can someone provide an example and i'll try my best to understand it. Thanks (Full code if possible :D)
One example is AppBlock in the play store.
To create a feature that 'blocks' other apps from running like AppBlock, you simply just need to show a popup on top of the other apps.
Look into SYSTEM_ALERT_WINDOW, with this, you can draw on top of any other app.
Once you have that working, you should look into the other permissions of AppBlock,as it'll show you what they're doing.
AppBlock's Permissions
bind to an accessibility service
update component usage statistics
receive data from Internet
view network connections
full network access
run at startup
reorder running apps
control vibration
prevent device from sleeping
I am makin an android application on Emergency communication.I want my application should run all the time and whenever it needs it should be able to run.I want that user should not be able to close it by any means.Like Google Maps application which is restarted again on killing its all activities and even we force close it,it will be restarted.
Seems you are learning app development ... but this is not the way you should pose question here... you should post what you have done and code issues and not ask for an entire class...
But i will try to answer your question are you trying to create an app which when started wont be able to be closed and come back to home screen ???!!!!!
See you are creating an app which will run on android operating system which is similar to linux so you must follow the Activity
LifeCycle
I remember i created an app where there were shortcuts on screen so using that i was directing the user to specific links but you can use for calling etc.. i donno if that is what you are searching for...
You might create a notification bar if you want which cannot be cancelled and you can place the code in the intent which will be called from this...
Also services are there which u can utilized what other users have suggested...
thx
You could use an extra service running in the foreground, but there will be always a notification of this service in the notification bar.
See here: http://developer.android.com/guide/components/services.html#Foreground
After 3.1 , Android introduced a security feature, where the application's code can't be run unless the user opens the application. Check the link for more info http://commonsware.com/blog/2011/07/13/boot-completed-regression-confirmed.html
I would like to know if anyone has found any hack or work around for this problem, where i can listen to a system broadcasts like boot, connectivity changed and run a service without opening the installed application.
This is not what the posts said. You can still register broadcast listeners, or alarms. You just need the user to actually start your application once. And, if the user forcefully stops your application, they'll need to start it manually again.
Why would you want a way around this behavior? It seems to make a lot of sense.
Why the same question again
This question has been asked around 100 times on SO. I am asking it again because all the answers say this is not possible but at least one of the app in Market is doing it NQ Mobile Security. I started a bounty of 100 points on the similar question but it did not get enough attention. If community does not accept I will remove the question.
What is the App doing
The app shows an activity when user tries to uninstall it
and does some processing before it is uninstalled
What is my Question
How to start an Activity or an IntentService before an application in uninstalled by the user who has earlier installed the app on her device?
As #CommonsWare said The techniques used by NQ Mobile Security have been reported to the Android Security group, and they are working on a fix to stop this behavior from occurring. and have raised a feature request with Google hopefully they may listen to it.
http://code.google.com/p/android/issues/detail?can=2&q=33315&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&id=33315
I think that you can track logcat, where all activities, events, intents are registered and and find when an Intent is sent to uninstall this app.
Then you could possibly perform an action, i.e. launch an Activity, but I am not sure for this step.
Hope this helps!
I don't know how it happen in NQ Mobile Security application,
But in general case I found it not possible (Or may be possible but I couldn't find the way),
Because,
When you register BroadcastReceiver for android.intent.action.PACKAGE_REMOVED in your own app and when the app is uninstalled, the registered BroadcastReceiver has been uninstalled before the app gets uninstalled,so its own uninstallation event won't be received by that BroadcastReceiver.
I know this is old but I want to provide this answer.
Listening on your own uninstall is pretty easy. You just need to use a binary which you execute and runs in background(with nohup command).
This binary can either listen on PACKAGE_REMOVED broadcast or you can regulary check if the file still exists in /data/app/ (these files are world readable, directory listing is disabled, but u know your own package name :) )
I dunno if the second solution can be done without draining battery.
I have an android application. I want to auto start my application after the installation finished.
IN other words I want to call an activity of my own application after installation.
Let me know is it possible? If yes how can I do it ?
Thanks,
Pravin
Your app isn't in memory after it is installed. It won't be able to call itself.
Also; after looking at all of your other questions, why do I get the feeling you are writing some sort of malware? The user owns their phone, not you.