best practices in tizen wearable development...best practices in tizen wearable development adam...

29
Best practices in Tizen Wearable development Adam Panasiuk

Upload: others

Post on 25-May-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

Best practices in Tizen

Wearable development

Adam Panasiuk

Page 2: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

2

Presentation contents

• Introduction

• Tizen Wearable

• Development & Tips

• Testing and certification

• Summary

• Q&A

Page 3: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

Introduction

Page 4: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

4

Wearable gadgets

Page 5: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

Tizen Wearable

Page 6: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

6

Tizen Wearable: Gear 2

Page 7: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

7

Tizen Wearable: Gear S

Page 8: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

8

Tizen Wearable: Getting Started

Page 9: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

9

Tizen Wearable: Getting Started

Page 10: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

Development

& Tips

Page 11: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

11

Tizen Wearable: Getting Started

http://developer.samsung.com/samsung-gear

Page 12: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

12

Tizen Wearable IDE

Page 13: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

13

Tizen Wearable IDE

Project components:

Page 14: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

14

Tizen Wearable Gear Manager, Wearable Manager Service, Samsung Accessory Protocol

Page 15: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

15

Tizen Wearable

Page 16: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

16

var date = new Date();

Development Tips Use specialized Tizen API’s instead of generic JavaScript. Example:

Instead of:

Use: var date = tizen.time.getCurrentDateTime();

Specialized Tizen Wearable API’s synchronize with the connected phone,

preventing problems with manual time change and when swithing time zones.

More info: https://developer.tizen.org/dev-

guide/2.2.1/org.tizen.web.device.apireference/tizen/time.html

Page 17: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

17

tizen.power.request("SCREEN", "SCREEN_NORMAL");

tizen.power.request('CPU', 'CPU_AWAKE');

Development Tips Use CPU and wake locks when needed.

After a certain time of inactivity, the device will turn its screen off.

To prevent this behaviour, implement a wake and a CPU lock.

Remember to release the locks when not needed anymore. tizen.power.release("SCREEN");

tizen.power.release('CPU')');

In order to use this, the power privilege must be declared in the config.xml file <tizen:privilege name="http://tizen.org/privilege/power"/>

More info: https://developer.tizen.org/dev-

guide/2.2.1/org.tizen.web.device.apireference/tizen/power.html

Page 18: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

18

{

-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

-webkit-tap-highlight-color: transparent;

}

Development Tips <div> elements are highlighted in orange.

After touching a clickable <div> element on the device, it gets highlighted in

orange for a short period of time. To disable this, in your CSS insert the

following:

More info: https://developer.tizen.org/forums/web-application-

development/gear-tags-onclick-are-highlighted-orange

Page 19: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

19

// CSS for screens with max resolution == 320px - Gear, Gear 2, Gear 2 Neo

@media screen and (max-width: 320px) {

div#main {

width: 320px;

height: 320px;

}

}

// CSS for screens with max resolution == 360px - Gear S

@media screen and (max-width: 360px) {

div#main {

width: 360px;

height: 480px;

}

}

// Other styles, that are the same for both resolutions

div#container {

background-color: #000000;

}

Development Tips If your app is destined for multiple devices with different

resolutions use CSS Media Queries. Example:

More info: https://developer.mozilla.org/en-

US/docs/Web/Guide/CSS/Media_queries

Remember to add the appropriate line into your config.xml file

<feature name="http://tizen.org/feature/screen.size.all"/>

Page 20: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

20

Development Tips

You can also upload diffferent binaries per resolution

(recommended when functionalities vary between devices).

Keep in mind, that not all devices have the same capabilities. For

example, the Gear 2 Neo does not have a camera. In this case, you

can upload different binaries under the same app name.

Page 21: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

Testing and Certification

Page 22: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

22

Emulator

Page 23: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

23

Remote Test Lab

http://developer.samsung.com/remotetestlab

Page 24: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

24

Certification

http://seller.samsungapps.com/

Page 25: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

25

Certification

http://seller.samsungapps.com/

Page 26: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

Summary

Page 27: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

Q&A

Page 28: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development

28

Thank you for your attention.

Page 29: Best practices in Tizen Wearable development...Best practices in Tizen Wearable development Adam Panasiuk 2 Presentation contents • Introduction • Tizen Wearable • Development