Languages

Menu
Sites
Language
GEAR2: Tutorials/documentation on events

Hi everyone,

I have a comment on Tizen Wearables that I am sure most of us would agree with: Tizen team haven't provided sufficient documentation for Tizen Wearables SDK. There is some stuff in the Help files, but if we compare that to Android documentation for example: no where close!

I wish the Tizen team provides some documentation (more elaborate write-up, more tutorials) on the VERY simple topics in UI interaction. I am specifically interested in how Events are created (they are used in the samples, but one needs to understand if you guys follow some design pattern, standards, etc?)

I wish people keep on asking more and more "basic" questions on this thread!

 

Sherif

Edited by: Sherif Tawfik on 10 May, 2014

Responses

9 Replies

Your problem is that you need to understand HTML5 and javascript frameworks. For example, if you know jQuery Mobile you would create UI and thier events otherwise you need to just undertand javascript

Documentation won't teach javascript but yes lack examples. You need to spend some effort to make tizen app while you can copy/paste many of Android app code from the net or the documentation

One reason why I don't code many Android apps cause I don't understand parts of my own code :)

Pick a jQuery Mobile tutorial and start coding .. If you want more OOP framework go for Sencha Touch (complex - needs effort to learn). Otheriwise learn Javascript HTML5 deeply an look at Tizen App examples that come with the SDK

 

Good Luck

 

 

 

 

Sherif Tawfik

Thanks Nour, though I was not asking about the programming environment. My question was on the availability of more sample code to cover more SDK features (aside from JavaScript/HTML5). Anyways, this will evolve as more people chime in. By the way, you don't need to copy/paste in Android because the API reference is very sufficient if you know Java well.

Sherif

Marco Buettner

Tizen for Wearables SDK is a beta at the momemt... I think we will see more features with further updates :)

Stefano Accorsi

This is sooooooo true Sherif. I too am stuck trying to find a way to use events with Tizen for wearable. I read everything about this new SDK, even a free books on Tizen, but still can't figure out how to link a function to the click of a button. I found out that the "classic Tizen" way don't work since I tried:

 

$('#inlineBtn').bind("click", function(e) {
    alert("Hey!");
});

but, at runtime, I got this error:

js/app.js (15) :TypeError: 'undefined' is not a function (evaluating '$('

And even:

$(document)

fired the same error...

I'll read any advanced Tizen book if it helps (by the way I found this one that seems great: http://www.amazon.com/Appcelerator-Titanium-Business-Application-Development/dp/1849695342/ref=cm_cr_pr_product_top) ... but for now I can't find anything about Tizen wearable that, a part from the variuous "Hello Gear" or "Introduction to SDK for wearable" videos, could let me develop a full app.

TY

Stefano Bennati

I agree!

Besides that the available tizen documentation is not compatible with wearables:

I'm developing an app that uses the gyroscope and I wasn't able to make it work yet because some features are not implemented (i.e. device orientation events in the WebAPI), some privileges have been changed (i.e. /privilege/X instead of /api/X) and because of some difference in the implemented features between the simulator and the emulator.

Also the IDE lacks some useful features, for instance the Event Injector functionality that I need to inject orientation events, as rotating the emulator does not fire them automatically.

I'm not asking for a full-fledged Android-style documentation, a simple list of differences between the tizen and the wearables api will be enough. That list will have avoided me wasting a day changing some correct code that does not work because some features have not been implemented yet.

Best,

Stefano

Marco Buettner
I'm using always this
$(document).on("click", "#inlineBtn", function(e) {
    alert("Hey!");
});

Dont forget to include tau-lib or tizen-lib to your project

Stefano Accorsi

Ok since it still doesn't work (but thank you so much Marco!!) ... I suppose I'm missing something. I created a base web app, and added something like this in the index.html file:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
    content="width=device-width, initial-scale=1, user-scalable=no" />
<title>Wearable UI</title>
<link rel="stylesheet" href="lib/tau/themes/default/tau.css">
<!-- load theme file for your application -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
	<div class="ui-page">
		<header class="ui-header ui-has-more">
			<h2 class="ui-title">Hello!!</h2>
			<button type="button" onclick="test();"
				class="ui-more ui-icon-overflow">More Options</button>
		</header>
    </div>
</body>
<script type="text/javascript" src="lib/tau/js/tau.js"></script>
<!-- load javascript file for your application -->
<script src="js/app.js"></script>
<script src="js/lowBatteryCheck.js"></script>
</html>

as you read I tried an "onclick" and it works ... but what I can't do is adding and handler programmatically. So, consider the "onclick" gone, the code in the app.js is only what you wrote in the last post, and I get the same error ...

js/app.js (15) :TypeError: 'undefined' is not a function (evaluating '$('

 

Thijs Mergaert

Hi Stefano,

You'll need to include jQuery in your project as well for that.  Trust me when I say that learning to use jQuery will be a worthwhile investment if you're planning to develop HTML5/JavaScript applications :)

Thijs

Stefano Accorsi

Thank you Thijs I was ... beginning to suppose it :D

I don't know anything about jQury ... well I'll start to study it. TY again.