언어 설정

Menu
Sites
Language
Ajax Responses are not working

Hi All,

I'm newbie in Samsung Galaxy Gear 2 app development. And I want to know what is the best way to get data from server to wearable device. As well as i've used AJAX function to get data. But there's problem with that function. 

There are two screens in my app. Both are working with AJAX function onload. First screen getting data perfectly. But second screen is not responding. Same code and same action with deference is URL. If i refresh the second screen it's working properly. Same as well now first screen is not responding. So can you help me to solve this problem. And please post me what is the best  way to get data from server. 

Here's full code.

<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
    content="width=320,height=320,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta charset="utf-8" />
<meta name="description" content="2015" />
<title>Sheadule</title>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
    $(document).ready(function() {		
		$.getJSON("URL.php?jsoncallback=?",
		function(data) {$('#loading').hide();
		$('#loading1').hide();

		document.getElementById("txtHint").innerHTML = data.gameSheadule;											
		});

		});
	</script>
<link rel="stylesheet" href="../lib/tau/themes/default/tau.css">
<link rel="stylesheet" href="../css/style.css">
</head>
<body>

    <div class="ui-page ui-page-active" id="main">
		<header class="ui-header">
			<h2 class="ui-title ui-icon"
				style="background-image: url(../images/icon.png);">Sheadule</h2>
		</header>

		<div class="ui-content content-padding">

			<div class="ui-processing" id="loading"></div>
			<div class="ui-processing-text" id="loading1">Please Wait..</div>

			<span class=content_text id=txtHint> </span>
		</div>

		<footer class="ui-footer ui-grid-col-2">
			<a href="index.html" class="ui-btn">Exit</a> <a
				href="index.html" class="ui-btn ui-color-orange">Home</a>
		</footer>
	</div>

	<script type="text/javascript" src="../../lib/tau/js/tau.js"></script>
	<script src="..js/lowBatteryCheck.js"></script>

</body>
</html>
 
Thank You.
 

Responses

2 댓글
Marco Buettner

The Gear 2 has no Internet Connection! You need a hostapp which connect to the server and sends data via SAP on your Gear

AVSukhov

Hello,

I agree with Marco Buettner. Gear 2 device does not have Internet access, so for access to external resources you need to use the paired device and SAP.