Skip to main content
Participating Frequently
April 15, 2013
Question

Problem in android app using AIR

  • April 15, 2013
  • 1 reply
  • 616 views

Hello,

I have many problems with android app.

I develop App in Flash CS6, AIR 3.2 and AS3. its working fine in iOS device but not working nicely in android.

Issue is:

  1. when phone calls comes then audio is playing in background
  2. when back button tapped, two thing which are not working
    • audio is not stopped
    • App goes back on the home page - and app keeps running in the background
  3. I mentioned landscape orientation on publishing app. but when start app and click on screen lock then orientation is changed to portrait. I


Please advise me the solution if anyone knows

Thank you

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
April 15, 2013

Some problems with orientation were in later versions of AIR, you should think about using a more recent one. AIR 3.7 is out now, you could use that.

To stop the audio you will need to listen to the deactivate events, and stop the audio, or at least mute it. Then on activate you can start it again.

In order to get a deactivation event when a phone call comes in you will need to request the read_phone_state permission in the Android publishing settings.

To detect the Back button being pressed you will need to listen for the key events, something like this:

stage.addEventListener(KeyboardEvent.KEY_UP, fl_OptionsBackHandler);

private function fl_OptionsBackHandler(event:KeyboardEvent):void {

if (event.keyCode == Keyboard.BACK) {

SoundMixer.stopAll();

}