Languages

Menu
Sites
Language
Gear S3 Web Applicaiton - on re-launch first screen touch ignored

Hi There,

I'm writting a web application  for the Gear S3. On wrist up i am relaunching my application so it displays in the foreground. I noticed after the relaunch that the first touch on the screen is ignored so my applicaiton seems non responsive. Has anyone else had this issue or am i doing something wrong? I've noticed this happens on some other web apps that i've downloaded also. Any Ideas?

Launch code below...

  tizen.power.setScreenStateChangeListener((prevState: string, currState: string) => {
        if (currState === 'SCREEN_NORMAL' && prevState === 'SCREEN_OFF') {
          //when screen woke up
          let app = tizen.application.getCurrentApplication();
          tizen.application.launch(app.appInfo.id, () => {
   

 

Responses

1 Replies
Armaan-Ul- Islam

Hello Devron Blatchford,

I deployed a sample application on my Samsung Gear S2 following your approach of setting ScreenStateChangeListener and launch.

I cannot but appreciate, Your Idea seems pretty smart.

 

Anyways, But the matter is I didn't faced any first touch ignored issue. My code sample: (started from New> Template > BasicUI)

window.onload = function () {
    // TODO:: Do your initialization job

    // add eventListener for tizenhwkey
    document.addEventListener('tizenhwkey', function(e) {
        if(e.keyName === "back") {
    		try {
			    tizen.application.getCurrentApplication().hide();
			} catch (ignore) {
			}
		}
	});

    // Sample code
    var textbox = document.querySelector('.contents');
    textbox.addEventListener("click", function(){
    	var box = document.querySelector('#textbox');
    	
    	 tizen.power.setScreenStateChangeListener( function(prevState,currState){
    	        if (currState === 'SCREEN_NORMAL' && prevState === 'SCREEN_OFF') {
    	          //when screen woke up
    	          var app = tizen.application.getCurrentApplication();
    	          tizen.application.launch(app.appInfo.id);
    	        }
    	 });
    	 
    	box.innerHTML = (box.innerHTML === "Basic") ? "Sample" : "Basic";
    });
    
};

And my config.xml:

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

Please make sure you have enabled background-support.

Please check you Application Launch Success Callback, May be something is making first touch to be ignored in the appLaunch Success Callback.