Adobe Air listening to uninstaling event - actionscript-3

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!

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.

Related

How to display a notification in adobe air for android

I want to display notifications in my Adobe Air App for Android using Adobe Flash and Action Script 3.0 .
I want to use notifications for reminding people to update my app when a new version gets released, so how do I do this?
Thank you.
As DefinitelyNotAPlesiosaur has mentioned, using an ANE is the way to go.
You can find some free ANE's to use here:
http://www.riaxe.com/blog/200-adobe-air-anes/
but I would highly recommend district as they publish multiple well documented ANE's with example files and offer excellent support.
http://airnativeextensions.com
It sounds like you would need either Notifications or Push Notifications if your message was to appear when the user is not using the app, or Dialog if the message appears whilst the user is using the app.

How to prompt user to turn on Location Services using adobe air

I am developing an app that uses GPS, so typically the app must prompt the user to turn Gps on if it is muted.
So is there a way to open the Location Services menu from inside my app using adobe air?
I would imagine an ANE would be required for this.
Perhaps contact Distriqt to see if they would consider adding the functionality to one of their existing ANE's ?
http://airnativeextensions.com/extension/com.distriqt.NetworkInfo

How to obtain Android Device key in AIR with Action Script 3?

I am trying to make a push notification in my game using GCM through AWS.
I have bought this ANE: http://myappsnippet.com/gcm/comment-page-2/
But I cannot get the token in my device.
Can somebody help?
Adobe AIR does not have a built-in function to get any device id, because of various platforms. You should use some kind of extension, like Distriqt's Application ANE.

Activate chrome app from web page?

I am building a packaged chrome app (It is needed as I want to access chrome.socket). I have a website from which I would like to call my app (if installed or ask the user to install it) by clicking a link. Is this possible ? Not able to find any easy way for this workflow.
The url_handlers might be the best way to achieve this.
You can also use the externally_connectable manifest property to declare that your website can connect to your app, then call chrome.runtime.sendMessage or chrome.runtime.connect from your webpage and handle it in an chrome.runtime.onMessage handler in the app.
Which one is better suited depends on your needs. The url_handlers is an easier way, but it will permanently assign the URL on your link to your app, so you won't be able to use it for anything else if the app is installed. The externally_connectable is a harder way, but it enables a much more elaborate bidirectional communication between your website and the app.
You can even use a combination of the two approaches, if you need: launch the app using the url_handlers feature, then establish a communication channel back to the website once the app is up and running.
Apps can now (as of Chrome 31 I believe) register to handle urls by adding url_handlers in their manifest and detecting the url causing the app to launch in the chrome.app.runtime.onLaunched event. If the app doesn't launch, your hosted web site will be loaded an can present an inline installation with chrome.webstore.install.

In-app sms sending in as3

How to send sms within an iphone and android app using as3. I found this code while googling:
var callURL:String="sms:0-123-456-7890";
var targetURL:URLRequest = new URLRequest(callURL);
navigateToURL(targetURL);
Its working, but it is navigating the app to sms window controller. Can it be done without opening the sms controller window. Is there anything that opens a window within the app itself. Is there any air native extenson which perform this for android and iphone?
Yeah, using navigateToURL is going to pop you over to the phones default SMS app. To get around this you're going to need to use a native extension.
I know of one for Android:
https://github.com/mr-archano/Android-AIR-Extensions
If you have an Android phone you can check out a demo of this ANE inside of the AIRexplorer app. Select the SMS ANE version from the list (the app includes an extension as well as navigateToURL)
I don't know of one for iOS right now so you may have to do a little bit of digging
Oh Also, wanted to add a comment because I'm not really sure of your intent here.
If your goal is to send a sms without any user interaction that is not going to be possible. ANE or not
I very much doubt that either ios or android (maybe if you root your device?) would allow sending a SMS without the users explicit consent.