언어 설정

Menu
Sites
Language
About samsung gear s2 dial Development

I need to develop a Samsung gear s2 dial, dial also need to display weather information, which can be found in the development of data dial document. How do I start?

 

thanks

답변 바로가기

Responses

10 댓글
AVSukhov

Hello,

Could you please privide more info/requirenments/behavior/scenario?

or describe a problem that you are faced.

Сurrently not enough information to help you.

 

YONG LEI

gear s2 there are some already exist dial, I would like to develop their own application store to publish a dial, gear s2 can add use

daniel kim

Hi

As I can't find exact UI component what you've described, I would suggest you to check section changer instead.

        https://developer.tizen.org/community/code-snippet/web-code-snippet/how-scroll-section-using-bezel-gear-s2

Hope this will help you.

YONG LEI

hi

My English is not good, google translate,   I have now developed a gear s2 watch face, I want to display data on the watch face, the data from the server return json. How I want to do?

daniel kim

Hi,

I would suggest you to refer to XMLHttpRequest if your application will communicate with server in standalone mode.

    Help of IDE:  Guides > Web Application > W3C/HTML5/Supplementary Features > Communication > XMLHttpRequest Level 1 and 2

Hope this will help you.

YONG LEI

hi

I do not know where the problem, use web simulator test normal,  but use the samsung gear s2 device not.

 

config.xml

<?xml version="1.0" encoding="UTF-8"?>

<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/AnalogWatch" version="1.0.0" viewmodes="maximized">

    <tizen:application id="5MJICAxf7c.AnalogWatch" package="5MJICAxf7c" required_version="2.3.1"/>

    <tizen:category name="http://tizen.org/category/wearable_clock"/>

    <content src="index.html"/>

    <feature name="http://tizen.org/feature/screen.size.all"/>

    <feature name="http://tizen.org/feature/network.internet"/>

    <icon src="icon.png"/>

    <name>LeonWatch</name>

    <tizen:privilege name="http://tizen.org/privilege/internet"/>

    <tizen:profile name="wearable"/>

</widget>

 

index.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <meta name="description" content="Analog Watch" />

    <title>Analog Watch</title>

    <link rel="stylesheet" type="text/css" href="css/style.css" />

</head>

<body>

    <div id="bodyContainer">

        <div id="canvasContainer">

            <canvas id="myCanvas"></canvas>

        </div>

    </div>

      <script src="js/main.js"></script>

</body>

</html>

 

main.js

var xmlHttp;

function createXMLHttpRequest(){

    xmlHttp = new XMLHttpRequest();

}

 

function startRequest(){

    createXMLHttpRequest();

    try {

        xmlHttp.onreadystatechange = handleStateChange;

        xmlHttp.open("GET", "http://api.k780.com:88/?app=weather.future&weaid=1&&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json", true);

        xmlHttp.send(null);

    }catch(exception) {

        alert("xmlHttp Fail");

    }

}

 

function handleStateChange(){

    if(xmlHttp.readyState == 4){

        if (xmlHttp.status == 200) {

            alert("here not alert");

        }

    }

}

 

Mark as answer
daniel kim

Hi,

I think that you need an access property like as below in config.xml

      <access origin="*" subdomains="true"/>

I would suggest you to check below help page of ide.  

     Getting Started > Web Application > Application Development Process>Setting Project Properties

Regards

YONG LEI

it's work ,  thanks

Seoghyun Kang

Hello,

 

As daniel kim's comment, you need to modify the config.xml if you want to use the internet in your application.

 

1. Add the privilege at the config.xml

<tizen:privilege name="http://tizen.org/privilege/internet"/>

 

2. Add the access options at the config.xml

<access origin="*" subdomains="true"></access>

or

<access origin="<<Your Domain>>" subdomains="true"></access>

 

Thanks.

YONG LEI

it's work ,  thanks