I would like to notify my server that the user deleted the application. How can I accomplish this?
Get application uninstall event in android
According to this post what you ask for is not possible. Are you by any chance using a C2DM implementation?
Unfortunately there is currently no way for an Android package to execute code when it is removed. However, you can register a BroadcastReceiver for ACTION_PACKAGE_REMOVED in a different package that will be called when packages are removed from the phone.
Also see this question.
Related
Thanks in advanced, I am using imsdroid library in my app. calling feature work fine, but i am unable to receive call when app is closed.When I minimize application it works but when i clear application from recent app it can't receive call. What is solution for this issue, please help me out. or provide some reference links.
According to me, IMSdroid does not provide this functionality. You have to open your application while dealing with them. I got same issue:
https://code.google.com/p/imsdroid/issues/detail?can=2&q=491&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&id=491
finally resolved it with some customization.
#nik u r right. it is not possible to keep registered all the time.in that case u have to notify the second person when first client tries to make him a call ,and when second client will get notification, then fire a broadcast to start the NativeService. this will register the device. and finally u will get the incoming call.
How to check if intent or app has started ?
My use case is I am showing up notifications through my app and I want to clear them all via myBuilder.cancelAll() if default messaging app has started since my app shows sms notifications. So I am kind of looking for something like:
if (smsAppStarted) {
myBuilder.cancelAll();
}
Thanks
To check if an app has started:
Get the package name of the sms app you want to check.
Then refer to my answer here:
Android how to know an app has been started and range apps priority according the starting times
By using that code, the list taskInfo will contain the list of all apps currently running. Search that list using the package name of the sms app. If it is present in that list, it means that that app has started and currently running.
If I get you right, you need to determine, if another app is currently running. If so, then use this solution.
I'm looking at the description for the Plan B app here: https://play.google.com/store/apps/details?id=com.lookout.labs.planb. It says it will start automatically after installation. How do you configure an app to do this?
Register to receive common intents. One especially suitable for your purpose is:
"android.intent.action.PACKAGE_ADDED"
You might also listen for other intents such as BOOT_COMPLETED, etc.
Edit: According to another Stack Overflow answer, You can't run your own application immediately after it's installed. You must register for other intents as I suggested. Something to note is that you app will require user permission to receive the BOOT_COMPLETED intent.
Update: As pointed out by zapl, post 4.0 you cannot do anything after install now until the user explicitly launches your app.
So, we were coding an Android application in Eclipse, and we couldn't figure out why a class wouldn't delete. We removed it from the application completely, and it was still there. Then we found out that it was actually pulling in the information from another application. Does this usually happen?
EDIT: More information:
The problem only happened when we built on 1 of the three devices, the one that had the App it was pulling information from. On the other 2, it wouldn't run at all. The other App had a different name, signing key, and was a different project.
EDIT 2: It happened again. There is an app called SMS.apk, and the second is called 2012.apk. The class names are different, and the project names are different. There are no references to eachother in the files at all. But it was pulling in code from SMS to 2012. It worked, until we removed SMS, when we realized that it was using that code. At this point, we are a little worried we accidentally stumbled upon Skynet.
No, Eclipse does not do that. The reason this is happening is most likely because its an SMS app, so you're using broadcast receiver. Heres a tidbit from a helpful book:
One interesting characteristic of the BroadcastReceiver is that you
can continue to listen for incoming SMS messages even if the
application is not running; as long as the application is installed on
the device, any incoming SMS messages will be received by the
application
Source. pg. 273
I wrote an application and I need to send sms. I think that it is a good idea to do it during the application installation or when installation is finished.
It is correct? If it is correct, how can I do it?
Sorry, but you cannot get control during application installation.
This question asked how to intercept an intent during a download. I personally tried by getting the Android Market source code and working on a c2dm hijack, however because it verifies its c2dm transmission with the app signature, it is about impossible (and very much frowned upon) to spoof, and without rooting the phone, you cannot listen to packets coming in on the network interface. Your best bet is to send the text after your application has installed (as described here).