언어 설정

Menu
Sites
Language
Samsung Gear S - post toa URL with PUT method

Hi,

 

I wonder if it is possible to post  toa URL in Samsung Gear S.

Could anyone help me with an example ?

Btw, I am not looking for a method utilizing  accessory protocol. I would like to access web url directly.

Thanks.

 

Responses

11 댓글
Sanjeev BA
https://developer.tizen.org/dev-guide/2.2.1/org.tizen.web.appprogramming/html/guide/w3c_guide/comm_guide/xmlhttprequest.htm
mekabe remain

Thank you. Actually I tried that but I didn2t see any IP packets going out from my Gear S.

So, I have a few questions to understand what I am doing wrong:

1. Would this work on a Samsung Gear S ? (it has internet access through wifi interface and/or bluetooth access to a mobile phone connected to internet)

2. Should I access a specific privilege for this to work ?

 

thanks.

AVSukhov

Hello,

According Release Notes (from SDK 1.0.0b3) the following Web APIs and features have been added:

Network access including XHR, Web Socket, and Web page access through, for example, hyperlinks.

 

For more info please see documentation in IDE.

mekabe remain

where can I find that documentation ?

 

Thanks.

 

mekabe remain

I read the IDE documentation but I can't find the correct way of doing this.

 

As far as I see, I need feature:

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

And privilege:

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

 

I added them tomy config.xml

Then I add following 3 lines to my js file.

var client = new XMLHttpRequest();
client.open("GET", "http://88.1.1.1/api/", true);
client.send();

Then I run the app , but I don't see any packets coming to my internal host 88.1.1.1

After the above lines , I draw a character on the screen to check if my app reaches that point, and I see that character. 

So why doesn't  it try to access 88.1.1.1 ?

 

Btw, on all the examples I see about XMLHttpRequest , there is no ip address and http://  in the parameter. of open method. They seem to be calling local files.

maybe that's not the correct mathod ?

I need help desperately. Thx.

 

 

mekabe remain

the problem is solved after I add the following line to my config.xml:

 

    <access origin="http://192.168.254.252" subdomains="true"/>

So, shall I have to add all URLs that I need to access ?

Why can't I find it in any documentation ? Is there an easier way ?

 

thx

AVSukhov

Yes, you need add access for all external resources, or you can use:

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

mekabe remain

now I have another problem.

If I do this when the watch is connected through wifi , it works always.

When I change to bluetooth connection (to the phone) and disable wifi on  Gear S , it works on for the first time. Then it doesn't work.

When I analyze on the remote side, I see that on bluetooth connection Gear S sends http request once, then it doesn't send any packet.

It seems to be something about binding to the wifi interface and not allowing to access network over bluetooth.

How can I solve this ?

 

Sanjeev BA

You can refer to the following policy guideline.

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.mobile.web.appprogramming/html/app_dev_process/accessing_external_network_resources.htm

Set the allow-navigation and access origin parameters.

Maybe this could allow all domains.

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

Plus

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

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

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

Haven't verified it though.

mekabe remain

Thanks.

But what about the bluetooth problem ?

 

mekabe remain

everything seems correct.

but when I  use bluetooth connection, only first message is sent with an Ip packet. 

The second message doesn't even appear.

 

When I get a network capture, I see that packets over bluetooth are larger. But that shouldn't be a problem?