first steps with the tizen wearable sdk
TRANSCRIPT
![Page 1: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/1.jpg)
First steps with the Tizen™ Wearable SDK Bartosz Skorupski, Software Engineer, Samsung Electronics
![Page 2: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/2.jpg)
Gear’s family
![Page 3: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/3.jpg)
Supported API
Category API
HTML5 W3C / HTML5
Supplementary
Device Device
Samsung Gear SAP
Motion
Sensor
Badge
Camera
IrLED
![Page 4: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/4.jpg)
Device API
Category API
Application Alarm
Application
Package
Communication IrLED
SAP
Content Content
Download
UI Badge
![Page 5: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/5.jpg)
Device API
Category API
IO Filesystem
Message Port
System Motion
Power
Sensor
System Info
System Settings
Time
![Page 6: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/6.jpg)
TAU (Tizen Advanced UI Framework)
• Fast start-up time (Pre-building HTML5 widgets) • Common API for different devices and profiles • Code optimization • Complete WebKit support • Backward compatibility for deprecated API
![Page 7: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/7.jpg)
Application model
Host Application
Linked (Master-Follower)
Linked (Master) Linked (Follower)
Provider
Consumer
Host-side
Wearable-side
Gear Application
Integrated
Provider
Consumer
Host-side
Wearable-side
Gear Application
Host Application Hos
t W
eara
ble
Standalone
Wearable-side
Gear Application
Widget
![Page 8: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/8.jpg)
Architecture Gear device
SAP WebAPI
![Page 9: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/9.jpg)
SDK Emulator
• Screen resolutions support • 320x320 Gear 1, Gear 2, Gear 2 Neo • 360x480 Gear S
• Control Panel Managers • Device • App
![Page 10: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/10.jpg)
Application Development
• Requirements • Samsung Account (sign up at http://developer.samsung.com) • Tizen SDK for Wearable
• Connect real device to IDE or use Emulator • Create first application (template or sample apps)
![Page 11: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/11.jpg)
Acquiring a certificate
• Sign up or create an account on http://developer.samsung.com • Request certificates for Author and Device
• New certificate • Based on existing certificate • Based on existing Android Certificate
![Page 12: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/12.jpg)
Security Profile
• Get DUID (Device Unique Identifier)
![Page 13: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/13.jpg)
Apply certificate to Security Profile
![Page 14: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/14.jpg)
SAP requirements add privilege in config.xml
• Wearable / Gear device
• Mobile / Android
<tizen:privilege name="http://developer.samsung.com/privilege/accessoryprotocol"/>
<tizen:privilege name="http://developer.samsung.com/tizen/privilege/accessoryprotocol"/>
![Page 15: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/15.jpg)
Consumer and Provider roles accessoryservices.xml
• Define roles
• Link service profile
<resources> <application name = "myApplication"> <serviceProfile role = "consumer" name = "myApplication" id = "/system/myApp" version = "2.0" serviceLimit = "ONE_PEERAGENT" serviceTimeout = "30"> <supportedTransports> <transport type = "TRANSPORT_BT"/> </supportedTransports> <serviceChannel id = "100" dataRate = "high" priority = "low" reliability = "enable"/> </serviceProfile> </application> </resources>
<tizen:metadata key="AccessoryServicesLocation" value="sap.xml"/>
![Page 16: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/16.jpg)
Application Types
• Watchface Clock Widget
• Watch Application
<tizen:category name="com.samsung.wmanager.WATCH_CLOCK"/>
![Page 17: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/17.jpg)
Time API
var date = tizen.time.getCurrentDateTime(); // instead of new Date() var hours = date.getHours(); var minutes = date.getMinutes(); var seconds = date.getSeconds(); console.log(hours + ":" + minutes + ":" + seconds); var changeCallback = function() { var currentDateTime = tizen.time.getCurrentDateTime(); console.log(currentDateTime.toLocalString()); }; tizen.time.setDateTimeChangeListener(changedCallback); // tizen.time.unsetDateTimeChangeListener();
![Page 18: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/18.jpg)
Power API
Resource State
SCREEN SCREEN_OFF SCREEN_DIM
SCREEN_NORMAL
CPU CPU_AWAKE
tizen.power.request(resource, state); tizen.power.release(resource);
![Page 19: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/19.jpg)
SystemInfo API
Property
DISPLAY DEVICE_ORIENTATION BUILD
LOCALE NETWORK WIFI_NETWORK
CELLULAR_NETWORK SIM PERIPHERAL
MEMORY
tizen.systeminfo.getPropertyValue(property, successCallback, errorCallback); var listenerId = tizen.systeminfo.addPropertyValueChangeListener(property, successCallback, options); tizen.systeminfo.removePropertyValueChangeListener(listenerId);
![Page 20: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/20.jpg)
Application API
// all installed applications tizen.application.getAppsInfo(onSuccess, onError); // details about Calendar application var appInfo = tizen.application.getAppInfo("com.samsung.w-calendar2"); // all running applications tizen.application.getAppsContext(onSuccess, onError); // current application context var appContext = tizen.application.getAppContext(null);
![Page 21: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/21.jpg)
Application API
// launch an application tizen.application.launch("com.samsung.w-calendar2", onSuccess, onError); // run an application to choose image files var onAppReply = { onsuccess: function(data) { for (var i = 0; i < data.length; i++) { if (data[i].key === "http://tizen.org/appcontrol/data/selected") { console.log("Selected image: " + data[i].value[0]); } } }, onfailure: function() { console.log("The launch application control failed"); }, } var appControl = new tizen.ApplicationControl( "http://tizen.org/appcontrol/operation/pick", // operation null, // URI "image/jpeg", // mime null); // category ); tizen.application.launchAppControl(appControl, null, onSuccess, onError, onAutoReply);
![Page 22: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/22.jpg)
Development on real device
• Connect Android device to PC via Bluetooth • Debugging by Remote (Web) Inspector
![Page 23: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/23.jpg)
Working with SDK Emulator
1. Uninstall Samsung Gear Manager from mobile device 2. Download and unzip Applications_for_Emulator.zip 3. Install the following APKs on mobile device:
• SAaccessoryService_Emul.apk • SAFTCore_Emul.apk • HostManagerForEmul.apk
4. Run an app HostManagerForEmul on mobile device
![Page 24: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/24.jpg)
Connecting Host with SDK Emulator
Requirements 1. ADT, adb and set a path to adb*
export PATH=${PATH}:~/adt-bundle/sdk/platform-tools adb devices
2. Tizen SDK for Wearable 3. Type commands in terminal
adb –d forward tcp:8230 tcp:8230 4. Run an app HostManagerForEmul 5. Run SDK Emulator * Make sure USB debugging mode is turned on
![Page 25: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/25.jpg)
Removing an app from SDK Emulator
• Set a path to sdb, and make sure it’s properly set export PATH=${PATH}:~/tizen-wearable-sdk/tools sdb devices
• Type the following command in terminal sdb uninstall [appid] i.e. VbsgE6bms2
![Page 26: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/26.jpg)
References (1/2)
• Samsung Accessory SDK • http://developer.samsung.com/galaxy#accessory • http://developer.samsung.com/resources/accessory
• Tutorials • Developing an app on Samsung Gear devices • Testing an app on Tizen Wearable SDK Emulator • Samsung Galaxy App Store
![Page 27: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/27.jpg)
References (2/2)
• Guides and API references • Hello Accessory Developer’s Guide • Development Guide • Design responsive apps on Tizen wearable devices • SAP API reference • UI Design Guidelines for Gear S devices • Source Code Samples
![Page 28: First steps with the Tizen Wearable SDK](https://reader036.vdocuments.mx/reader036/viewer/2022082209/55d10198bb61eba7428b484f/html5/thumbnails/28.jpg)
@bskorupski [email protected]