언어 설정

Menu
Sites
Language
Need help running a service app on wearable device
(Please note that since the forum software doesn't allow "external links", I've had to modify all the bits to be http:|| with pipes instead of forward slashes. They are correct in the relevant XML/JS code.)
 
I'm trying to get a service app running on a Samsung Gear S2 (SM-R720 with firmware R720XXU2AOJ5) with Tizen Wearable SDK 2.3.1. I have been trying to follow the semi-guide at <developer.tizen.org/dev-guide/wearable/2.3.0/org.tizen.wearable.web.appprogramming/html/tutorials/service_tutorial/service_app_tutorial.htm> without success.
 
I began with an already-working JS-based GUI app. Based on the link above, I did the following:
 
- Added a <feature> element to the config.xml:
 
    <feature name="http:||tizen.org/feature/web.service"/>
 
- Added two <tizen:privilege> elements to the config.xml:
 
    <tizen:privilege name="http:||tizen.org/privilege/application.info"/>
    <tizen:privilege name="http:||tizen.org/privilege/application.launch"/>
 
- Added a <tizen:service> element to the config.xml:
 
    <tizen:service id="DFXHyIJESe.GearWebService" auto-restart="true" on-boot="true">
        <tizen:content src="service/service.js"/>
        <tizen:name>GearWebService</tizen:name>
        <tizen:icon src="service/service_icon.png"/>
        <tizen:description>Web Service Application Template</tizen:description>
    </tizen:service>
 
Note: the <tizen:application> element already looks like this:
 
    <tizen:application id="DFXHyIJESe.GearClientApp" package="DFXHyIJESe" required_version="2.3.1"/>
 
- Added a service/service.js file, essentially the same as the guide. (Excerpts below.)
 
I have been trying to ways to launch the app. The first uses tizen.application.launchAppControl as per the guide:
 
    var onLaunchAppControlSuccess = function() {
        console.log("launchAppControl succeeded.");
    };
    var onLaunchAppControlError = function(e) {
        console.log("launchAppControl error: Name: " + e.name + ", Message: " + e.message);
    };
    var SERVICE_APP_ID = "DFXHyIJESe.GearWebService";
    var appControl = new tizen.ApplicationControl("http:||tizen.org/appcontrol/operation/service");
    try {
        console.log("Launching app control for ID " + SERVICE_APP_ID);
        tizen.application.launchAppControl(appControl, SERVICE_APP_ID, onLaunchAppControlSuccess, onLaunchAppControlError);
    } catch (e) {
        console.log("Exception with launchAppControl: Name: " + e.name + ", Message: " + e.message);
    }
 
Results in this error message:
 
    launchAppControl error: Name: NotFoundError, Message: given package is not found
 
 
I've also tried it a second method, using tizen.application.launch:
 
    var onLaunchSuccess = function () {
        console.log("Service launched successfully.");
    };
    var onLaunchError = function (error) {
        console.log("Failed to launch: " + JSON.stringify(error));
    };
    var onGetAppsContextSuccess = function (contexts) {
        console.log("Checking for service...");
        var serviceAppFound = false;
        console.log("Looking for service ID " + SERVICE_APP_ID);
        for (var i = 0; i < contexts.length; i++) {
            try {
                var appInfo = tizen.application.getAppInfo(contexts[i].appId);
                console.log("AppInfo " + i + " ID: " + appInfo.id);
                if (appInfo.id === SERVICE_APP_ID) {
                    console.log("Service running.");
                    serviceAppFound = true;
                    break;
                }
            } catch (e) {
                console.log("Exception with getAppInfo: " + e.message);
            }
        }
        if (serviceAppFound) {
            console.log("Service running.");
        } else {
            console.log("Service not running.");
            try {
                console.log("Launching [" + SERVICE_APP_ID + "]...");
                tizen.application.launch(SERVICE_APP_ID, onLaunchSuccess, onLaunchError);
            } catch (e) {
                console.log("Exception with launch: " + e.message);
            }
        }
    };
    try {
        tizen.application.getAppsContext(onGetAppsContextSuccess, onGetAppsContextError);
    } catch (e) {
        console.log("Exception with getAppsContext: " + e.message);
    }
 
Results in:
 
