Android Sounds

Apart from the stuttering which seems to be a feature of Corona my client is reporting that on Android devices the sound remains playing when the power or hibernation button is pressed.

How can I stop the sound. ( bit more complicated than audio stop )

Using OpenAL

Matt [import]uid: 5354 topic_id: 16909 reply_id: 316909[/import]

This is a problem with the newest daily builds and not the release version. The app does not suspend when pressing the power button or going to screen lock. We will address this issue sometime in the next couple of weeks. [import]uid: 32256 topic_id: 16909 reply_id: 63395[/import]

This is quite a serious problem, my app is finished except for this problem when is this going to be fixed? [import]uid: 8697 topic_id: 16909 reply_id: 64988[/import]

We have a pending fix for this issue now. We plan on doing some additional testing tomorrow, and if all goes well, this fix will be made available in this week’s daily builds. So, stay tuned. [import]uid: 32256 topic_id: 16909 reply_id: 64990[/import]

Joshua, we tried the new build 654.

The app has been suspended when the power button is pressed, but it is restarting on lock mode.

One of the requirements for registering at some appstores it that the app can not be running on lock mode. Please, could you fix that? We need this urgently.

Thanks in advance. [import]uid: 32230 topic_id: 16909 reply_id: 65283[/import]

I’m glad somebody noticed that, I was just about to put my submission together!

Please fix ASAP, Thanks [import]uid: 8697 topic_id: 16909 reply_id: 65289[/import]

I’m already aware that the app resumes at screen lock. But notice that Angry Birds has this issue too. In fact, many apps do. This is because Android calls our onResume() method in Java at screen lock. Terrible, I know, but that is a pretty major Android issue that we’re all stuck with. Although this may be fine for normal apps or games that are not heavily action oriented. Probably not okay for apps that play music in the background because it would start playing at screen lock… but again, notice that Angry Birds has this problem too.

The only other popular method that I’m aware of is to suspend/resume the app when the window loses/gains “focus” respectively. The issue with this is that the app will suspend when a dialog such as an Alert window is displayed. You can see this type of behavior in more action oriented games.

Bottom line, there is no perfect suspend/resume method that we can implement on Android that will match iOS. We can implement it one of two ways mentioned above and each method has its plus and minuses. But again, just to be clear, the suspend/resume behavior will NEVER match iOS. Everyone has this problem on Android.

So, it sounds like we need to make this configurable, or at least allow some kind of control as to when the app suspends and resumes. I’m open to ideas. [import]uid: 32256 topic_id: 16909 reply_id: 65296[/import]

The major one for my client was that the music still payed when switching from the app to a browser / the multitasking.

Your focus idea sounds like a solution though, don’t dialog boxes pause the game anyway? [import]uid: 5354 topic_id: 16909 reply_id: 65299[/import]

Matthew,

If you use the newest build, the app should suspend and stop playing music when switching to another app via multitasking. I’ve definitely tested this and it works. Corona apps do not suspend when dialogs are displayed. Instead, we suspend using the 1st method mentioned in my posting above. With the way things are made now, suspending an app will stop audio playing in the background which may not be the behavior you want when a dialog is displayed. That’s why I’m thinking we need more configuration options so that Corona developers can do what makes sense for their apps. [import]uid: 32256 topic_id: 16909 reply_id: 65309[/import]

Joshua, we agree with your thoughts.

But although Angry Birds also has this issue, other great games, like Cut the Rope, don’t have this behavior. I do not care about that. The real problem is that some app stores don’t accept apps that behave this way. We are trying to put our game on korean app stores and even explaining the situation (and passing to them this forum link as a reference) we received the following email:

“Well, I think it is impossible to publish ‘MixZle’ at T-Store, korean largest appstore, if Corona platform issue cannot be fixed.”

Please, could Ansca help us? Maybe creating a temporary resource to allow us to configure it, just for this moment. I see no problem this be an Android only configuration.

Thanks again. [import]uid: 32230 topic_id: 16909 reply_id: 65444[/import]

Is there any way to know the device is on screen lock mode?

With a read-only property like “isScreenLocked” I could try to workaround this issue (at least to pass on the app store tests). [import]uid: 29154 topic_id: 16909 reply_id: 65460[/import]

Everyone,

I’m going to look into this now. If we can easily detect when screen lock occurs, then I think we can solve this issue. The article that I’ve found at the following site looks promising. Hopefully no new special permissions are required.

http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/
[import]uid: 32256 topic_id: 16909 reply_id: 65469[/import]

Everyone,

After doing some research and 300 lines of code later, I have found a work-around for the Resume issue with the screen-lock window! This issue is now fixed and we are officially handling suspend/resume better than Angry Birds! Woo-hoo!!!

This fix will be made available in build #657.
Please test it out and let me know if this build solves your suspend/resume issues.

Note: I was short on resources in the office today and was not able to test the suspend handling when an Android device receives a phone call while a Corona app is running. If someone here could test this out then that would be greatly appreciated. Thanks! [import]uid: 32256 topic_id: 16909 reply_id: 65557[/import]

This solved my problem.

Thanks!! [import]uid: 8697 topic_id: 16909 reply_id: 65633[/import]

Thank you very much, Joshua!

Our first tests with build #657 on a Galaxy Tab showed the suspend/resume handling is working very nice when:

  • the power button is pressed
  • the home button is pressed
  • the device receives phone calls

Thanks again for the great support. [import]uid: 32230 topic_id: 16909 reply_id: 65704[/import]

pauloest: Do you have a contact email for T-Store? I can’t seem to find one on their webpage. [import]uid: 8872 topic_id: 16909 reply_id: 65729[/import]

kam187: We have not contacted the T-Store directly. Our game is put there by UbiNuri:

http://www.ubi-nuri.com/ [import]uid: 32230 topic_id: 16909 reply_id: 65774[/import]

Ahh ok. Scott from Ubi-Nuri contacted me some months ago. I wasn’t sure since their rev-share is 50%.

How are you finding them so far?

I notice on their page, the korean smartphone market is pretty small:

http://ubi-nuri.com/index.php?mid=Market_Place
[import]uid: 8872 topic_id: 16909 reply_id: 65776[/import]

Hi kam187. It’s a subject a little off the topic, so please send me an email: http://drixentertainment.com/support [import]uid: 32230 topic_id: 16909 reply_id: 65799[/import]

Ok, I’ll send you a mail when i get back to the office. I have a few good opertunities I can share with you too…

  • Toshiba App store
  • Samsung App Store
  • Huawei App Store
  • GetJar Gold
  • Operator app stores in EMEA such as Orange UK, Three UK, French and German telcos.

Anyone else interested, send me a mail through the mail link on my website and I’ll see if I can link you up with the relevant contacts:

http://www.base2solutions.com/walkabout

:slight_smile: [import]uid: 8872 topic_id: 16909 reply_id: 65829[/import]