Languages

Menu
Sites
Language
clickable text is not working.

I have a simple code that when clicked, is supposed to laucnch the messaging app on my watch 
Could someone please advise why my code is not working?
what am I missing??

 

This is my index.html code:

<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="css/style.css">
  <script src="js/main.js"></script> 

</head>
<body>
   <div id="page" >    
  		<p id="para">Launch Messaging</p> 
   </div>

 </body>
</html>

 

This is my main.js code:

(function() {

function launchApp() {tizen.application.launch("com.samsung.message");}

function init() {
   window.getElementById('page').addEventListener('click', launchApp);
   }

  // Launch messaging app
  window.onload = init();

}()); 
 
Edited by: Rich Mabb on 16 Jun, 2019

Responses

5 Replies
Rich Mabb

Hello...Is this forum still active?

any suggestions are apreciated

Marco Buettner

Maybe use try-catch block... maybe you get exception?

Or try to list of all installed application ids... maybe the ID com.samsung.message is wrong?

Rich Mabb

Hi Marco,

 

How do I get a list of all intstalled apps ids?

 

 

Marco Buettner
function onListInstalledApps(applications)
{
  for (var i = 0; i < applications.length; i++)
  {
    console.log("ID: " + applications[i].id);
  }
}

tizen.application.getAppsInfo(onListInstalledApps);

You can use this.

Marco Buettner

And add onsuccess and onerror for better handling. So you got more details about the problem and also check if u setup the config.xml with http://tizen.org/privilege/application.launch on the privilegs.