Checking for service...
Looking for service ID DFXHyIJESe.GearWebService
AppInfo 0 ID: com.samsung.w-home
AppInfo 1 ID: com.samsung.watchface
AppInfo 2 ID: org.tizen.data-provider-slave
AppInfo 3 ID: com.samsung.shealth.widget.pedometer
AppInfo 4 ID: com.samsung.w-calendar2.widget.monthly
AppInfo 5 ID: com.samsung.weather-widget
AppInfo 6 ID: com.samsung.w-music-player.widget
AppInfo 7 ID: com.samsung.w-music-player.music-control-service
AppInfo 8 ID: com.samsung.shealth-service
AppInfo 9 ID: health-data-service
AppInfo 10 ID: com.samsung.wusvc
AppInfo 11 ID: com.samsung.message.consumer
AppInfo 12 ID: com.samsung.watchface-service
AppInfo 13 ID: com.samsung.clocksetting
AppInfo 14 ID: dbox.web-provider
AppInfo 15 ID: com.samsung.w-gallery.consumer
AppInfo 16 ID: DFXHyIJESe.GearClientApp
Service not running.
Launching [DFXHyIJESe.GearWebService]...
Failed to launch: {"code":0,"name":"UnknownError","type":"UnknownError","message":"unknown error"} 
 
Can anyone help me get a simple, JS-based service running on this Tizen 2.3 wearable device?
 
Thanks!

Responses

18 댓글
Shinjae Lee

Hi. As far as I understood, JS service app is optinal feature. Thus in S2, web service app is not supported.

You can try hybrid (Web UI + native service) or native for background support.

Hope this helps.

Thomas Hauk

Is there an example showing a native service (written in C) exchanging data with a Web UI app (written in JS)?

AVSukhov

Web part:

https://developer.tizen.org/development/sample/web/Hybrid/Hybrid_Web_App

Native part:

https://developer.tizen.org/development/sample/native/AppFW/Hybrid_Service

Marco Buettner

To exchange data between native service and web app you can use the MessagePort API

AVSukhov

Hello,

Agree with Shinjae Lee comment, you can use hybrid app:

https://developer.tizen.org/community/tip-tech/packaging-hybrid-application

http://infidea.net/tizen-hybrid-app-tutorial/

Thomas Hauk

The first link is incomplete, although I followed it as closely as possible. For example, you can't build the package until you switch the hardware target to ARM 7. Perhaps this link describes a process that works only on the x86 emulator?

The second link is also incomplete, and also almost a year old. The steps do not work for me. Much like with a JS-based service, the native service doesn't seem to be running when the JS-GUI app is running, nor can the JS-GUI app launch the native service (I get the same error messages as my original post).

As a reminder, I am trying to get a service running on an actual Gear S2 hardware device. I am not using an emulator at all.

Marco Buettner

But did u try your code on Emulator? Does it works there?

Thomas Hauk

I don't care about the Emulator; the code must run on a Samsung Gear S2 hardware device.

I'm beginning to think that is it not possible to run a service with the wearable profile on hardware.

Has anyone successfully managed to do that?

Marco Buettner

....

Barun Rajput

Hello,

Any updated on this issue, has anyone found a way to make it work?

I am also getting same error on Gear S2 (SM-R720)

D PKGMGR_INFO: pkgmgrinfo_appinfo.c: pkgmgrinfo_appinfo_get_appinfo(1713) > [SECURE_LOG] Appid[x8Ma0WwKVo.service1] not found in DB
D PKGMGR_INFO: pkgmgrinfo_pkginfo.c: pkgmgrinfo_pkginfo_get_pkginfo(1005) > [SECURE_LOG] pkgid[x8Ma0WwKVo.service1] not found in DB
E CAPI_APPFW_APP_MANAGER: app_manager.c: app_manager_error(77) > [app_info_create] No such application(0xfeef0001)

Peter Hulst

Has anyone been able to get this to work on a Wearable S3? 

According to the docs here

https://developer.tizen.org/ko/development/guides/web-application/application-management/applications/service-application#launch

this should now work on 'Tizen 2.3.1 and Higher for Wearable'. I'm using a partner level certificate. In the emulator, it is able to start the service just fine, but not on the actual device. 

thanks

Peter

 

André Reus

Partner Level Certification is not needed for Gear S3 as it is Tizen 2.3.2 version. 

André Reus

hi Thomas Hauk

Web service application requires partner-level certification in Tizen 2.3

Peter Hulst

Ok, well I did not have partner level certification first, but it would throw an error on deployment to the device, when I tried to include a background service. 

Now, I do have partner level certification. The app will deploy now, and the background service runs fine on the emulator. Not on the actual device though. There, I get the error "given package is not found" 

André Reus
 

 

It seems your problem is different.  so post it on separate thread to find your post helpful! 

Telmo Agostinho

Him did anyone got this working?

André Reus

No ! 

Telmo Agostinho

I've found this answer: 

Even tho you can create a parner level certificate on your computer to develop apps, you cannot run those apps on commercial samsung devices unless you are a registered partner developer at Samsung. http://developer.samsung.com/gear/develop/getting-certificates/create.

On this thread:
https://developer.tizen.org/ko/forums/web-application-development/gear-s3-web-service. 


Don't know if anyone can relate