How to start with Samsung Gear development

Submitted by Pavol Šatala on Monday, Dec 01 2014

In the last fifty years, computers have become smaller and faster. Look at your smartphone! Do you know, that your smartphone has about 5500-times faster processor than the farthest human-made object - Voyager 1 (19 530 540 265 km from the Earth)? Except for the performance, the size of the computers is also much smaller than it was before. This allows computers to become an integral part of human lives. Today probably every one of us, who is reading this article, has at least one smartphone (a small version of a computer). We use smartphones for routine activities such as reading e-mail, text messages, calls, checking sport results or playing games.

Wearables

Wearables are the next step in computer personalization. Thanks to technical progress, computers can be shrunken down to fit inside a watch or glasses. Officially, wearables are a miniature electronic device that is worn by the owner under, with or on top of their clothing. They are not designed to replace laptops or personal computers. They provides less information, which is focused directly on the user, his interests, his location, etc… The information is displayed directly on the user’s wrist (watches) or in front of his eyes (glasses). Location directly on the user’s body allows managing the user’s health, like data on his heart rate or number of steps. It provides a wide range of application in the fitness area.

Gear 2 / Gear S

Gear 2 / Gear S

Samsung Gear 2 and Samsung Gear S are smart watches from one of the largest companies in the smartphone industry - Samsung. Gear 2 is about a year-old model, with a 1.65” display (320x320px). Gear S is the latest and a larger model, which is enhanced by GPS, barometer, light and UV sensors. Gear S also contains a SIM card slot. Both models have a CPU with two cores running at 1GHz and 512MB of RAM. The fast and reliable hardware runs Tizen OS.

Tizen OS

Tizen OS is an operating system based on Linux. It has been designed for many various devices such as Smartphones, TVs, Cameras, etc. Presently it is used mostly (and probably only) on Samsung’s smart watches (Gear 2 and Gear S)

From web to waerable

Do you wonder why we mentioned web development at the beginning of this article? Simple. Almost every web developer knows HTML (HTML 5) and Java Script languages. And these are exactly those languages, which are used for the development of Tizen. Tizen apps look almost like web page.

Let’s make the first app

First and foremost, you need to download Tizen SDK for Wearables (link: http://developer.samsung.com/gear). The Tizen IDE is based on Eclipse. We believe this you are already acquainted with this.

We will show you how to create the basic hello world application for Gear.

1) Go to File -> New -> Tizen Waerable Web Project

2) In the following dialog window select the type of application (We will use Basic application), project name and location

New Project wizard

3) In the Solution explorer window you can now see the project with some pre-generated files. Did you say: “It looks like web page!”? Yes, it does!

4) Clear the project of “Basic application”

second

1) index.html is a basic HTML 5 page

2) css/style.css is an ordinary css file with some pre-generated styles. The file is already imported into index.html

3) js/main.js is a Java script file. This file contains part of the code, which provides basic functionality based on Tizen Wearable Java script SDK. The only important part of the onLoad function is

// add eventListener for tizenhwkey
document.addEventListener('tizenhwkey', function(e) {
if (e.keyName == "back")
    tizen.application.getCurrentApplication().exit();
});

This part of the code closes the application when the user presses the back button. The rest of the method can be deleted. This is only a sample code :)

4) The only file, which you do not know from web pages is config.xml. It is a xml file with some basic settings needed for the application. It is a large xml file, but you can simply modify it via an editor. Here you can set parameters like Application identifier, name, icon or permissions.

5) So in order to create a hello world program, go to index.html and rewrite Basic to Hello World. Yes, that’s it ;)

To test your application, open the emulator manager from Connection explorer window. In the manager click Add new. Type in name, select resolution and click confirm. Then start a new emulator. When the emulator boots correctly, it appears in Connection explorer. Then you can run your application.

Connection explorer window

NOTE: If your PC crashes when you start the emulator, disable both: GPU and CPU VT options in the Emulator manager of your emulator.

Summary

Is it easy? Yes it is. You do not need to know any low level programing language to develop applications for one of the most personalized devices around. If you have already made some web pages, you will be able to make applications for Samsung Gear.

Next, if I will have some time, I will write something about easy game and Localization.