Languages

Menu
Sites
Language
Unable to schedule alarm for native service in hybrid app

Hello I am having a problem with a hybrid app I am developing for Gear/Galaxy watches (Tizen 3.0, Tizen 4.0). My app consists of web app with UI and a native service. I package them together.

 

In the UI app, when I start the service with this code:

tizen.application.launchAppControl(
            new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/service"),
            "o647BNWshs.serviceelement",
            function() {
                console.log(" service started");
            },
            function(e) {
                console.error("service failed to start: " + e);
            }
    );

 

It starts correctly (I can see the logs from the service in dlogutil). However, when I try the schedule a service start via the Alarm API:

 

var appId = "o647BNWshs.serviceelement";
var appControl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/service", "check");
 
var alarm = new tizen.AlarmRelative(60);
tizen.alarm.add(alarm, appId, appControl);

 

I get an exception: UnknownError: Error while add alarm to server.

 

When I put other appId in this code, for example the Id of the web UI app or Id of some other app which is present on the watch, the alarm is scheduled correctly, there is no exception and the app is launched after one minute. Only when I try to schedule the start of the native service from the same hybrid package, I get the exception.

 

Does anybody have an idea what I am doing wrong? I think it should be possible to schedule the service to run in background after some time?

Responses

1 Replies
Maciej

After further investigation, I have found out that my code works correctly on Gear S2 (Tizen 2.3) and on Galaxy Watch (Tizen 4.0). The alarm gets added and after 60 seconds, the native service is launched.

Only on Gear S3 with Tizen 3.0 it fails. It is not possible to add an alarm for the embedded native service, there is UnknownError: Error while add alarm to server.

Any suggestions?