Tizen Workaround: Keep the device screen on without touch input

TaoOfSaladTaoOfSalad Member, Chef Emeritus Posts: 83
Here I will describe how to modify your Tizen app so that it requests that the screen remain on while the game is playing. This modification is only recommended if your game doesn't have any touch input for long periods of time. Normally, a touch by the user will cause the screen to remain on and not lock the device. But if your game is only controlled by accelerometer input for long periods of time, the screen will eventually turn off. To prevent that from happening, follow this procedure.

Limitations:
- This is only for Tizen. While we would like to support a feature like this for all platforms in a more integrated way, we're focused on other priorities on the roadmap. Nonetheless, it turns out that it is fairly easy to enable this setting by manually tinkering with the Tizen config files, so we've described it here even if it is a bit inelegant.
- IMPORTANT! You need to repeat this procedure every time you generate and build your app. When GS.com generates your app, it doesn't include this setting. And when you import the newly generated app, it will overwrite the previous one. So you need to redo these steps to enable the special power control feature again.
- Because it requires your app to request battery power controls, your app may get increased scrutiny from Tizen's acceptance testing. You should only do this if your game absolutely needs it.
- The setting applies to the entire game. You can't turn it on or off with rules.

Procedure:
Basically, you need to modify your Tizen wgt file to request battery power control privileges and then enable the force-screen-on option. To accomplish that, follow these steps:

- Publish, generate, download, and import your game in Tizen IDE as usual, but stop before the build step.
- When you import the wgt in Tizen IDE, it will create an folder in the Project Explorer toolbox. Expand the folder in the Project Explorer to show the files inside. Remember, we're working in Tizen IDE, not your hard drive Finder or File Explorer.
- Locate config.xml under your project. Double click to open it. (If there's a error message, it's because you didn't fill in all the text fields for author, description, license, etc. Fix that on your GS.com portfolio first and start back at step 1.)
- At the bottom of the config.xml editor window is a series of tabs. Click Privileges to switch to that edit screen.
- On the Privileges edit screen, click the Add button on the upper right. A popup appears.
- Scroll the list to find this option: http://tizen.org/privileges/power (that's not supposed to be a link; these the settings just have a format like web URLs). Select it and click the Finish button. You should now see it in the Privileges edit screen.
- Looking back down to the tabs at the bottom of the window, click Preferences to switch to that edit screen.
- In the list, find the entry with the name force-screen-on. It's default value is false. Select the middle value column for that row and edit the value to be true.
- menu File > Save
- menu Project > Clean...
- menu Project > Build Project
- You app will be rebuilt and signed. As with the normal process, a new wgt file will be created in your workspace folder. Proceed to submit that wgt file to the Tizen Store.

Comments

  • neomanneoman Member, BASIC Posts: 826
    Thanks @TaoOfSalad ... I have been waiting for this. I will resubmit my accelerometer game and see how it goes ... =D>
  • neomanneoman Member, BASIC Posts: 826
    @TaoOfSalad under Preferences there is no entry with the name force-screen-on. I created it manually and set all values to true in the middle and third column. I loaded the modified Tizen wgt file into the emulator. It didn't go to sleep. It's looking good. I will submit my accelerometer app again now. Fingers crossed. Cheers and once again thank you for your help ;-)
  • TaoOfSaladTaoOfSalad Member, Chef Emeritus Posts: 83
    @TaoOfSalad under Preferences there is no entry with the name force-screen-on. I created it manually and set all values to true in the middle and third column. I loaded the modified Tizen wgt file into the emulator. It didn't go to sleep. It's looking good. I will submit my accelerometer app again now. Fingers crossed. Cheers and once again thank you for your help ;-)
    If it wasn't there, I suspect it won't work. Did you regenerate on publishing after the newest build yesterday? Make sure to do that first and repeat.
  • neomanneoman Member, BASIC Posts: 826
    @TaoOfSalad under Preferences there is no entry with the name force-screen-on. I created it manually and set all values to true in the middle and third column. I loaded the modified Tizen wgt file into the emulator. It didn't go to sleep. It's looking good. I will submit my accelerometer app again now. Fingers crossed. Cheers and once again thank you for your help ;-)
    If it wasn't there, I suspect it won't work. Did you regenerate on publishing after the newest build yesterday? Make sure to do that first and repeat.
    @TaoOfSalad no I didn't regenerate the app after the newest build. I just followed your instructions using the unsigned .wgt file. I have submitted the app now so will wait if it gets rejected I will repackage and submit again. Cheers
  • neomanneoman Member, BASIC Posts: 826
    @TaoOfSalad FYI my accelerometer app got accepted on the Tizen App Store even though I didn't repackage it with the new update and added the option force-screen-on manually. The emulator stayed on all the time during my testing that is why I submitted it again. I just couldn't test the game functionality cos I can't tilt the monitor. Cheers and thanks.
  • RiffelRiffel Member Posts: 1,272
    "- At the bottom of the config.xml editor window is a series of tabs. Click Privileges to switch to that edit screen.
    - On the Privileges edit screen, click the Add button on the upper right. A popup appears."
    I can't find the Privileges edit screen or Add provilege button
    can you provide some screenshot?
Sign In or Register to comment.