Wearable service application

Wearable service application

BY 25 Sep 2015 Web Application Development

I’m developing an application for wearable profile that needs a background service to continuously scan for BLE devices.

In order to accomplish this task, I followed the Web Service Application Tutorial (https://developer.tizen.org/dev-guide/wearable/2.3.0/org.tizen.wearable.web.appprogramming/html/tutorials/service_tutorial/service_app_tutorial.htm), but I’m unable to start the background service.

This is my “config.xml” file:

<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/BLEService" version="1.0.0" viewmodes="maximized">
    <tizen:application id="ZnSj5gyAXW.BLEService" package="ZnSj5gyAXW" required_version="2.3"/>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <icon src="icon.png"/>
    <name>BLEService</name>
    <tizen:profile name="wearable"/>
    <tizen:setting background-support="enable" encryption="disable" hwkey-event="enable"/>
    
    <tizen:service id="ZnSj5gyAXW.service" auto-restart="true" on-boot="false">
      <tizen:content src="js/service.js"/>
      <tizen:name>BLEService</tizen:name>
      <tizen:icon src="icon.png"/>
      <tizen:description>[BLEService]</tizen:description>
   </tizen:service>
</widget>

and this the “service.js” file:

module.exports.onStart = function()
{
    console.log("onStart");
}

module.exports.onRequest = function()
{
	console.log("onRequest");
}

module.exports.onExit = function()
{
	console.log("onExit");
}

From another application I’m trying to launch the service via this method:

tizen.application.launchAppControl
(
     new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/service"),
     "ZnSj5gyAXW.service",
     function() {box.innerHTML = "Launch Service succeeded"; },
     function(e) {box.innerHTML = "Launch Service failed : " + e.message;}
);

Both the applications seem to run correctly, but I receive this error: 

Launch Service failed : given package is not found

and the service’s log are not printed out. Could you please help me to understand what is wrong?

Written by