I'm considering using Adobe Air to write an application for the android marketplace. I was wondering if anyone could tell me what (if any) the limitations are with regard to getting /开发者_JS百科 handling system events. For instance can you pause the app if the user receives a text message? Or detect if they have their music playing and mute your app's sounds?
It would seem a real pity if Air cannot do this.
I can't seem to see anything online - so thanks very much for your help if anyone finds anything out.
Speaking authoritatively only about the iOS packager (and by extension assuming it should be true of the apk packager) I know that recent AIR versions do indeed let you pause when the OS interrupts your application.
NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onNativeAppActivated);
NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onNativeAppDeactiated);
If you need to put special logic in your app to handle interruptions you'd write handlers for Event.ACTIVATE and Event.DEACTIVATE for the NativeApplication instance.
As for other bits of accessability to the hardware, there are limitations. EG: You aren't allowed fine-grained gps location, only coarse location. If I find the comprehensive list again I'll post it up.
精彩评论