add PowerManager class to sdk.

Hello corona :slight_smile:

Corona sdk is great. It hase made everything simple and easy.we love it :slight_smile:

As you know, PowerManager class is operating system class that gives you control of the power state of the device. It Added to android api in API level 1. Since the beginning of the android!!

http://developer.android.com/reference/android/os/PowerManager.html

Unfortunately, corona sdk does not support it. It allows developer to control cpu running on sleep, dim screen and more. It is necessary in app like GPS mapping that track people when device is sleep or on health programs that track heart rate or in puzzle games to prevent game go to sleep or screen dim.

I guess that is not too difficult to add it corona sdk os table.

Please add it to the library.

I’ve seen many comments on the forum that looking for a way to keep music playing or app does not go to sleep.

I promise all of the developers will be happy :wink:

Thanks a lot

Keeping external music playing is already possible with a snippet like:

if (audio.supportsSessionProperty) then -- set the audio mix mode to allow sounds from the app to mix with other sounds from the device audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode) end 

Preventing the device from going to sleep is also possible with system.setIdleTimer( false )

However, you might want it for other implementations. To get a proper voting going you can add a new feature request here:

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback

Keeping external music playing is already possible with a snippet like:

if (audio.supportsSessionProperty) then -- set the audio mix mode to allow sounds from the app to mix with other sounds from the device audio.setSessionProperty(audio.MixMode, audio.AmbientMixMode) end 

Preventing the device from going to sleep is also possible with system.setIdleTimer( false )

However, you might want it for other implementations. To get a proper voting going you can add a new feature request here:

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback