Idle timer not working on SM J1-6 and need help with progress ring idea

I currently have an App live on play store and I notice that the idle timer is not working on my device but works fine on other devices, it is not a problem but I think Corona Developers should know for at least. I guess new devices are not supported by the system.setIdleTimer(). 

Next is, I use the progress ring shared by Jason Schroeder here  but for some reason, my app lags and someone gave me a feedback that her phone lags or sometimes not responding (Samsung S7 edge). So I made my own, though I use images instead of vector shapes.  Can someone give me an idea on how to create a progress ring without using slices and I’m having problem with the animation timer. Thank you in advance.

Here’s the source code of my Progress Ring Module. I also included a demo in it.

This is two separate issues and should have two separate threads.

For the first, it looks like you need to investigate the problem on said devices and submit a bug report. Without code or a clear explanation of what’s going on in your scenario, when the problem occurs and what’s happening around it, we can’t help.

For the second can you be sure there isn’t some other element interfering with the code? I know Android devices do weird things in the background so I would suggest attempting to test the solution on a different S7 Edge with a different set of apps installed, after trying the app started as the only running app.

@horacebury

I’m sorry, I will separate the 2nd issue, for the first issue I just enabled the idle timer by using the following code

------------------------------------------------- -- set idle timer to true system.setIdleTimer( true ) -------------------------------------------------

Using my cousin’s phone(Jellybean), the idle timer is working fine. Then I install the same app on my phone(Lollipop), the idle timer is not working. I set my phone’s screen timeout to 15 sec but still the screen is still not dimming. Is there any other developers with the same issue as mine? I guess since corona is made for games, developers doesn’t mind about the idle timer.

Is the screen going to sleep in 15 seconds? (not dimming, but turning off)

Rob

My advice, do not include that function at all and let the phone decide when to sleep based on the users preference.

@Rob 

wrong term used. Sorry  :stuck_out_tongue: . I set the screen timeout of my to 15 sec. It should sleep after 15 secs without user interaction but it didn’t.

@Spehere Game Studios

I use the live build and test if my phone’s idle timer is enabled but it was not.

display.setDefault( "background", 1 ) local isOn = system.getIdleTimer( ) local text = display.newText( tostring(isOn), display.contentCenterX, display.contentCenterY, nil, 80 ) text:setFillColor( 0 ) -- enable idle timer if not disabled if (not isOn) then text.text = tostring(isOn) system.setIdleTimer( true ) end 

Still set to false. 

Correct me if I’m doing it wrong. I never tried this before since I often develop games than apps. 

By the way, my phone is Samsung J1-6 (SM J120H) and running a Lollipop android version. I wonder if new devices may experience the same issue. Not a big deal for me though it’s worth knowing.

Thank you for the response guys! I appreciate it. :slight_smile:

I took your code above and changed it up a little bit to conduct a more through test:

system.setIdleTimer( false ) local isOn1 = system.getIdleTimer( ) local text1 = display.newText( tostring(isOn1), display.contentCenterX, display.contentCenterY - 50, nil, 80 ) text1:setFillColor( 1 ) system.setIdleTimer( true ) local isOn2 = system.getIdleTimer( ) local text2 = display.newText( tostring(isOn2), display.contentCenterX, display.contentCenterY + 50, nil, 80 ) text2:setFillColor( 1 )

Note, I  have a black background, so I changed the color of the text to white.  I tested this on a Google Nexus 9 tablet running Android 6.01. I built with the latest daily build (though that’s not all that relevant since we haven’t changed anything around this in a long time, but feel free to get 2017.3114 and try).

I get:

False

True

displayed on my screen.  It’s possible that it could be an Android 5.1 issue. It could be something Samsung did with the J1’s ROM’s thats ignoring the setting. If you can put together a small project. Perhaps take my code and use  your build.settings and config.lua and see what you get on your device. If it fails, then compress the main.lua, config.lua and build.settings (and any other assets needed to build your projects) into a .ZIP file and then use the “Report a bug” link at the top of the page. With a reproducible test case we can get our engineers to look at it.

Rob

Please note to test on device. The simulator doesn’t have an idle timer.

Rob

@ Rob

I am using build 2017.3028 

I tested it but still the same. 

I took some screenshots and getting ready to report it. Thanks Rob.

Any solution for this error?

