Languages

Menu
Sites
Language
How to get event paired phone with gear or no using web app as event listener? in 2.3+ API

How I can check paired or no in that moment phone with gear
with web app with event listener?
2.3+ API

Thank You

Responses

1 Replies
Armaan-Ul- Islam

You may check out the Samsung Accesory SDK Samples > Accessory > Samples (Web)  for example

var SAAgent;
function onsuccess(agents) 
{
   SAAgent = agents[0];
   for (var i = 0; i < agents.length; i++) 
   {
      console.log(i + ". " + agents[i].name);
      /* Process the SA agents */
   }
}

webapis.sa.requestSAAgent(onsuccess, onerror);
function ondevicestatus(type, status)
{
   if (status == "ATTACHED")
   {
      console.log("Attached remote peer device: " + type);
      SAAgent.findPeerAgents();
   }
   else if (status == "DETACHED")
   {
      console.log("Detached remote peer device: " + type);
   }
}

webapis.sa.setDeviceStatusListener(ondevicestatus);

Also the Tutorial in Tizen Studio > Help > Samsung Extension for Wearable Web> SAP