语言

Menu
Sites
Language
Converting Sample Tizen Apps to work on Gear Fit 2

I'm a beginner level trying to develop a Gear Fit 2 App for my own use (not for sale in App Store)

Can any of the Tizen Studio wearable Samples be converted to work on GF2? I'm particularly interested in the compass and weather samples!

 

If yes,

  1. Where and what in the code do I need to change?

  2. How can I resize the app to fit on the GF2 screen?

Any advise greatly appreciated!

 

-R

 

 

 

 

 

编辑者为: Rich Mabb 16 1月, 2017

响应

8 回复
Slawek Kowalski

I think you can use samples for Gear S2. The same TizenOS version, similar capabilities.

But you will have to change screen layout from 360x360 to 432x216.

Theres are a lot of tutorials on Samsung developer site. Try to analyse one or tow to learn how to design simple UI for Gear series.

 

 

Rich Mabb

 

I created an emulator with 216X432 resolution. However that by itself did not help.

 

For example:

The native calculator sample app is designed for the circle UI, When I run it, only part of it get displayed on the emulator's screen (216X432).

Where in the code (what file?) do I change the screen layout/resolution?

Thanks!

Rich Mabb

Any advise on this matter is greatly appreciated..!!

 

Slawek Kowalski

You have to rebuild this layout. Change to 432x216. I assume you are familar with HTML and CSS and

have some experience in JavaScript apps developing. 

Armaan-Ul- Islam

I haven't seen Tizen Studio giving the opportunity to create custom size emulator, its just some rigid resolutions. So I don't think you would be able to create emulator for Gear fit2 using Tizen studio yet. (There is a emultor for gear fit2 in Gear Watch Designer to design watch face).

 

But I would suggest to create new project for gear 2.3.1 (square- not circle), it will give you a better start.

You may try changing  width,height in config.xml file. like:

<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/SensorBall" version="2.2.0" height="432" width="216" viewmodes="fullscreen">

 

I agree with Slawek Kowalski, you may focus on HTML and CSS to develop for desired screen size.

Gabor Ondi

The 216x432 emulator working correctly in WebApp mode, but in Native doesn't work. It will produce what you wrote down - Rich.

Use dedicated size and position for UI elements - in Native mode with 360x480 emulator.

I have not been able to program sensors in native mode.

Armaan-Ul- Islam

As you said, " I have not been able to program sensors in native mode. " that means you wrote code to read sensor data but it is not giving output in Gear Fit2, right ?

If yes, then is the code working on general Tizen emulators?

Gabor Ondi

I was wrong. I found an example of what works on emulator and on GF2.

https://developer.tizen.org/community/tip-tech/accessing-heart-rate-monitor-hrm-sensor-data-native-applications?langswitch=en

The sample is heart rate monitor.

1. Press "Start" button on display.

2. Waiting for ~10sec.

3. The first measurement result arrives.

This is my gf2 capability:

c:\tizen-studio\tools>sdb capability
secure_protocol:disabled
intershell_support:enabled
filesync_support:pushpull
usbproto_support:enabled
sockproto_support:enabled
rootonoff_support:disabled
zone_support:disabled
multiuser_support:disabled
syncwinsz_support:disabled
can_launch:unknown
sdbd_rootperm:disabled
device_name:Gear Fit2 (4718)
cpu_arch:armv7
profile_name:wearable
vendor_name:Samsung
platform_version:2.3.1.10
product_version:unknown
duid:2.0#*********************************=

sdbd_version:2.2.25

This is the part of log with Tizen Studio:

08-07 19:44:56.121 : DEBUG / sensor ( 22583 : 22583 ) : HRM is supported
08-07 19:44:56.121 : DEBUG / sensor ( 22583 : 22583 ) : Number of sensors: 1
08-07 19:44:56.131 : DEBUG / sensor ( 22583 : 22583 ) : sensor_get_default_sensor
08-07 19:44:56.146 : DEBUG / sensor ( 22583 : 22583 ) : sensor_create_listener
08-07 19:44:56.146 : DEBUG / sensor ( 22583 : 22583 ) : Minimum interval of the sensor: 1
08-07 19:44:56.146 : DEBUG / sensor ( 22583 : 22583 ) : sensor_listener_set_event_cb
08-07 19:44:56.146 : DEBUG / sensor ( 22583 : 22583 ) : sensor_listener_set_accuracy_cb
08-07 19:44:56.146 : DEBUG / sensor ( 22583 : 22583 ) : sensor_listener_set_intervals
08-07 19:44:56.146 : DEBUG / sensor ( 22583 : 22583 ) : sensor_listener_set_option
08-07 19:44:56.156 : DEBUG / sensor ( 22583 : 22583 ) : sensor_listener_start
08-07 19:44:56.191 : DEBUG / sensor ( 22583 : 22583 ) : 0,000000
08-07 19:44:56.191 : DEBUG / sensor ( 22583 : 22583 ) : Sensor name: PPS960
08-07 19:44:56.191 : DEBUG / sensor ( 22583 : 22583 ) : Sensor vendor: TI
08-07 19:44:56.191 : DEBUG / sensor ( 22583 : 22583 ) : Sensor type: Heart Rate Monitor sensor (Since Tizen 2.3.1)
08-07 19:44:56.191 : DEBUG / sensor ( 22583 : 22583 ) : Minimum range of the sensor: 0,000000
08-07 19:44:56.191 : DEBUG / sensor ( 22583 : 22583 ) : Maximum range of the sensor: 1,000000
08-07 19:44:56.191 : DEBUG / sensor ( 22583 : 22583 ) : Resolution of the sensor: 1,000000
08-07 19:44:56.216 : DEBUG / sensor ( 22583 : 22583 ) : Sensor accuracy change callback invoked