I tested on a samsung mobile and not dimming, but on a samsung tablet works fine.

Thanks.

There may be a device setting affecting this… Here are a couple of possibilities:
 

https://forums.androidcentral.com/google-nexus-7-tablet-2012/234476-disable-sleep-mode.html

https://android.gadgethacks.com/how-to/android-basics-disable-doze-app-standby-for-individual-apps-0168960/

There is also a strong possibility that depending on the version of Android that Samsung is using and their localizations, or changes my by your phone carrier, they may have created a situation where the normal way to manage this via software no longer works.

The Corona default is to allow the screen to dim and eventually go into sleep mode unless you explicitly turn it off. 

Rob

This is two separate issues and should have two separate threads.

For the first, it looks like you need to investigate the problem on said devices and submit a bug report. Without code or a clear explanation of what’s going on in your scenario, when the problem occurs and what’s happening around it, we can’t help.

For the second can you be sure there isn’t some other element interfering with the code? I know Android devices do weird things in the background so I would suggest attempting to test the solution on a different S7 Edge with a different set of apps installed, after trying the app started as the only running app.

@horacebury

I’m sorry, I will separate the 2nd issue, for the first issue I just enabled the idle timer by using the following code

------------------------------------------------- -- set idle timer to true system.setIdleTimer( true ) -------------------------------------------------

Using my cousin’s phone(Jellybean), the idle timer is working fine. Then I install the same app on my phone(Lollipop), the idle timer is not working. I set my phone’s screen timeout to 15 sec but still the screen is still not dimming. Is there any other developers with the same issue as mine? I guess since corona is made for games, developers doesn’t mind about the idle timer.

Is the screen going to sleep in 15 seconds? (not dimming, but turning off)

Rob

My advice, do not include that function at all and let the phone decide when to sleep based on the users preference.

@Rob 

wrong term used. Sorry  :stuck_out_tongue: . I set the screen timeout of my to 15 sec. It should sleep after 15 secs without user interaction but it didn’t.

@Spehere Game Studios

I use the live build and test if my phone’s idle timer is enabled but it was not.

display.setDefault( "background", 1 ) local isOn = system.getIdleTimer( ) local text = display.newText( tostring(isOn), display.contentCenterX, display.contentCenterY, nil, 80 ) text:setFillColor( 0 ) -- enable idle timer if not disabled if (not isOn) then text.text = tostring(isOn) system.setIdleTimer( true ) end 

Still set to false. 

Correct me if I’m doing it wrong. I never tried this before since I often develop games than apps. 

By the way, my phone is Samsung J1-6 (SM J120H) and running a Lollipop android version. I wonder if new devices may experience the same issue. Not a big deal for me though it’s worth knowing.

Thank you for the response guys! I appreciate it. :slight_smile:

I took your code above and changed it up a little bit to conduct a more through test:

system.setIdleTimer( false ) local isOn1 = system.getIdleTimer( ) local text1 = display.newText( tostring(isOn1), display.contentCenterX, display.contentCenterY - 50, nil, 80 ) text1:setFillColor( 1 ) system.setIdleTimer( true ) local isOn2 = system.getIdleTimer( ) local text2 = display.newText( tostring(isOn2), display.contentCenterX, display.contentCenterY + 50, nil, 80 ) text2:setFillColor( 1 )

Note, I  have a black background, so I changed the color of the text to white.  I tested this on a Google Nexus 9 tablet running Android 6.01. I built with the latest daily build (though that’s not all that relevant since we haven’t changed anything around this in a long time, but feel free to get 2017.3114 and try).

I get:

False

True

displayed on my screen.  It’s possible that it could be an Android 5.1 issue. It could be something Samsung did with the J1’s ROM’s thats ignoring the setting. If you can put together a small project. Perhaps take my code and use  your build.settings and config.lua and see what you get on your device. If it fails, then compress the main.lua, config.lua and build.settings (and any other assets needed to build your projects) into a .ZIP file and then use the “Report a bug” link at the top of the page. With a reproducible test case we can get our engineers to look at it.

Rob

Please note to test on device. The simulator doesn’t have an idle timer.

Rob

@ Rob

I am using build 2017.3028 

I tested it but still the same. 

I took some screenshots and getting ready to report it. Thanks Rob.

Any solution for this error?

I tested on a samsung mobile and not dimming, but on a samsung tablet works fine.

Thanks.