Skip to main content
Participating Frequently
May 16, 2012
Question

App audio plays while Kindle Fire screen is locked

  • May 16, 2012
  • 1 reply
  • 3794 views

I am hoping someone has found a solution to this issue:

If I put my Kindle Fire to sleep using the power button, when I wake it back up, the app's audio begins playback while the screen is still locked.

All the other soft keys on the device control the app and the audio as expected.

As far as I can tell, it seems that when the Event.ACTIVATE fires, the app runs and Amazon just tosses a screen-lock overlay on top. My app is running at full frame rate (and playing audio) underneath the screen lock, but there are no events I can listen for to tell when the unlock happens.

I'm probably missing something, but shouldn't there be an event type in the NativeApplication class that we can listen for? Everything I've tried so far doesn't work.

I haven't submitted this to Amazon yet, but it seems likely to be rejected. Any ideas appreciated!

This topic has been closed for replies.

1 reply

Participant
February 5, 2013

hi have you found the solution? I also suffer the same issue

daottingAuthor
Participating Frequently
February 5, 2013

No, I never solved that problem. Fortunately, both my submissions to Amazon's Appstore were approved, if that helps any.

Known Participant
April 16, 2013

Yeah, this is a problem I had to solve about a year ago. Android's guidelines suggest you should pause your game on a DEACTIVATE event and then require user input, like a tap on a pause screen, before resuming your app. So that's what I ended up doing. I built a semi-transparent pause screen that overlays the entire screen and app, and then unpauses on the next tap. And I also had to handle resizing the pause screen when the app auto-orients.

For audio I'd originally built a sound class that listened to ACTIVATE and DEACTIVATE events and would pause themselves accordingly, but I ended up tying their pause/unpause mechanism to the app's pause resume.

Oh, and you will probably want to build a lock parameter into your pause method, so that in some situations the only code that can unpause the app is the code that passes the same lock/unlock string. Otherwise, you might find your app resuming when it wasn't suppose to.

Hope that helps. Oh, and testers with the Samsung App Store sometimes think they are designers and sometimes may reject your app because they say the pause screen should have gone away automatically. Don't listen to them. Try filing a petition explaining your app is following Android guidelines or just resubmit the app and hope for a different tester. And one of the first tests a Samsung tester does is power off and on the screen and see if your app can handle it correctly. So yeah, they are tougher than Amazon.

But warning. The worst is Google Play. If one app goofs up and inadvertently violates one of their guidelines they may just ban your entire account - nevermind that you may have a 100 other apps published through that account. And they will tell you nothing. Not the name of the app that caused the violation, or even what the violation was - just a "please read our guidelines again." And it could be something as seemingly innocuous as key word stuffing in the apps description - but you won't know what caused it. Sorry, now I'm venting a little. But if you need to publish a large number of apps consider finding a way to spread them out over multiple accounts if you can to protect yourself.