Languages

Menu
Sites
Language
Help

Please let me ask some questions about web applications on gear.

 

  1. How can I create web service application? (I didn’t understand anything from the tutorial) and give example if it is possible.
  2. How can I get partner certificate?
  3. How can I set notification icon and background? I tried this (https://developer.tizen.org/development/tutorials/web-application/tizen-features/user-interface/notification) and give me a working example if it is possible.
  4. How can I trigger the notification click event to make it open the application?

That’s All.

Appreciate you quick answer.

Responses

6 Replies
daniel kim

Hi,

You can communicate with Samsung through Seller site as below.

    http://seller.samsungapps.com/join/joinNow.as

*  If you are not registered as a partner with Samsung, please visit Customer Support at
http://help.content.samsung.com/csseller/ to request the partnership via 1:1 inquiry. Enter the
details of your featured application for our partnership review; we will notify you about the result via email in about 2 weeks.

 

If notification is not working in Gear S2, I would suggest you to use this rich notification sdk. You can create and send notification from android phone side to Gear device.

   http://developer.samsung.com/galaxy#rich-notification

Regards

AVSukhov

Hello,

Notification icon:

When creating the notification you can specify iconPath, soundPath, backgroundImagePath and etc.

As for displaying the notification responds the system cannot be used the path inside your project (for security reasons). Each Web application has its own private storage space that is not accessible to any other application. The path in the iconPath, soundPath,... parameters means a relative file location defined in the Filesystem API. According this, you can set iconPath, soundPath using relative file location:

For example, you can create ”assets” directory under your root project directory and add image (icon.png) to it, in this case, relative file location for iconPath will following:

“opt/user/apps/{packageId}/res/wgt/assets/icon.png”

where {packageId} - the application package identifier, specified in configuration file (config.xml).

and js code:

var notificationDict = 
{
   content: "This is a simple notification.",
   iconPath: "opt/user/apps/{packageId}/res/wgt/assets/icon.png"
};

Instead relative file location may be used virtual root location.

Each virtual root has a string name. Each file or directory within the virtual filesystem is addressed using a fully-qualified path of the form: <root name>/<path> where <rootname> is the name of the virtual root and <path> is the path to the file or directory relative to that root.

In this case you can use ”wgt-package” virtual root directory. This is the location for widget package which is read-only and has following relative location:

”opt/usr/app/{packageId}/res/wgt”

In this case, virtual root location for iconPath will following:

“wgt-package/assets/icon.png”

and js code:

var notificationDict = 
{
   content: "This is a simple notification.",
   iconPath: "wgt-package/assets/images/icon.png"
};

 

AVSukhov

Notification appId and appControl:

When creating the notification you can specify applicationId and applicationControl properties.

To launch app you can use explicit or implicit launch. Explicit launch uses application Id for launch, implicit uses application control (resolve information (operation, uri, ...) from it).

applicationControl property define application control to launch app when notification is clicked. (implicit)

applicationId property define the application ID to launch app when notification is clicked. (explicit)

For launch your own app you can use following ways:

1. Specify app control for notification:

var appControl = new tizen.ApplicationControl(
            "http://tizen.org/appcontrol/operation/my_app_operation",
            null,
            null,
            [] );
var notificationDict = {
       content : "This is a simple notification.", 
       vibration : true, 
       appControl : appControl};

var notification = new tizen.StatusNotification("SIMPLE", 
       "Simple notification", notificationDict);
            
tizen.notification.post(notification);

and export app control functionality to your app (config.xml):

<tizen:app-control>
        <tizen:src name="MyPage.html"/>
        <tizen:operation name="http://tizen.org/appcontrol/operation/my_app_operation"/>
    </tizen:app-control>

2. Specify app ID for notification:

var myappInfo = tizen.application.getAppInfo();

        var notificationDict = {
                    content : "This is a simple notification.", 
                    appId : myappInfo.id };
         
        var notification = new tizen.StatusNotification("SIMPLE", 
                    "Simple notification", notificationDict);
                         
        tizen.notification.post(notification);

 

AVSukhov

Partner certificate:

The problem is not to get a certificate, but in order to register as partner on Tizen Store.
The partner level privileges can only be used by developers registered as partners on the Tizen store.
The developer must be fully identified and permitted by the partner policy of the Tizen Store to use both public and partner level privileges.

And can be used by commerical registered sellers.

Without are "real" partner distributor certificate your application cannot run with Partner Privilegs on COMMERCIAL DEVICES. You can use the partner certificate patch but only in the Emulator and reference binary target. You cannot use the partner certificate patch on commercial devices. Hence, applications signed with this certificate cannot be installed on commercial devices. To install applications on commercial devices, develop applications only with public level privileges.

 

AVSukhov

Service app:

I have no ready sample, but algorithm similar to the following:

- create separate js file under your project folder (f.e. service.js)

- define 3 callbacks in this js file: onStart(), onRequest(), onExit()

onStart - invoked when your service is launched (usually message port creation for communication between app and service)

onRequest - invoked every time when incomming request is received

onExit - invoked when the service is stopped.

- export service to your configuration file (add tizeb:service tag to config.xml, service must have the same package name)

- for starting you can use AppControl functionality

- for terminating use Message port

- for communication between app and service - Message port

 

The only difficulty may occur with Message Port functionality (but then you just have to understand how it works) =)))

daniel kim

Hi,

I've shared a test code of service application for Gear S2. I think that you can refer to this code as well.

       https://drive.google.com/file/d/0BzgUeghcKkMIazhkYnZqUmtUMW8/view - MasterW

       https://drive.google.com/open?id=0BzgUeghcKkMIckkxaUthNVNRZE0 - SlaveW

Regards