Languages

Menu
Sites
Language
To make suspend when pause

 

 

How  can I suspend all app's processes when screen off and app should be pause auto by browser but it doesn't happened?

 

 

 

 

Edited by: Kilim A on 12 Aug, 2016
View Selected Answer

Responses

11 Replies
Armaan-Ul- Islam

Hello,

a) Please share In your config.xml -> Tizen tab-> background-support is enabled or disabled?

b) Would you please share the list of privileges the app is using from config.xml file?

c) If possible please share the .wgt file (the last link you shared isn't available now anymore)

Thank you.

Kilim A

a) Please share In your config.xml -> Tizen tab-> background-support is enabled or disabled?

- Disable

 

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/ChopinMoon360x360" version="1.0.8" viewmodes="maximized">
    <tizen:application id="KzzbtNkGsC.ChopinMoon360x360" package="KzzbtNkGsC" required_version="2.3.1"/>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <feature name="http://tizen.org/feature/sensor.accelerometer"/>
    <icon src="icon.png"/>
    <name>ChopinMoon</name>
    <tizen:privilege name="http://tizen.org/privilege/power"/>
    <tizen:profile name="wearable"/>
    <tizen:setting background-support="disable" encryption="disable" hwkey-event="enable"/>
</widget>

b) Would you please share the list of privileges the app is using from config.xml file?

tizen:privilege name="http://tizen.org/privilege/power"/>

- But i get  - Validation Result Report from Sumsung  test command -Measured sleep current is higher than standard current while application is running - then app has NO privileges.

c) If possible please share the .wgt file (the last link you shared isn't available now anymore)

This is app was rejected ( cod minimized)

 with reason -  Measured sleep current is higher than standard current while application is

 

 Thank you.

 

 

Kilim A

How about help?

 I have got else two rejects  however i did minimal cpu work when screen is off ( pause).

 I can send by email or share files with logs, video, and wgt file somebody here... to explain me why it is happen.

Nafisul Islam Kiron

Hi, I see that you used Construct 2 for your project.

I deployed your project and it seemed to run just fine. I used some basic tool in Tizen IDE and it kinda looked okay.

 

I searched a bit and found that a few people who used that library had pausing issues. They recommended to use the "cr_setSuspended" method in the following way instead of in "onVisibilityChanged":

function onBlur() { cr_setSuspended(true); };
function onFocus(){ cr_setSuspended(false); };

Kilim A

Thanks for answering me.

 I hope you will not go a far from here.

 1. From your answer - I see problem with mA when screen off - into Construct 2 ( it's js - I will share code  without minify script).

Yes?

Cause I see  the similar problem here.

I don't know with C2 or not.

 

2. Could you give that links with thats advice ,pls, if it possible?- "They recommended to use the "cr_setSuspended" method in the following way instead of in "onVisibilityChanged":

function onBlur() { cr_setSuspended(true); };
function onFocus(){ cr_setSuspended(false); };"

 

Nafisul Islam Kiron

https://www.scirra.com/forum/losing-focus_t74080

Please check the comment by "mammouth31".

Armaan-Ul- Islam

"cr_setSuspended" method "onVisibilityChanged" didn't worked?

how is the app responding when you implement these functions:

function onBlur() {cr_setSuspended(true);};
function onFocus(){cr_setSuspended(false);};

Mark as answer
Armaan-Ul- Islam

Try pausing the app on screen state change.

function onScreenStateChanged(previousState, changedState) {
     
	 if(changedState=="SCREEN_OFF" || changedState=="SCREEN_DIM"){
		 cr_setSuspended(true);
		 //Or Go to the Event sheet and Add the following actions:
	 	 //- System -> Set time scale -> 0
	 }
	 if(changedState=="SCREEN_NORMAL"){
		 cr_setSuspended(false);
	         //- System -> Set time scale -> 1.0
	 }
 }

 tizen.power.setScreenStateChangeListener(onScreenStateChanged);

https://www.scirra.com/tutorials/646/advanced-game-pausing

Kilim A

Yes, This is above something similer.

 

 I made

//PAUSA
           function onScreenStateChanged(previousState, changedState) {
	        console.log("Screen state changed from " + previousState + " to " + changedState);
	        if (changedState=="SCREEN_OFF") {
	       cr_setSuspended(true);
	        } else if (changedState=="SCREEN_NORMAL"){
	       cr_setSuspended(false);
	        }
	      }

	      // Sets the screen state change listener.
	      tizen.power

 I share it before.
  But the posts disappear sometimes when sending.

 Thank you.

 

Another metod don't work in html ( with state)

Kilim A
//PAUSA
           function onScreenStateChanged(previousState, changedState) {
	        console.log("Screen state changed from " + previousState + " to " + changedState);
	        if (changedState=="SCREEN_OFF") {
	       cr_setSuspended(true);
	        } else if (changedState=="SCREEN_NORMAL"){
	       cr_setSuspended(false);
	        }
	      }

	      // Sets the screen state change listener.
	      tizen.power.setScreenStateChangeListener(onScreenStateChanged);