언어 설정

Menu
Sites
Language
what am I doing wrong?

Im working on my first wearable tizen app for a galaxy gear 2. I get no internet access when I try to load a page. I cannot start the emulator, it hangs (even if I leave it overnight) on booting the kernel. This works on the simulator as expected, its just a few lines of code. No matter how I try to open a page, I get a webpage not available screen or it just doesn't load. I changed the code to go to a test site and am not getting any requests from my server access logs. Am I missing something? My config.xml has the access origin in it, tried with google, and also with "*".  I have added every permission possible within my role. Below are my files.

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/REMOVED" version="1.0.0" viewmodes="maximized">
    <access origin="http://google.com" subdomains="true"></access>
    <access origin="*" subdomains="true"></access>
    <tizen:application id="REMOVED" package="REMOVED" required_version="2.2"/>
    <author href="http://I_dont_have_one.info" email="REMOVED">REMOVED</author>
    <content src="index.html"/>
    <tizen:content-security-policy>script-src 'self'</tizen:content-security-policy>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <icon src="icon.png"/>
    <name>HomeControl</name>
    <tizen:privilege name="http://developer.samsung.com/privilege/accessoryprotocol"/>
    <tizen:privilege name="http://tizen.org/privilege/content.read"/>
    <tizen:privilege name="http://tizen.org/privilege/content.write"/>
    <tizen:privilege name="http://tizen.org/privilege/download"/>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <tizen:privilege name="http://tizen.org/privilege/location"/>
    <tizen:setting background-support="disable" encryption="disable" hwkey-event="enable"/>
</widget>

main.js:


$(window).load(function(){
    document.addEventListener('tizenhwkey', function(e) {
        if(e.keyName == "back")
            tizen.application.getCurrentApplication().exit();
    });
});

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="A single-page template generated by Tizen Wearable Web IDE"/>

    <title>Tizen Wearable Web IDE - Tizen Wearable - jQuery</title>

    <script type="text/javascript" src="js/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    <link rel="stylesheet" href="css/style.css" />
</head>
<body>
  <div class=contents>
    <div data-role="content">
		<p >Foo</p>
		<p id="label">Status: UNKNOWN</p>
		<button id="btnLOn">On</button>
		<button id="btnLOff">Off</button>
		<br><br><br>  
		<p ><a href="http://www.google.com" target="_blank">test</a></p>
	</div>
  </div>
</body>
</html>

Thanks in advance.

Edited by: Cameron Julsrud on 24 4월, 2015
답변 바로가기

Responses

4 댓글
Marco Buettner

You forgot that the Gear 2 cannot established are internet connection, thats all. You must send the data from the Android device to the Gear via SAP.

Only Gear S can establish are internet connection without paired SAP/Android device

Cameron Julsrud

Well I knew that it was going to be something along those lines. All of the dev books you read about tizen don't work for wearables, are on the wrong ide, and dont mention sap. The Samsung gear site does not clearly state that the gear 2 doesn't have internet without sap anywhere that I can see. It is a very confusing process considering that the different ides and environments. The gear S is different in that matter obviously and that is the device I see most documented. So by my understanding is the SAP has to be used exclusively for communications, so any external hrefs or .get or .post requests are useless? I would need to do a SASocket.sendData(CHANNELID, "CMDHERE") for everything on the gear side and listen it on the android side with onReceive() and then manually retrieve that data with a stream and then send it back to the gear? That seems like a lot of work for something so simple. I'm rethinking this whole idea already.

Mark as answer
Marco Buettner

Exactly... You need to do all internet operation on the Android device and that the results to the Gear (2) over SAP. 

Cameron Julsrud
Thank you for your answers. To state the obvious this is an example of why there isnt many apps for tizen vs android wear. If im going to spend all day in an ide, I would rather just be in android studio. Not switching between two resource hogs manipulating data back and forth. Its funny how dead simple anything local is on the gear 2 but once you want something external, all hell breaks loose. Thanks again for your fast responses.