I have an Adobe Air Android application. I want to know when the app is going to be removed and to do something basic if I catch this event. Is this possible on adobe air android? thank you!
-
Your app is unlikely to be running when it is uninstalled, so there is no way to attach an event listener. – Josh Nov 26 '13 at 15:58
1 Answers
No, there is no uninstall event in Adobe Air.
A solution could be to do whatever you want to accomplish every time the applications exits.
// make a reference to the NA singleton instance
var nativeApplication = NativeApplication.nativeApplication;
//add an event listener
nativeApplication.addEventListener(Event.EXITING,onExitHandler);
function onExitHandler(e){
//do something
}
Another possible solution could be to monitor some URL with a unique device identifier. For example http://www.domain.com/activity.php?deviceId=1234567890
. You would not know how many apps are installed, but you'd have an idea of how much activity your app is having. I don't know if that would be legal though.
The device identifier can be obtained via a Native Extension such as this one. I'm using it on iOS successfully to identify unique devices.
As for URL monitoring you can use the URLMonitor class.
Finally, I'd like to point out that it is indeed possible to do what you are after using native Java code in Android. Theoretically it should be possible to mimic that functionality developing your own native extension (ANE). Here's an introduction on developing your ANE for Android.
-
thank you! Unfortunately this is not what I need. I want to know when my app is going to be unnistaled, some statistic informations... – tziuka Dec 02 '13 at 11:18
-