Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Filter
tutorials health, galaxy watch, mobile
blogthe samsung health sensor sdk enables your application to collect vital signs and other health parameters tracked on galaxy watch running wear os powered by samsung. the tracked data can be displayed immediately or retained for later analysis. some kinds of tracked data, such as batching data, are impractical to display on a watch screen in real-time, so it is common to store the data in a database or server solution or show them on the larger screen of a mobile device. this blog demonstrates how to develop two connected sample applications. a watch application uses the samsung health sensor sdk to collect heart rate tracker data, then uses the wearable data layer api to transmit it to a companion application on the user’s android mobile device, which displays the data as a simple list on its screen. you can follow along with the demonstration by downloading the sample application project. to test the applications, you need a galaxy watch4 (or higher model) and a connected android mobile device. creating the application project the application project consists of a wearable module for the watch, and a mobile module for android mobile devices: in android studio, select open file > new > new project. select wear os > empty wear app and click next. new wear app define the project details. project details to create a companion mobile application for the watch application, check the pair with empty phone app box. notemake sure that the application id is identical for both modules in their “build.gradle” files. for more information about creating multi-module projects, see from wrist to hand: develop a companion app for your wearable application. implementing the watch application the watch application ui has two buttons. the start/stop button controls heart data tracking, and the send button transfers the collected data to the connected mobile device. the screen consists of a heart rate field and 4 ibi value fields, since there can be up to 4 ibi values in a single tracking result. watch application ui track and extract heart rate data when the user taps the start button on the wearable application ui, the starttracking() function from the mainviewmodel class is invoked. the application must check that the galaxy watch supports the heart rate tracking capability that we want to implement, as the supported capabilities depend on the device model and software version. retrieve the list of supported health trackers with the trackingcapability.supporthealthtrackertypes of the healthtrackingservice class: override fun hascapabilities(): boolean { log.i(tag, "hascapabilities()") healthtrackingservice = healthtrackingserviceconnection.gethealthtrackingservice() val trackers: list<healthtrackertype> = healthtrackingservice!!.trackingcapability.supporthealthtrackertypes return trackers.contains(trackingtype) } to track the heart rate values on the watch, read the flow of values received in the ondatareceived() listener: @experimentalcoroutinesapi override suspend fun track(): flow<trackermessage> = callbackflow { val updatelistener = object : healthtracker.trackereventlistener { override fun ondatareceived(datapoints: mutablelist<datapoint>) { for (datapoint in datapoints) { var trackeddata: trackeddata? = null val hrvalue = datapoint.getvalue(valuekey.heartrateset.heart_rate) val hrstatus = datapoint.getvalue(valuekey.heartrateset.heart_rate_status) if (ishrvalid(hrstatus)) { trackeddata = trackeddata() trackeddata.hr = hrvalue log.i(tag, "valid hr: $hrvalue") } else { coroutinescope.runcatching { trysendblocking(trackermessage.trackerwarningmessage(geterror(hrstatus.tostring()))) } } val validibilist = getvalidibilist(datapoint) if (validibilist.size > 0) { if (trackeddata == null) trackeddata = trackeddata() trackeddata.ibi.addall(validibilist) } if ((ishrvalid(hrstatus) || validibilist.size > 0) && trackeddata != null) { coroutinescope.runcatching { trysendblocking(trackermessage.datamessage(trackeddata)) } } if (trackeddata != null) { validhrdata.add(trackeddata) } } trimdatalist() } fun geterror(errorkeyfromtracker: string): string { val str = errors.getvalue(errorkeyfromtracker) return context.resources.getstring(str) } override fun onflushcompleted() { log.i(tag, "onflushcompleted()") coroutinescope.runcatching { trysendblocking(trackermessage.flushcompletedmessage) } } override fun onerror(trackererror: healthtracker.trackererror?) { log.i(tag, "onerror()") coroutinescope.runcatching { trysendblocking(trackermessage.trackererrormessage(geterror(trackererror.tostring()))) } } } heartratetracker = healthtrackingservice!!.gethealthtracker(healthtrackertype.heart_rate_continuous) setlistener(updatelistener) awaitclose { log.i(tag, "tracking flow awaitclose()") stoptracking() } } each tracking result is within a list in the datapoints argument of the ondatareceived() update listener. the sample application implements continuous heart rate tracking. to extract a heart rate from data point: val hrvalue = datapoint.getvalue(valuekey.heartrateset.heart_rate) val hrstatus = datapoint.getvalue(valuekey.heartrateset.heart_rate_status) a status parameter is returned in addition to the heart rate data. if the heart rate reading was successful, its value is 1. each inter-beat interval data point consists of a list of values and the corresponding status for each value. there can be up to 4 ibi values in a single data point, depending on the heart rate. if the ibi reading is valid, the value of the status parameter is 0. to extract only ibi data that is valid and whose value is not 0: private fun isibivalid(ibistatus: int, ibivalue: int): boolean { return ibistatus == 0 && ibivalue != 0 } fun getvalidibilist(datapoint: datapoint): arraylist<int> { val ibivalues = datapoint.getvalue(valuekey.heartrateset.ibi_list) val ibistatuses = datapoint.getvalue(valuekey.heartrateset.ibi_status_list) val validibilist = arraylist<int>() for ((i, ibistatus) in ibistatuses.withindex()) { if (isibivalid(ibistatus, ibivalues[i])) { validibilist.add(ibivalues[i]) } } send data to the mobile application the application uses the messageclient class of the wearable data layer api to send messages to the connected mobile device. messages are useful for remote procedure calls (rpc), one-way requests, or in request-or-response communication models. when a message is sent, if the sending and receiving devices are connected, the system queues the message for delivery and returns a successful result code. the successful result code does not necessarily mean that the message was delivered successfully, as the devices can be disconnected before the message is received. to advertise and discover devices on the same network with features that the watch can interact with, use the capabilityclient class of the wearable data layer api. each device on the network is represented as a node that supports various capabilities (features) that an application defines at build time or configures dynamically at runtime. your watch application can search for nodes with a specific capability and interact with it, such as sending messages. this can also work in the opposite direction, with the wearable application advertising the capabilities it supports. when the user taps the send button on the wearable application ui, the sendmessage() function from the mainviewmodel class is invoked, which triggers code in the sendmessageusecase class: override suspend fun sendmessage(message: string, node: node, messagepath: string): boolean { val nodeid = node.id var result = false nodeid.also { id -> messageclient .sendmessage( id, messagepath, message.tobytearray(charset = charset.defaultcharset()) ).apply { addonsuccesslistener { log.i(tag, "sendmessage onsuccesslistener") result = true } addonfailurelistener { log.i(tag, "sendmessage onfailurelistener") result = false } }.await() log.i(tag, "result: $result") return result } } to find a destination node for the message, retrieve all the available capabilities on the network: override suspend fun getcapabilitiesforreachablenodes(): map<node, set<string>> { log.i(tag, "getcapabilities()") val allcapabilities = capabilityclient.getallcapabilities(capabilityclient.filter_reachable).await() return allcapabilities.flatmap { (capability, capabilityinfo) -> capabilityinfo.nodes.map { it to capability } } .groupby( keyselector = { it.first }, valuetransform = { it.second } ) .mapvalues { it.value.toset() } } since the mobile module of the sample application advertises having the “wear” capability, to find an appropriate destination node, retrieve the list of connected nodes that support it: override suspend fun getnodesforcapability( capability: string, allcapabilities: map<node, set<string>> ): set<node> { return allcapabilities.filtervalues { capability in it }.keys } select the first node from the list, encode the message as a json string, and send the message to the node: suspend operator fun invoke(): boolean { val nodes = getcapablenodes() return if (nodes.isnotempty()) { val node = nodes.first() val message = encodemessage(trackingrepository.getvalidhrdata()) messagerepository.sendmessage(message, node, message_path) true } else { log.i(tag, "no compatible nodes found") false } } implementing the mobile application the mobile application ui consists of a list of the heart rate and inter-beat interval values received from the watch. the list is scrollable. mobile application ui receive and display data from the watch application to enable the mobile application to listen for data from the watch and launch when it receives data, define the datalistenerservice service in the mobile application’s androidmanifest.xml file, within the <application> element: <service android:name="com.samsung.health.mobile.data.datalistenerservice" android:exported="true"> <intent-filter> <action android:name="com.google.android.gms.wearable.data_changed" /> <action android:name="com.google.android.gms.wearable.message_received" /> <action android:name="com.google.android.gms.wearable.request_received" /> <action android:name="com.google.android.gms.wearable.capability_changed" /> <action android:name="com.google.android.gms.wearable.channel_event" /> <data android:host="*" android:pathprefix="/msg" android:scheme="wear" /> </intent-filter> </service> implement the datalistenerservice class in the application code to listen for and receive message data. the received json string data is passed as a parameter: private const val tag = "datalistenerservice" private const val message_path = "/msg" class datalistenerservice : wearablelistenerservice() { override fun onmessagereceived(messageevent: messageevent) { super.onmessagereceived(messageevent) val value = messageevent.data.decodetostring() log.i(tag, "onmessagereceived(): $value") when (messageevent.path) { message_path -> { log.i(tag, "service: message (/msg) received: $value") if (value != "") { startactivity( intent(this, mainactivity::class.java) .addflags(intent.flag_activity_new_task).putextra("message", value) ) } else { log.i(tag, "value is an empty string") } } } to decode the message data: fun decodemessage(message: string): list<trackeddata> { return json.decodefromstring(message) } to display the received data on the application screen: @composable fun mainscreen( results: list<trackeddata> ) { column( modifier = modifier .fillmaxsize() .background(color.black), verticalarrangement = arrangement.top, horizontalalignment = alignment.centerhorizontally ) { spacer( modifier .height(70.dp) .fillmaxwidth() .background(color.black) ) listview(results) } } running the applications to run the wearable and mobile applications: connect your galaxy watch and android mobile device (both devices must be paired with each other) to android studio on your computer. select wear from the modules list and the galaxy watch device from the devices list, then click run. the wearable application launches on the watch. connected devices select mobile from the modules list and the android mobile device from the devices list, then click run. the mobile application launches on the mobile device. wear the watch on your wrist and tap start. the watch begins tracking your heart rate. after some tracked values appear on the watch screen, to send the values to the mobile application, tap send. if the mobile application is not running, it is launched. the tracked heart data appears on the mobile application screen. to stop tracking, tap stop on the watch. conclusions the samsung health sensor sdk enables you to track health data, such as heart rate, from a user’s galaxy watch4 or higher smartwatch model. to display the tracked data on a larger screen, you can use the messageclient of the wearable data layer api to send the data to a companion application on the connected mobile device. to develop more advanced application features, you can also use the dataclient class to send data to devices not currently in range of the watch, delivering it only when the device is connected. resources heart rate data transfer code lab
Samsung Developers
Learn Code Lab
codelabtransfer heart rate data from galaxy watch to a mobile device objective create a health app for galaxy watch, operating on wear os powered by samsung, to measure heart rate and inter-beat interval ibi , send data to a paired android phone, and create an android application for receiving data sent from a paired galaxy watch overview with this code lab, you can measure various health data using samsung health sensor sdk and send it to a paired android mobile device for further processing samsung health sensor sdk tracks various health data, but it cannot save or send collected results meanwhile, wearable data layer allows you to synchronize data from your galaxy watch to an android mobile device using a paired mobile device allows the data to be more organized by taking advantage of a bigger screen and better performance see samsung health sensor sdk descriptions for detailed information set up your environment you will need the following galaxy watch4 or newer android mobile device android studio latest version recommended java se development kit jdk 17 or later sample code here is a sample code for you to start coding in this code lab download it and start your learning experience! heart rate data transfer sample code 218 3 kb connect your galaxy watch to wi-fi go to settings > connection > wi-fi and make sure that the wi-fi is enabled from the list of available wi-fi networks, choose and connect to the same one as your pc turn on developer mode and adjust its settings on your watch, go to settings > about watch > software and tap on software version 5 times upon successful activation of developer mode, a toast message displays as on the image below afterwards, developer options is going to be visible under settings tap developer options and enable the following options adb debugging in developer options find wireless debugging turn on wireless debugging check always allow on this network and tap allow go back to developer options and click turn off automatic wi-fi notethere may be differences in settings depending on your one ui version connect your galaxy watch to android studio go to settings > developer options > wireless debugging and choose pair new device take note of the wi-fi pairing code, ip address & port in android studio, go to terminal and type adb pair <ip address> <port> <wi-fi pairing code> when prompted, tap always allow from this computer to allow debugging after successfully pairing, type adb connect <ip address of your watch> <port> upon successful connection, you can see the following message in the terminal connected to <ip address of your watch> now, you can run the app directly on your watch turn on developer mode for health platform swipe down from the top of the screen to open the quick panel, then tap the settings icon scroll down and tap apps select health platform quckly tap health platform for about 10 times developer mode is enabled when [dev mode] appears below health platform noteyou can disable developer mode by quickly tapping the health platform until [dev mode] disappears set up your android device click on the following links to setup your android device enable developer options run apps on a hardware device connect the galaxy watch with you samsung mobile phone start your project in android studio, click open to open an existing project locate the downloaded android project hrdatatransfer-code-lab from the directory and click ok you should see both devices and applications available in android studio as in the screenshots below initiate heart rate tracking noteyou may refer to this blog post for more detailed analysis of the heart rate tracking using samsung health sensor sdk first, you need to connect to the healthtrackingservice to do that create connectionlistener, create healthtrackingservice object by invoking healthtrackingservice connectionlistener, context invoke healthtrackingservice connectservice when connected to the health tracking service, check the tracking capability the available trackers may vary depending on samsung health sensor sdk, health platform versions or watch hardware version use the gettrackingcapability function of the healthtrackingservice object obtain heart rate tracker object using the function healthtrackingservice gethealthtracker healthtrackertype heart_rate_continuous define event listener healthtracker trackereventlistener, where the heart rate values are collected start tracking the tracker starts collecting heart rate data when healthtracker seteventlistener updatelistener is invoked, using the event listener collect heart data from the watch the updatelistener collects datapoint instances from the watch, which contains a collection of valuekey objects those objects contain heart rate, ibi values, and ibi statuses there's always one value for heart rate while the number of ibi values vary from 0-4 both ibi value and ibi status lists have the same size go to wear > java > data > com samsung health hrdatatransfer > data under ibidataparsing kt, provide the implementation for the function below /******************************************************************************* * [practice 1] get list of valid inter-beat interval values from a datapoint * - return arraylist<int> of valid ibi values validibilist * - if no ibi value is valid, return an empty arraylist * * var ibivalues is a list representing ibivalues up to 4 * var ibistatuses is a list of their statuses has the same size as ibivalues ------------------------------------------------------------------------------- * - hints * use local function isibivalid status, value to check validity of ibi * ****************************************************************************/ fun getvalidibilist datapoint datapoint arraylist<int> { val ibivalues = datapoint getvalue valuekey heartrateset ibi_list val ibistatuses = datapoint getvalue valuekey heartrateset ibi_status_list val validibilist = arraylist<int> //todo 1 return validibilist } check data sending capabilities for the watch once the heart rate tracker can collect data, set up the wearable data layer so it can send data to a paired android mobile device wearable data layer api provides data synchronization between wear os and android devices noteto know more about wearable data layer api, go here to determine if a remote mobile device is available, the wearable data layer api uses concept of capabilities not to be confused with samsung health sensor sdk’s tracking capabilities, providing information about available tracker types using the wearable data layer's capabilityclient, you can get information about nodes remote devices being able to consume messages from the watch go to wear > java > com samsung health hrdatatransfer > data in capabilityrepositoryimpl kt, and fill in the function below the purpose of this part is to filter all capabilities represented by allcapabilities argument by capability argument and return the set of nodes set<node> having this capability later on, we need those nodes to send the message to them /************************************************************************************** * [practice 2] check capabilities for reachable remote nodes devices * - return a set of node objects out of all capabilities represented by 2nd function * argument, having the capability represented by 1st function argument * - return empty set if no node has the capability -------------------------------------------------------------------------------------- * - hints * you might want to use filtervalues function on the given allcapabilities map * ***********************************************************************************/ override suspend fun getnodesforcapability capability string, allcapabilities map<node, set<string>> set<node> { //todo 2 } encode message for the watch before sending the results of the heart rate and ibi to the paired mobile device, you need to encode the message into a string for sending data to the paired mobile device we are using wearable data layer api’s messageclient object and its function sendmessage string nodeid, string path, byte[] message go to wear > java > com samsung health hrdatatransfer > domain in sendmessageusecase kt, fill in the function below and use json format to encode the list of results arraylist<trackeddata> into a string /*********************************************************************** * [practice 3] - encode heart rate & inter-beat interval into string * - encode function argument trackeddata into json format * - return the encoded string ----------------------------------------------------------------------- * - hint * use json encodetostring function **********************************************************************/ fun encodemessage trackeddata arraylist<trackeddata> string { //todo 3 } notetrackeddata is an object, containing data received from heart rate tracker’s single datapoint object @serializable data class trackeddata var hr int, var ibi arraylist<int> = arraylist run unit tests for your convenience, you can find an additional unit tests package this lets you verify your code changes even without using a physical watch or mobile device see the instruction below on how to run unit tests right-click on com samsung health hrdatatransfer test , and execute run 'tests in 'com samsung health hrdatatransfer" command if you have completed all the tasks correctly, you can see all the unit tests pass successfully run the app after building the apks, you can run the applications on your watch to measure heart rate and ibi values, and on your mobile device to collect the data from your watch once the app starts, allow the app to receive data from the body sensors afterwards, it shows the application's main screen to get the heart rate and ibi values, tap the start button tap the send button to send the data to your mobile device notethe watch keeps last ~40 values of heart rate and ibi you’re done! congratulations! you have successfully achieved the goal of this code lab now, you can create a health app on a watch to measure heart rate and ibi, and develop a mobile app that receives that health data! if you face any trouble, you may download this file heart rate data transfer complete code 217 8 kb to learn more about samsung health, visit developer samsung com/health
tutorials galaxy watch, mobile
bloggalaxy watch apps can offer a range of features and services, but the watch's smaller size compared to a mobile device means there are limitations, including fewer hardware resources and a smaller screen. to make the most of the capabilities of a mobile device, you can develop a companion mobile application for the wearable application. the companion application handles complex and resource-intensive tasks while the wearable application provides a seamless experience. previously in this series, we showed how to create a companion mobile application for a galaxy watch running wear os powered by samsung and use the wearable data layer api to send messages from the watch to the mobile device. while it is easy to check the watch's battery level from the mobile device, the reverse is more complex. this tutorial describes how to establish two-way communication between the wearable and mobile applications and use it to check the mobile device's battery level from the watch. prerequisites to develop a wearable application and its companion mobile application, create a multi-module project in android studio. the steps are described in the previous tutorial, and the same dependencies and modifications are required for the wearable application in this tutorial: add the following dependencies to the build.gradle filedependencies { ... implementation "com.google.android.gms:play-services-wearable:xx.x.x" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:x.x.x" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:x.x.x" implementation "androidx.lifecycle:lifecycle-extensions:x.x.x" implementation "androidx.lifecycle:lifecycle-runtime-ktx:x.x.x" implementation "androidx.appcompat:appcompat:x.x.x" } modify the mainactivity class to inherit appcompatactivity() instead of activity(). in the "androidmanifest.xml" file, in the <application> element, change the android:theme attribute value to "@style/theme.appcompat.noactionbar" or another custom theme. warningthe package ids of the wearable and mobile applications must be identical. to test the project, you need a galaxy watch running wear os powered by samsung and a connected galaxy mobile device. request battery information from the companion application to be able to retrieve the mobile device's battery level as a percentage from the watch, the companion application on the mobile device must advertise the "battery_percentage" capability. in the mobile application, create an xml file named "wear.xml" in the "res/values/" directory with the following content: <!--xml configuration file--> <?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@array/android_wear_capabilities"> <string-array name="android_wear_capabilities"> <item>battery_percentage</item> </string-array> </resources> while a watch can be connected to only one device at a time, a mobile device can be connected to multiple wearables at the same time. to determine which node (connected device) corresponds to the watch, use the capabilityclient class of the wearable data layer api to retrieve all the available nodes and select the best or closest node to deliver your message. // mainactivity class in the wearable application private var batterynodeid: string? = null private fun setupbatterypercentage() { // store the reachable nodes val capabilityinfo: capabilityinfo = tasks.await( wearable.getcapabilityclient(applicationcontext) // retrieve all connected nodes with the 'battery_percentage' capability .getcapability( battery_percentage_capability_name, capabilityclient.filter_reachable ) ) // use a listener to retrieve the reachable nodes updatebatterycapability(capabilityinfo).also { capabilitylistener -> wearable.getcapabilityclient(this @mainactivity).addlistener( capabilitylistener, battery_percentage_capability_name ) } } private fun pickbestnodeid(nodes: set<node>): string? { // find the best node return nodes.firstornull { it.isnearby }?.id ?: nodes.firstornull()?.id } private fun updatebatterycapability(capabilityinfo: capabilityinfo) { // specify the recipient node for the message batterynodeid = pickbestnodeid(capabilityinfo.nodes) } companion object{ private const val tag = "mainwearactivity" private const val battery_percentage_capability_name = "battery_percentage" private const val battery_message_path = "/message_battery" } to implement bi-directional communication between watch and mobile device, you can use the messageclient class of the wearable data layer api. in the wearable application ui, create a button and a textview. to display the mobile device's battery level on the textview when the button is tapped, implement the button's onclicklistener() function. send the battery level request message through a specific message path to the mobile device, using a coroutine that calls the setupbatterypercentage() and requestbatterypercentage() methods on a separate thread. a separate thread must be used because these are synchronous calls that block the ui thread. // mainactivity class in the wearable application private lateinit var binding: activitymainbinding override fun oncreate(savedinstancestate: bundle?) { super.oncreate(savedinstancestate) binding = activitymainbinding.inflate(layoutinflater) setcontentview(binding.root) log.d(tag, "oncreate()") binding.apply{ phonebutton.setonclicklistener{ lifecyclescope.launch(dispatchers.io){ setupbatterypercentage() requestbatterypercentage("battery".tobytearray()) } } } } // deliver the message to the selected node private fun requestbatterypercentage(data: bytearray) { batterynodeid?.also { nodeid -> val sendtask: task<*> = wearable.getmessageclient(this @mainactivity).sendmessage( nodeid, battery_message_path, data ).apply { addonsuccesslistener { log.d(tag, "onsuccess") } addonfailurelistener { log.d(tag, "onfailure") } } } } receive the message on the companion application the companion application must be able to receive and respond to the message from the background. to accomplish this, implement a service that listens for incoming messages. in the mobile application, create a class that extends wearablelistenerservice() and add the service to the application manifest file: <!--android manifest file for the mobile application--> <service android:name=".phonelistenerservice" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="com.google.android.gms.wearable.message_received" /> <data android:host="*" android:pathprefix="/" android:scheme="wear" /> </intent-filter> </service> use the batterymanager class to retrieve the current battery level of the device. to send the retrieved value back to the wearable application, use the sendmessage() function again. for simplicity, send the message to the first connected node on the mobile device. alternatively, you can broadcast to all connected nodes. implement the onmessagereceived() function to receive the incoming request for battery level and send the retrieved value to the wearable application. // service class in the mobile application private val scope = coroutinescope(supervisorjob() + dispatchers.main.immediate) private var batterynodeid: string? = null override fun ondestroy() { scope.cancel() super.ondestroy() } override fun onmessagereceived(messageevent: messageevent) { log.d(tag, "onmessagereceived(): $messageevent") log.d(tag, string(messageevent.data)) if (messageevent.path == battery_message_path && string(messageevent.data) == "battery") { // check that the request and path are correct val batterymanager = applicationcontext.getsystemservice(battery_service) as batterymanager val batteryvalue:int = batterymanager.getintproperty(batterymanager.battery_property_capacity) scope.launch(dispatchers.io){ // send the message to the first node batterynodeid = getnodes().first()?.also { nodeid-> val sendtask: task<*> = wearable.getmessageclient(applicationcontext).sendmessage( nodeid, battery_message_path, batteryvalue.tostring().tobytearray() ).apply { addonsuccesslistener { log.d(tag, "onsuccess") } addonfailurelistener { log.d(tag, "onfailure") } } } } } ondestroy() } private fun getnodes(): collection<string> { return tasks.await(wearable.getnodeclient(this).connectednodes).map { it.id } } companion object{ private const val tag = "phonelistenerservice" private const val battery_message_path = "/message_battery" } display the battery information on the wearable application when receiving the battery information on the wearable application, because the user is actively interacting with the application, a resource-intensive service is not needed and registering a live listener is sufficient. use the addlistener() method of the messageclient class to implement the messageclient.onmessagereceivedlistener interface within the mainactivity class in the wearable application. // mainactivity class in the wearable application override fun onresume(){ super.onresume() log.d(tag, "onresume()") // wearable api clients are not resource-intensive wearable.getmessageclient(this).addlistener(this) } override fun onpause(){ super.onpause() log.d(tag, "onpause()") wearable.getmessageclient(this).removelistener(this) } override fun onmessagereceived(messageevent: messageevent) { // receive the message and display it if(messageevent.path == battery_message_path){ log.d(tag, "mobile battery percentage: " + string(messageevent.data) + "%") binding.phonetextview.text = string(messageevent.data) } } conclusion to test the project, build both applications and run them on your galaxy watch and mobile device. when you tap the ui button on the watch, the application retrieves the battery level from the mobile device and displays the percentage on the watch. this demonstration has shown how the wearable data layer api enables you to implement seamless bi-directional communication between a galaxy watch running wear os powered by samsung and its connected mobile device. in addition to battery level, you can use the capabilityclient and messageclient classes to transfer various data between the devices in a similar way. for more information about implementing communication between watch and mobile devices, see send and receive messages on wear. if you have questions about or need help with the information in this tutorial, you can share your queries on the samsung developers forum. for more specialized support, you can contact us through samsung developer support. stay tuned for the next installment in this tutorial series.
Samiul Hossain
tutorials galaxy watch, mobile
bloggalaxy watch applications can support many features and services on the watch hardware, but the watch's smaller size compared to a mobile device carries limitations, such as fewer hardware resources and smaller screen size. to take advantage of mobile hardware, you can develop a companion mobile application for the wearable application. the companion application handles complex and resource-intensive tasks while the wearable application provides a seamless experience. this tutorial uses android studio and kotlin to demonstrate how to create a multi-module project and communicate between a companion mobile application and a wearable application using the wearable data layer api. to test the application, you need a galaxy watch running wear os powered by samsung and a connected galaxy mobile device. prerequisites to develop a wearable application and its companion mobile application, create a multi-module project in android studio: create a new mobile application project. select file > new > new project > phone & tablet > empty activity and define an appropriate name and application id (package name) for the project. in the android studio environment, switch to project view. to create the wearable module, right-click the project name and select new > module > wear os > blank activity. make sure the application id for this module is identical to the mobile application. switch the android studio environment back to android view. to use the wearable data layer api to create a communication channel between the wearable and mobile applications, add the following dependency to the build.gradle file for both modules: dependencies { ... implementation 'com.google.android.gms:play-services-wearable:xx.x.x' } launching the companion application launching the companion mobile application from the wearable application includes the following steps, which can be implemented using the messageclient api: send a message from the wearable application to the mobile application. receive the message in the mobile application and launch an intent. send a message to the companion application a coroutine is needed to send messages from the wearable application to the mobile application, because this task cannot be carried out on the main thread. the coroutine creates a separate background thread on which to complete the work. to implement coroutines in the wearable application: add the following dependencies to its build.gradle file:implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:x.x.x" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:x.x.x" implementation "androidx.lifecycle:lifecycle-extensions:x.x.x" implementation "androidx.lifecycle:lifecycle-runtime-ktx:x.x.x" implementation "androidx.appcompat:appcompat:x.x.x" in the application code, modify the mainactivity class to inherit appcompatactivity() instead of activity(). in the androidmanifest.xml file, in the <application> element, change the android:theme attribute value to "@style/theme.appcompat.noactionbar" or another custom theme. now that you've implemented coroutines, let's develop a way to send a message to the companion application. in the xml file for the wearable module, define a ui with a button. while a mobile device can be connected to multiple wearables, a watch is typically connected to only a single device. therefore, send the message to the first node (connected device) on the watch using the messageclient api. to retrieve a list of the connected nodes, implement the following function: private fun getnodes(): collection<string> { return tasks.await(wearable.getnodeclient(context).connectednodes).map { it.id } } in the mainactivity class of the wearable module, add a listener to the ui button that uses the sendmessage() function of the messageclient api to send a message to the first node retrieved from the getnodes() function. the sendmessage() function requires three parameters: id of the receiving node. message path (specific address) of the receiving node. byte array of the information to be sent to the node. the size must be less than 100 kb. the message path is initialized in the companion object and is needed to receive the message on the mobile application. class mainactivity : appcompatactivity() { private lateinit var binding: activitymainbinding private var transcriptionnodeid: string? = null override fun oncreate(savedinstancestate: bundle?) { super.oncreate(savedinstancestate) binding = activitymainbinding.inflate(layoutinflater) setcontentview(binding.root) binding.deploybutton.setonclicklistener { lifecyclescope.launch(dispatchers.io){ transcriptionnodeid = getnodes().first()?.also { nodeid-> val sendtask: task<*> = wearable.getmessageclient(applicationcontext).sendmessage( nodeid, message_path, "deploy".tobytearray() //send your desired information here ).apply { addonsuccesslistener { log.d(tag, "onsuccess") } addonfailurelistener { log.d(tag, "onfailure") } } } } } } } companion object{ private const val tag = "mainwearactivity" private const val message_path = "/deploy" } listen for messages in the companion application a companion mobile application can be notified of incoming messages from the wearable application in two ways: extending the wearablelistenerservice class to create a service that listens for incoming messages even when the application is in the background implementing the messageclient.onmessagereceivedlistener interface in the mainactivity class of the mobile application since we want to react to the message by launching the companion application even when it is not running in the foreground, create a separate class that extends the wearablelistenerservice class. to receive messages from the wearable application, implement the following onmessagereceived() function: class phonelistenerservice: wearablelistenerservice() { override fun onmessagereceived(messageevent: messageevent) { log.d(tag, "onmessagereceived(): $messageevent") log.d(tag, string(messageevent.data)) if (messageevent.path == message_path) { val startintent = intent(this, mainactivity::class.java).apply { addflags(intent.flag_activity_new_task) putextra("messagedata", messageevent.data) } startactivity(startintent) } } companion object{ private const val tag = "phonelistenerservice" private const val message_path = "/deploy" } } in the androidmanifest.xml file of the mobile application, add the service and an intent filter for the listener service: <service android:name=".phonelistenerservice" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="com.google.android.gms.wearable.message_received" /> <data android:host="*" android:pathprefix="/" android:scheme="wear" /> </intent-filter> </service> to test the project, build both applications and run them on your galaxy watch and mobile device. when you tap the ui button on the watch, the companion application launches on the mobile device. conclusion this tutorial has demonstrated how the wearable data layer api enables you to implement seamless communication between a galaxy watch running wear os powered by samsung and its connected mobile device. in addition to launching a companion application, the functions of the messageclient api can also be used to delegate complex tasks to the mobile device, creating more seamless user experiences for wearable applications. for more information about implementing communication between watch and mobile devices, see send and receive messages on wear. if you have questions about or need help with the information in this tutorial, you can share your queries on the samsung developers forum. for more specialized support, you can contact us through samsung developer support. stay tuned for the next blog on wearable and mobile communication.
Samiul Hossain
Develop Galaxy Watch for Tizen
docset as button the set as button feature enables interaction with your watch face by allowing the user to tap a component to change images, open different apps, change time zone, change temperature units or update weather data step 1 click on a component to make a button, select a component step 2 select set as button select set as button from the properties tab if the set as button option is disabled, that means set as button is not supported by this component note watch index, group, animation and components that have tag expressions on placement or rotate are not supported as buttons in aod mode, all button actions are disabled step 3 edit the button properties there are two tabs under properties normal and action the normal tab is the default found in each component the action tab is used for the set as button feature you can use this tab to configure how a button interacts, as well as its action step 4 set interaction select interaction from the dropdown in this example, the button works by tapping the component twice step 5 set action behavior there are different kinds of action behavior for different components actions depend on the type of component in this example, change image is selected action behavior all components do not support the same button action behavior, so it is necessary to know which component supports which button action galaxy watch studio supports the following button action behavior none default behavior no action occurs all components support this behavior open app five components support the open app action background, watch hand, digital clock, image, and text these three types of apps can be opened preloaded app all galaxy watches include a list of factory-installed apps you can find this list from the open app tab select any app to open after tapping on the button custom add your own tizen wearable app id or the app id of any wearable app from the galaxy store however, that app must be installed on the user’s watch; otherwise, the button won’t work for your app the app id can be found in the config xml file of your tizen project any other app from galaxy store contact the app developer and request the app id or use the app switcher app switcher this option is enabled when the interaction is set as double tap it allows a user to choose any app that is installed on his or her watch by double-tapping on the component at any time after choosing the app, the user can open that app by single-tapping and change the app by double-tapping to get an idea of how to use this feature, see how to create a tap reveal button to show hidden data change image change the image of a component by single- or double-tapping it this option can be used for the following components background, watch hand, and image time zone selector this action is available only for the digital clock component when interaction is set to tap this action is not available on double-tap from the dropdown, you can choose any default time zone along with sync with device note that if you set the action to time zone selector, then the normal > time zone option becomes disabled so, you have to set the default time zone in the normal tab before setting the action to time zone selector see the time travel is easy with a time zone selector button blog for more information about using this feature note if you are using galaxy watch studio version 1 7 0, don’t select sync with device, because this option disables the button tip buttons don’t work in aod mode, so the time zone selector won’t work in this mode that means the default time zone is displayed update weather data this button action allows a user to update all types of weather data on a watch face, whenever she or he wants, by tapping the button this action is available for all types of weather text weather type, temperature, humidity, city name weather , and last update time weather change temperature unit the user can choose any unit for the temperature data this is only available for the temperature-type text component the use galaxy watch designer to change the weather blog has further information on this topic note if the action of a button does not exist, then no error message will pop up on the watch, and no action will occur for example, you have set the button action to open a custom app if that app doesn’t exist on a user’s watch, the app won’t open, nor will an error message appear tap area of button when you make a custom image for a button, consider the tap area you can set any image as a button, but the tap area of that button is always rectangular or square after setting an image as a button, the entire area inside the red dotted lines is the part of that button see figures 1 and 2 tip keep the tap area of a component as large as possible layer concepts and limitations galaxy watch studio supports the concept of layers, which means a component on a higher layer takes precedence over components on lower layers when you add a new component, it will always be added as the top layer you can change the order of layers if you want by default, the background component is always the lowest layer, but you can move it to another layer if you desire a button action on a higher layer takes precedence over a button action on a lower layer let’s assume two components are buttons and the top-layer component covers the lower-layer component in this case, the button action won't work for the lower-layer component see figures 3 and 4 three components in figure 3 are buttons component 1 is the top-layer component, which covers component 2 and part of component 3 component 3 can be divided into two areas area 1, which is covered by component 1, and area 2, which is not covered by any other component if you tap component 1, the button action will work according to component 1 the button action won’t work on component 2, as it is fully covered by component 1 the button action of component 3 won’t work on area 1, as this part is covered but if you tap on area 2, it will work according to component 3 note if component 1 top layer is not a button, then the button actions of component 2 and 3 will work according to their defined actions watch hand limitations when you import any image as a watch hand, this image traverses a 360-degree area; therefore, watch hands cover the full 360-degree area the tap area is the same as other components, which is the area inside the red dotted lines example 1 let’s assume a lower-layer button is placed inside the watch hand area this button won't work for the same reason as component 2 the lower layer in figure 3 but if you place this component on a higher layer than the watch hand, then the button action will work figure 5 depicts the scenario where all components are buttons in figure 5, the black line is the tap area of a component, and the white index area is the covered area of the watch hand component 1 and the watch hand suppose component 3 doesn’t exist the watch hand is on a higher layer than component 1 a watch hand traverses a 360-degree area, so it covers the whole circular area component 1 can be divided into two areas a1 is inside the watch hand’s area, and a2 is the rest of the area of component 1 if you tap on a1, nothing happens but if you tap on a2, the button action will work the button action of the watch hand works normally component 3 and the watch hand component 3 is on a higher layer than the watch hand component 3 can be divided into two parts a3 and a4 in this case, three scenarios can occur tap on component 3 a3 or a4 when the watch hand is not above component 3 the button action will work according to the action configured for component 3 tap on the watch hand when it overlaps a3 the button action of the watch hand won’t work, but the button action of component 3 will work, because component 3 is the higher-layer component tap on the watch hand when it does not overlap component 3 the button action of the watch hand will work, because this area is not covered by any other component example 2 if you want to set the button action on more than two watch hands, then you should be careful about layering the diameter of all watch hands shouldn’t be the same if their pivot points are the same if the diameter is different, then the covered area of the watch hand will be different the idea is that a smaller watch hand should be on a higher layer than the larger watch hand the disjoint area can be a tap area for a larger watch hand however, if you keep the larger watch hand on top, the smaller watch hand will be covered and can’t be tapped see figure 6 in figure 6, the hour watch hand is smaller than the minute watch hand area 2 is the intersected area of these two hands, and area 1 is a disjoint area of the minute watch hand if the hour watch hand is on the higher layer, area 2 is the covered area for the hour watch hand if you tap on the minute watch hand in area 2, no action occurs the button action of the minute watch hand will work in area 1 only
Develop Health
docsamsung health data sdk samsung health app offers various features to measure user’s health data it enables the user to automatically record a range of activities with a galaxy watch and any connected accessories this includes checking daily steps, heart rate, sleep, nutrition, and many other lifestyle metrics samsung health data sdk enables access to health data in samsung health app an app using the sdk can access selected health data of the samsung health’s data store health data in the samsung health app can also be collected from connected devices, like the galaxy watch or galaxy ring, which automatically transfers its data to a paired mobile phone’s samsung health app samsung health data sdk advantages reliable and rich data samsung health saves valuable health data about users' activities, rest, and healthcare and helps analyze user`s health more accurately and extensively the data collected from the sensors on smartphones or galaxy wearables is particularly reliable step count and sleep data are examples of health metrics measured by device sensors skin temperature and blood oxygen levels are continuously measured while the user sleeps high productivity samsung health data sdk's apis are easy to use and intuitive by leveraging these apis, developers can seamlessly integrate the sdk into their own health services while minimizing the effort required for implementation the sdk offers streamlined query for health data by utilizing essential filters, apps can easily access the specific health data they require we also provide powerful aggregate functions to each data type these functions enable developers to obtain meaningful values for a particular data type, eliminating the need for complex processing across multiple sources for example, total steps from multiple devices data security and privacy samsung health makes sure that data remains secure at all times samsung devices have an additional layer of data security, provided by knox access to each data is carefully regulated, not only through user permissions but also in line with our sdk service policies read data types provided samsung health data sdk supports various read data types activity summary active calories burned goal active time goal blood glucose blood oxygen blood pressure body composition body temperature energy score exercise exercise location floors climbed heart rate nutrition nutrition goal skin temperature sleep sleep goal steps step goal water intake water intake goal user profile write data types provided samsung health data sdk supports various write data types blood glucose blood oxygen blood pressure body composition body temperature exercise exercise location floors climbed heart rate nutrition sleep water intake restrictions samsung health data sdk requires samsung health v6 30 2 or higher version installation samsung health runs on devices with android 10 api level 29 or higher it is available on all samsung smartphones and also non-samsung android smartphones the sdk doesn’t support an emulator measured data by samsung health data sdk is for fitness and wellness only, not for the diagnosis or treatment of any medical condition sdk download you can download samsung health data sdk below to use the sdk's apis in your app, please also check the app development process samsung health data sdk v1 0 0 1 81 mb experience samsung health data sdk get hands-on experience with the samsung health data sdk using our interactive code labs head over to code lab to get started code labsamsung health data sdk, samsung health, galaxy wearables build a health app with steps from samsung health code labsamsung health data sdk, samsung health, galaxy wearables access rich sleep data from samsung health more content
Learn Code Lab
codelabdesign a watch face with customizable edge complication slots and digital clock objective learn how to add customizable edge complication slots and a digital clock on your watch face using watch face studio overview watch face studio is a graphical authoring tool designed to help users create watch faces for the wear os smartwatch ecosystem, including the galaxy watch4 and its newer versions it offers intuitive and user-friendly features for designing visually appealing and customizable watch faces without requiring coding skills with watch face studio, users can incorporate various components into their watch faces, such as digital clocks these clocks can be designed with different variations and further customized through the galaxy watch interface in addition to digital clocks and other watch face components, users can integrate complications into their designs complications display information from data sources, such as battery indicators or step counts, directly on the watch face you can display additional information on the watch face by adding a complication slot a complication slot consists of complication components and a slot bound the components implement the layout, while the slot bound acts as a cutout through which the complication component appears there are five types of complication slots circle, line, small box, large box, and edge this code lab focuses on adding edge complication slots to your watch face starting from watch face studio 1 8 7 beta , users can define all supported font styles for digital clocks that can be customized on the physical watch the studio also added a feature allowing users to design watch faces with edge complication slots set up your environment you will need the following watch face studio latest version galaxy watch4 or newer smartwatch running on wear os api 34 or higher sample project here is a sample project for you to start coding in this code lab download it and start your learning experience! customizable edge complication and digital clock sample project 363 7 kb start your project to load the sample project in watch face studio click open project locate the downloaded file and click open the sample project includes a background image that you can customize by adjusting the hue, saturation, lightness, or opacity to suit your preference add edge complications to the watch face there are two types of edge complication slots that you can add to the watch face duo and quadrant both appear along the edge of the watch face duo edge complication slot - composed of right and left edge complications quadrant edge complication slot - composed of right top, right bottom, left bottom, and left top edge complications you can only select one type per project to fit the design of the sample project, add a quadrant edge complication slot click add component then, in the complication slot section, select edge > quadrant noteyou cannot change the placement, dimension, or rotation angle of an edge complication slot however, you can delete or hide unused complications from the layer list, expand the quadrant edge complication layer select the right top edge complication and the left bottom edge complication right-click and choose delete notealthough you have already deleted a complication slot, it can still be restored to do this, right-click on the quadrant edge complication layer in the layer list and select the option to add the previously deleted complication back configure complications after adding the edge complication slots, you can configure its settings from the layer list, click the right bottom edge complication to edit its properties in the properties pane, go to complication settings and choose the following type fixed default provider watch battery complication type range value range value complication layout progress bar + icon + text notesetting the complication as fixed limits the data and provider to the values you defined customization of this complication on the physical watch or wearable app is not possible to test the complication, go to the run pane and adjust the watch battery slider the bar indicator updates based on the value of the watch battery next, go to the properties of the left top edge complication and choose the following for complication settings type editable supported types short text default provider step count short text complication layout icon + text + title to test the complication, go to the run pane and adjust the step count slider the complication text changes as you change the value of the slider you can also adjust the properties of each complication component for example, when you open the properties of title, you can change its text color add a variable digital clock there are two ways to display a digital clock on watch faces using a variable digital clock and a non-variable digital clock to understand the concept of these two types, start by adding a variable digital clock component to display hours and a colon go to add component > digital clock > variable select colon and h h for the hour adjust the placement and rotation angle of both components to complement the design with a variable digital clock, you can customize each subcomponent creatively for example, you can make the font of the first digit of the hour h10 bigger than the second digit h or place them in different positions adjust the properties of the first and second digits of the hour to have the same font size but with slightly different color tints h10 color #f5f680ff font size 70 h color #fde997ff font size 70 on the other hand, a non-variable digital clock is less flexible but acts as a single component, making it ideal for simpler watch faces to add a non-variable digital clock to display minutes go to add component > digital clock > mm adjust its placement, rotation angle, and text color to complement the design use bitmap font for minutes watch face studio supports the use of truetype and bitmap fonts by default, all text-based components, such as digital clocks, use truetype fonts truetype is the most common font format, utilizing vector-based outlines to define characters bitmap fonts, on the other hand, consist of fixed-size, pixel-based representations of characters, which have smaller file sizes and render directly as pixels, offering faster performance on low-power devices in watch face studio, bitmap fonts are used to replace predefined dynamic content, such as dates, time, and weather, in text and digital clock components this allows you to incorporate custom visual elements that align with your creative vision while maintaining functionality to use bitmap font on your watch face, follow these steps select mm from the layer list go to properties > font setting and select bitmap font click the gear icon to open the bitmap font setting for bitmap font 1 set the default font size to 50 click the + icon to add and assign bitmap images for each digit locate your bitmap images, select the image for the corresponding digit, and click open once you're done adding and assigning bitmap images for each digit, click ok to display the bitmap font as minutes noteyou can also add more bitmap fonts by opening the dropdown menu and selecting add bitmap font make the font style of the digital clock customizable to make the digital clock more customizable, you can apply styles use the style tab to define font styles for a digital clock layer this provides users with more customization options for their watch face noteyou can apply styles to digital clock fonts and image-based layers for detailed information, refer to the style tab documentation from the layer list, choose variable_hh > h10 and go to the style tab click the + button in truetype font to add font styles add fonts with bold font weights such as montserrat-bold, oswald-bold, and roboto-bold then, click the customization editor button in the style set pane, click the text id button beside id_system_style_set click the add new button to add a new text id then, input the following id id_h10_font default value 1st digit hour font then, select the newly added text id this helps users identify which components they are changing when customizing the style on a physical watch repeat the same process for h, and this time, add fonts with a medium font weight for the text id, input the following id id_h_font default value 2nd digit hour font next, add styles to a layer that uses a bitmap font select mm from the layer list and go to the style tab click the + button in bitmap font, then select add bitmap font to add and assign bitmap images for each digit set default font size to 50 click ok and input the name of your bitmap font then, click the customization editor button and modify the text id of the newly added style set using the following values id id_mm_font default value minute font to test the font styles you set, go to the run pane and choose font styles from the dropdown menu this allows you to preview how the selected styles will appear on the watch face tipyou can merge the styles by navigating to the customization editor select the style sets you want to merge, right-click, and then choose merge set test the watch face in the run pane click the preview watch face icon move the step count and watch battery sliders to see data changes in the edge complications as previously mentioned, to observe changes in the digital clock, adjust the time slider and select the font styles from the dropdown menu in the style section to test your watch face on a smartwatch, you need to connect your watch to the same network as your computer in watch face studio, select run on device select the connected watch you want to test with if your watch is not detected automatically, click scan devices to detect your device or enter its ip address manually by clicking the + button when the watch face is launched, touch and hold the watch screen to access the edit mode tap customize to choose font styles and complications notethe always-on display is already set in the project to run the watch face successfully, you may need to configure its always-on display to avoid any error when you click run on device you're done! congratulations! you have successfully achieved the goal of this code lab now, you can design a watch face with customizable edge complication slots and digital clock using watch face studio! if you’re having trouble, you may download this file customizable edge complication and digital clock complete project 420 8 kb to learn more about watch face studio, visit developer samsung com/watch-face-studio
technical_insights cloud services, account management
blogsamsung account is a global account service that brings the samsung universe together, from all samsung services to online and offline stores. it handles large-scale traffic with security and reliability. as a core samsung service, all tasks on samsung account, from general service deployments to cloud infrastructure upgrades, must be carried out without interruption to the service. this blog introduces the architecture designed for an elastic kubernetes service upgrade and shares our experience with upgrading the cloud infrastructure without interruptions to the high-traffic samsung account service. what is samsung account? samsung account is an account service that brings together more than 60 services and applications in 256 countries with over 1.7 billion user accounts. it is used for samsung electronics services including samsung pay, smartthings, and samsung health, as well as for authentication on various devices such as mobile, wearable, tv, pc, etc. samsung account helps deliver a secure and reliable customer experience with one account on a variety of contact points from online stores (such as samsung.com) and offline stores to our customer services. evolution of current samsung account architecture as the number of user accounts and connected services has grown, the infrastructure and service of samsung account has also evolved. it switched to the aws-based cloud for service stability and efficiency in 2019, and is currently servicing 4 regions: 3 global regions (eu, us, ap) and china. currently, samsung account consists of more than 70 microservices. in 2022, samsung account switched to the kubernetes base in order to reliably support microservices architecture (msa). kubernetes is an open-source orchestration platform that supports the easy deployment, scaling, and management of containerized applications. in 2023, samsung account reinforced disaster recovery (dr) to be able to provide failover across global regions, and expanded the ap region to improve user experience. in other words, samsung account has repeatedly evolved its infrastructure and services, and is currently running stably with traffic over 2.7 million requests per second (rps) and over 200k db transactions per second (tps). each aws-based samsung account region, with its own virtual private cloud, (vpc) is accessible through user devices, server-to-server, or the web. in particular, the web access provides a variety of features such as samsung.com and tv qr login on aws cloudfront, a content delivery network (cdn). samsung account microservices are being serviced on containers within elastic kubernetes service (eks) clusters, and internal communication between regions uses vpc peering. samsung account is using several managed services from aws to deliver various features. it is using aurora, dynamodb, and managed streaming for apache kafka (msk) as storage to build data sync between regions, and it provides account services based on different managed services including elasticache, pinpoint, and simple queue service (sqs). let's elaborate on the aws managed services that samsung account uses. the first is eks, which is a kubernetes service for running over 70 microservices on msa. next, aurora is used to save and query data as an rdb and dynamodb does the same but as a nosql database. along with them, elasticache (redis oss) is used to manage cache and sessions and msk handles delivering events from integrated services and data sync. if you’re building an aws-based service yourself, you would probably use these managed services as well. frustrating upgrades contrasting the convenience of managed services there is a major challenge to consider when you use these managed services, though. end of support comes, on average, after 1.5 years for eks and 2 years for aurora. various other services like elasticache and msk face the same problem. such service support termination is natural for aws, but upgrading these services when support ceases is often a painful task for those running them. because operation resources are often reduced upon switching to the cloud, large-scale upgrades that come around every 1 or 2 years have to be performed without enough resources for emergency response. these managed service upgrades put a major burden on samsung account. more than 60 integrated services have to be upgraded without causing interruptions, and the upgrades must be rolled out across a total of 4 regions. on top of that, samsung account is developing and running more than 70 microservices, so a significant amount of support and cooperation from development teams is required. the most challenging of all is that the upgrades need to be performed while dealing with traffic of over 2.7m rps and db traffic of 200k tps. eks upgrade sequence and restrictions you might think upgrading eks on aws is easy. in general, when upgrading eks, you start with the control plane including etcd and the apis that manage eks. afterwards, you move to the data plane where the actual service pods are on, and finally to eks add-ons. in theory, it is possible to upgrade eks following this sequence without any impact to the service operation. however, there are restrictions to general eks upgrades. if an upgrade fails in any of the 3 steps above due to missing eks api specs or incompatibility issues, a rollback is not available at all. in addition, it is difficult to do a compatibility check for the services and add-ons in advance. multi-cluster architecture for non-disruptive eks upgrades after much thought, samsung account decided to go with a simple but reliable option to perform eks upgrades. it's possible that many other services are using a similar way to upgrade eks or run actual services. samsung account chose to upgrade eks based on a multi-cluster architecture with 2 eks clusters. the architecture is built to enable an existing eks version to continue providing the service, while a new eks version on a separate cluster performs a compatibility validation with various microservices and add-ons before receiving traffic. the advantage of this method is that you can implement a rollback plan where the old eks version takes over the traffic if any issues occur when switching to the new eks version. a lesson we have learned from providing the samsung account service under high traffic is that there will be issues when you actually start processing traffic, no matter how perfectly you've built your infrastructure or service. for these reasons, it is essential to have a rollback plan in place whenever you deploy a service or upgrade your infrastructure. when you perform a multi-cluster upgrade, traffic must be switched between the old and new eks clusters. simply put, there are 2 main approaches. one approach is to switch traffic by placing a proxy server between the 2 clusters. the other approach is to switch the target ip using dns. needless to say, there may be a variety of other ways to accomplish this. in the first option, using a proxy server, you may encounter overload issues when handling high-volume traffic, such as with samsung account. additionally, there are too many application load balancers (albs) used for approximately 70 microservices, making it impractical to create a proxy server for each alb. in the second option, using dns, the actual user, client, and server replace the service ip of the old eks with that of the new eks during a dns lookup, redirecting requests to a different target at the user level. the dns option does not require a proxy server, and switching traffic is easy by simply editing the dns record. however, there is a risk that the traffic switch might not happen immediately due to propagation-related delays with dns. the dns-based traffic switch architecture was applied to achieve a non-disruptive eks upgrade for samsung account. let us describe the dns layers of samsung account with a hypothetical example. the top domain is account.samsung.com, and there are 3 global region domains under it, classified based on latency or geolocation. for us.account.samsung.com, the layers are split into service.us-old-eks.a.s.com and service.us-new-eks.a.s.com, representing the old and new domains. this is a simple, hypothetical example. in reality, samsung account uses more dns layers. during the recent eks upgrade, we switched traffic between the internal domains of the 2 eks clusters based on weighted records while adjusting the ratio, rather than switching all at once. for instance, when a user sends a request to account.samsung.com, it goes through us.account.samsung.com, and the actual eks service ip is applied at the end based on the specified weight. retrospective of the non-disruptive eks upgrade in summary, i would say "it's a successful upgrade if the connected services haven't noticed." with this eks upgrade, we deployed and switched traffic for a total of 3 regions, 6 eks clusters, and more than 210 microservices over the course of one month. the traffic switch was conducted with ratios set based on each service's load and characteristics, and no issues with connected services were reported during this one month eks upgrade. of course, as they say, "it's not over until it's over." we did have a minor incident where there were insufficient internal ips in the internal subnet due to many eks nodes and service pods becoming active simultaneously, which scared us for a moment. we secured the ip resources by reducing the number of pods for kubelet and add-ons by about a thousand and quickly scaling up the eks nodes. one thing we realized while switching traffic with dns is that 99.9% of the entire traffic can be switched within 5 minutes when the dns weight is adjusted. closing note richard branson, co-founder of virgin group, once said, "you don't learn to walk by following rules. you learn by doing, and by falling over." samsung account has been growing and evolving, addressing many bumps along the way. we continue to resolve various challenges with the stability of our service as the priority, keeping this "learning while falling over" spirit in mind. thank you.
Je-Min Kim
Design One UI Watch for Tizen
docwidgets widgets provide easy access to frequently used tasks or content and are useful when users are engaged in other activities or unable to provide precise control of their watch users can access any app’s key features without launching the app make sure you understand how different types of widgets work and the widget designs that are best suited for your app you can also design widgets in web or native languages see creating your first tizen wearable native widget application for more details on native apps and creating your first tizen wearable web widget application for web apps basics design widgets to fit on one page widgets occupy the whole screen design a widget to occupy a single page without scrolling widgets only take a single tap tapping is the only gesture widgets use to perform a task or open an app one app can have multiple widgets for different purposes widgets refresh automatically permissions user permission may be required to display widget information users can modify permission settings in settings > apps > permissions if a user does not agree to grant permission, you must provide an additional notification screen that states permission is required in order to view widget information the screen needs to provide the app name, the widget name if the app has two or more types of widgets , and a link to the permission pop-up tip users can add up to 15 favorite widgets on the widget board, located to the right of the watch face users can manage widgets by touching and holding on any widget screen they can rearrange the order by dragging widgets to the desired position, and add or remove them by tapping the corresponding buttons you can provide a link to the widget’s edit screen using the edit button embedded in the screen in this case, the edit screen must be provided independently the edit function is currently only provided for native widgets see configuring the application manifest for more details on configuring the edit screen if an app is uninstalled, all related widgets are also removed types of widgets three widget types are available for the watch informative widgets that deliver information from the parent app interactive widgets that deliver information and receive user input shortcut widgets that provide a link without exchanging any data with the app choose the right widget type for the content you want to offer informative widgets informative widgets provide information in a scannable way design your widgets to display key information on a single screen without scrolling and provide users with a direct route to more detailed information within the related app providing an appropriate image can enhance readability interactive widgets interactive widgets perform simple tasks that can be completed with one tap ensure that your components are designed intuitively so that users notice they are tappable widgets should immediately reflect any user input in real time and make it clear that user input has been recognized shortcut widgets shortcut widgets provide quick access to frequently used menus or tasks shortcuts should use appropriate icons and text to communicate where they lead when providing multiple shortcuts on one screen, ensure each one is visible and has a sufficient touchable area types of actions a single tap, the only gesture allowed for widgets, is used for two types of actions links and direct actions links connect users to an app's menu and direct actions perform a task on the widget link links can connect users directly to the first screen or a particular menu of an app the link can make up the whole screen or be shown as a button direct action direct actions perform simple tasks without opening the app you can use direct actions for tasks such as measuring data or toggling an alarm common use cases here are some common use cases that will help you design your widgets filling empty widgets some widgets need to be filled with content by users when creating widgets like these, include an “add” button instead of leaving the screen empty multiview widgets each widget should present just one piece of information on each screen, but you can break the information up across several views that users can browse through in these cases, dim and turn off the browsing button when there are no more views in a particular direction check your phone widgets can redirect users to another device, such as a phone if your widgets support this feature, use a phrase like "check your phone" to indicate this action design your widgets keep the visual principles for color, layout, and typography in mind when you’re designing your widgets make your widgets readable with a dark background a dark background works best for widgets it increases screen readability when outdoors and smoothly integrates the widget with the black bezel we recommend using a transparent background, but if you are using a colorful image, add a tinted black layer on top at least 60% opacity to ensure the text is legible maintain visual identity with an identity color applying the primary color of your app to the main text can communicate a strong visual identity consider readability when you choose your app identity color use breeze sans use the system font breeze sans to optimize readability on the watch and make your app consistent with others breeze sans comes in condensed, regular, and medium fonts determine the weight of the font according to the relative level of importance of the text see visual design for more details on breeze sans
Connect Samsung Developer Conference
webtech sessions dive into the future of connected customer experiences through tech sessions by developers offering further insight into the innovations introduced in the keynote filter filter filter all reset apply there are no results. sessions contents & service, open innovation 8k visual quality and ecosystem in this session, we will present how the genuine 8k contents correctly displayed on 8k display devices could deliver our customers an immersive picture quality experience. we will start with a summary of the previous studies about user perceptions regarding the 8k visual quality. we then will explain why the full-frequency 8k contents are superior to the lower resolution in producing fine details on the image. we will also discuss some technical challenges we face toward adopting and utilizing 8k contents in a real-world environment and describe how we can overcome these hurdles. specifically, we will discuss technologies such as super-resolution and new image sensors to overcome the full-frequency barrier of 8k content. last, we will introduce the 8k association (8ka), a non-profit organization composed of key technology companies in the consumer and professional 8k ecosystem, and briefly mention 8ka's ongoing effects on the research, standardization, and promotion of 8k visual quality. sessions contents & service, developer program, mobile add samsung pay as your payment method in this session, we will share learnings from our experience developing the samsung pay mobile payment service, revealing insights that can be applied to your own platforms. we will also take a look at the samsung pay development kit and how you can use this for your own service. sessions game, ar, mobile ar emoji: your avatar, your experience the ar emoji feature on samsung devices enables users to create a 3d avatar model that can be used in other applications. similar to avatars currently available in games or in the metaverse, our ar emojis are a chance for users to express themselves, their style and their personality, digitally. but this is only the beginning. in this session, we’ll explore the future of ar emojis and how the ar emoji sdk is opening more opportunities for developers to collaborate with samsung to bring to life new services featuring these avatars and optimize them for the metaverse though our collaboration with unity. sessions ai, iot, smart appliances bixby 2022 what’s new what’s new with bixby in 2022? in this session, you will hear about some of the exciting improvements to the nlu and on-device bixby as well as updates to the bixby developer studio, which introduces a brand new javascript runtime that provides a modern, secure, high-performance environment. we will also take a closer look at the brand new bixby home studio, which allows smart device developers to customize and optimize voice control of smart devices, including allowing a single command to intelligently control multiple smart home devices. sessions contents & service, game creating spectacular galaxy game audio experiences with dolby atmos galaxy smartphones and tablets can produce spectacular game audio with dolby atmos. discover how you can create deeper emotional connections with players, keep them playing for longer, and earn their loyalty by unleashing the full power of samsung galaxy mobile game audio. in this session you will hear from dolby’s partner audiokinetic who will discuss how developers can make dolby atmos games, including a walkthrough of how to use dolby atmos plug-ins in audiokinetic's wwise audio middleware. moong labs – creators of epic cricket one, of india's most popular sports games – will also share how dolby atmos benefitted their game and you will find out how dolby supports game developers and other activities on our website. sessions health, wearable expand health experiences with galaxy watch the galaxy watch’s powerful bioactive sensor, together with the wear os powered by samsung, is transforming mobile health experiences. and now, this technology is even more powerful thanks to the samsung privileged health sdk. find out how the samsung privileged health sdk is allowing developers to retrieve raw or analyzed sensor data for their applications, including bia, ecg, blood oxygen level or sweat loss, and help users’ to accurately monitor their health stats. sessions web flexible and private web experience on samsung internet in this session, you will learn how to enhance and optimize your web experience for foldable devices using device posture api and viewport segment media query. we'll also take a closer look at how samsung internet protects users’ privacy online. sessions mobile, enterprise, developer program google and samsung strengthen enterprise ecosystem together samsung’s global mobile b2b team is working closely with the android enterprise team to build a galaxy ecosystem of partners who are bringing innovation into workplaces. discover how partner solutions create unique experiences on samsung devices and how we plan to work together to help future partners step into the samsung android ecosystem for enterprises and smbs. sessions contents & service, developer program, enterprise hdr10+/salt and automatic hdr video creations for productions hdr10+ is an essential technology for premium hdr viewing experience and it is widely reach to consumer displays including mobile devices. in order to provide hdr content services, it requires changing service provider's infra structure or workflows and video processing technology from sdr to hdr with a lot of engineering efforts. then, hdr10+/salt solutions and partnership program from samsung is designed to build an extremely cost effective automatic solution up for content creators, post production houses and ott service providers even including game developers. the solution package is designed with various standalone applications, reference apps, sdks on various oses and partnership programs to help 3rd parties for creation of hdr contents. hdr10+/salt partnership program provides full compatibility to hdr10+ llc certification program and major studios, ott service providers and tool makers are already partners of the program and samsung provides them the best hdr content quality. sessions developer program, open innovation, health healthcare research hub our open source project provides end-to-end solutions such as sdk, platform, and portal for various use cases from medical research studies to clinician services using wearable devices. medical research does not have to stay complicated. anyone can easily build and customize their own research studies or clinician services using this open source. recently, as the accuracy of sensors installed on wearable devices has improved, interest in healthcare research using wearable health data is increasing. however, it takes a lot of time for researchers to develop research applications and server infrastructure for storing and analyzing data from scratch. sr is developing android sdk and data platform solutions that support healthcare research using health data from our wearable devices (watch 4 and later versions) and provide them as open source in order to solve the pain points of these researchers and establish a digital health care research ecosystem centered on our wearable devices. sessions iot, monetization, smart appliances home connectivity alliance introduction of home connectivity alliance and how appliance manufactures can enable interoperability across brands. hear how hca interoperability can benefit consumers and partners including b2b (home builders, mfu, etc). join the hca and become a leader in innovation within the connected iot ecosystem. sessions ai, ar immersive audio we will demonstrate an audio system with dramatically improved immersive 3d audio experience. hardware will be similar to samsung’s critically acclaimed hw-q990b soundbar, but will include several new technologies that will be found in future samsung products. these technologies automatically correct for room acoustics and the location of the listeners and loudspeakers. visitors will compare the sound of the system before and after the system’s unique automated calibration process. listeners will enjoy improved spatial and timbral performance in stereo, surround and immersive audio formats with both music and cinematic content. sessions security & privacy introducing blockchain wallet with knox vault in this session, we introduce blockchain wallet for samsung smart tv. blockchain wallet allows our smart tv users to manage their blockchain accounts and transfer their cryptocurrency to another blockchain account. it ensures to retain a key for blockchain transactions in a secure way. dapp developers can build their tv dapp with blockchain wallet for blockchain functions such as blockchain connection and transaction signing. knox vault is an enhanced hardware-based security solution to protect sensitive data such as cryptographic keys, passwords and personal data. knox vault provides strong security guarantees against hardware attacks such as physical attack, side-channel attack and fault attack. as a core component of the knox security platform, knox vault is an isolated, tamper-proof, secure subsystem with its own secure processor and memory. sessions developer program, enterprise, android introducing samsung galaxy camera ecosystem discover how advanced camera technologies, based on samsung’s leading hardware and software, can enable developers to create more powerful camera experiences for their users. we will take a look at some of the incredible partnerships samsung has already formed with numerous app developers and reveal how these collaborations enriched users’ camera experiences. sessions mobile, android, productivity intuitive multitasking experience based upon android 12l join us to see how samsung continues to enhance the large screen user experience further with fast app switching and intuitive multitasking capabilities. to maximize the galaxy foldable experience, we're expanding flex mode even further with more apps and partners as well as google's ongoing collaborative effort in android 12l. sessions iot, mobile, uwb joint efforts on standardization toward open ecosystem of uwb services the presentation will introduce samsung's joint efforts with industry partners on the uwb tech/service standardization, which is essential for creating an interoperable open ecosystem of uwb products and services. especially, it will introduce activities at fira consortium, which was established by samsung jointly with industry leaders to provide interoperability specifications as well as certification programs. it may also include target uwb services and relevant standardization status & plan. sessions ar, game, tizen journey to immersive interactive exp in big screen with xr and avatar fw xr framework webapis enable developers to build xr applications on the tizen platform. we will go over features of the webapis, share some demos, and provide information on how to get started. additionally we will show you a sample code of how to capture and handle user's gestures and full body movement. avatar framework for tizen is a unified solution providing high level apis that allow samsung developers to easily include the 3d avatar models and features in their samsung tv applications. we will go over all the cool features and options of our framework in this video. sessions connectivity, android, mobile le audio: the future of wireless sound introducing le audio: a new standard for bluetooth technology on galaxy devices. le audio will enhance the performance of classic bluetooth audio and introduce isochronous communication, creating whole new wireless audio experience on galaxy devices. in this session, we will introduce the technical features of le audio, what it means for the galaxy ux and how you could enhance wireless audio experience of your app with le audio. sessions design, ui/ux one ui design principles in partnership one ui creates a unified experience across our galaxy devices, from phones and tablets to watches and galaxy books. in creating and refining one ui, we've followed four key principles: simplicity, effortlessness, consistency, and authenticity. with one ui, we've also made a commitment to openness, which means some of the best things in one ui come from partnerships. in this session, we'll talk about some of those partnerships and how we aligned them with our four design principles to get great results. sessions ui/ux, design, android one ui: customer centric design one ui starts with a true understanding what our customers want. hear more about what samsung have learned from listening to extensive customer feedback and usage data, and how we have adapted our designs in response. we'll take a look at some real-life examples of how the ux design of the calendar, settings and samsung health app has evolved over time to better meet customer needs. sessions enterprise, data, security & privacy our journey to responsibly handling data at samsung, we place personal data protection as one of our top priorities. learn how we responsibly handle personal data in our applications and platforms. we'll share with you our journey in protecting personal data. we'll talk about what it means to responsibly govern and access data in samsung's enterprise environment. we'll cover specifics on how to classify & protect data as a whole. pick up insights on privacy technologies and design patterns we apply in our data intensive applications today. sessions developer program, tizen, ui/ux prism: the new ux development tool and process in today’s environment of rapid and unpredictable transformation, establishing a creative and increasingly collaborative tech culture is one of the most challenging requirements. in this session, we would like to introduce a new method to revolutionize the tizen platform-based app development process. a new development process named prism automates most of the inefficient overheads from design to implementation of app ui, innovatively improving app development productivity. we will introduce prism-based development process and deliver this innovative app development culture to developers through the sessions. sessions developer program, smart appliances, tizen remote test lab: what’s new in tv development environment the current tizen tv development environment, represented by emulator and tv, is a very limited support method for developers. depending on the version of emulator, the latest features currently supported by the tv may not be available, and various models of physical tvs may be required to verify actual operation. rtl tv tries to overcome the limitations of the current development environment. sessions contents & service, monetization, data samsung tv plus: the advanced ad-tech and partnerships that fund free tv samsung’s free ad-supported tv (fast) service “tv plus” has been a breakout success. although it looks and feels like traditional tv, it is anything but! behind the scenes of this slick tv & mobile experience is high-performance technology, vast amounts of data & algorithms, and a thriving partner ecosystem. join this session to learn more about the mind-boggling world of advertising technology, how it works, and how multiple companies come together to provide free tv to millions of consumers worldwide. sessions android, contents & service samsung wallet, it's convenient, personal and safe as the growth of digital wallets skyrockets, samsung recently announced samsung wallet – a new platform bringing almost all of the cards you’d typically find in a physical wallet, as well as important documents, into one easy-to-use and secure mobile application. as samsung wallet rapidly expands its content set, find out more about the future of digital wallets and how open api’s can allow developers to build integrations for this service. sessions iot, security & privacy smartthings edge: the next level experience discover how samsung is transitioning the smartthings-published groovy dths to edge drivers while maintaining a seamless experience for our users. we’ll walk through the process of onboarding edge-based devices and how to set up an automation with an edge device that runs locally. sessions iot, monetization, smart appliances smartthings energy service introduction of smartthings energy service and how partners (energy companies, smart device mfgs, etc) can integrate to provide a seamless energy management service for their consumers leveraging samsung's smartthings energy ecosystem. sessions iot, contents & service, open innovation smartthings find: find alongside 200+ million users smartthings find is samsung’s fastest growing service, powered by more than 200 million galaxy users. discover some of the new features and functions added over the past year and learn how partners can leverage the service to innovate their own solutions to meet the needs of businesses and consumers alike. sessions iot, contents & service, open innovation smartthings platform enhancements for openness and interoperability the smartthings platform continues to evolve to promote openness and interoperability. in this session, we will share some exciting new updates to the smartthings platform to support matter and thread, and discuss the home connectivity alliance. sessions health, tizen telehealth in samsung devices samsung display device (smart tvs & smart monitors) users will be able to launch telemedicine service within the samsung products. once you pick your physician, you can use one of the approved usb cameras to connect to the tv and jump on a video call with a physician via external service provider's built-in web applications. after a few account setup process on mobile / pc, you can easily start your session any time on tv without any additional complicated inputs. at your session, you can also receive a prescription to be filled in at a mail-in online pharmacy (pc or mobile) to receive prescription drugs at your doorstep. sessions open innovation, enterprise, productivity the next generation samsung retail solutions in a mobile-first world, device convergence, simplification, ergonomically designed accessories, sw solutions and the connected galaxy ecosystem are helping to boost productivity and efficiency in the retail industry. in this session, we will explore how the next generation of retail solutions are shaping the industry’s future and will take a closer look at samsung’s three major retail solutions - data capturing, payment, and push-to-talk. sessions developer program, mobile, android the samsung knox partner program: partner success journey the samsung knox partner program (kpp) equips you with everything you need to build ideas and market your mobile solutions. in this session, we will take a look at some of our partners’ solutions and how collaborating with the samsung kpp has helped enhance their user experience. join us to see why kpp is causing a stir in the business developer community! sessions enterprise, tizen tizen everywhere this session highlighted samsung's direction and goals for the enterprise and b2b markets, focused on taking tizen to the next level on so many platforms. various enterpriser displays based on tizen and solutions suitable for business purposes will always be together. tizen enterprise platform will provide all the technology infrastructure you need, including the samsung developers portal for b2b for developer support and the samsung apps tv seller office for custom application support in your own business. after announcing "tizen open" at sdc in 2019, samsung established licensing system to provide tizen tv os to other tv makers. in order for partners to develop tizen tv products faster, samsung prepared reference tv solution. in europe, australia, türkiye, tizen tvs have been released sequentially through more than 10 tv brands since september 22. sessions wearable, design, android watch face studio's first journey and expectation for next a must-have to create beautiful watch faces! watch face studio (wfs) is now a little over a year old. hear the developers of wsh share the highs and lows of bringing the tool to life and meet the designers responsible for creating the eco watch face. this session is an insight into the year-long journey to create wfs – and the story of where we’re going next. sessions iot, tizen, ui/ux what's new in tizen? are you curious about the direction in which intelligent iot platform “tizen” is developing? this session introduces ui assistant technology and extended 3d ui framework for providing advanced user experience, and explains innovative technologies that make run the tizen platform on top of the android hardware abstraction layer to facilitate securing new hws. and introduce the iot standard 'matter', which will be newly supported on tizen. finally, we provide a guide and tip for cross platform application development. sessions ai, iot, smart appliances what’s new in bixby for smart home bixby brings the smart home experience to life with the power of voice. find out how our new tool, bixby home studio, will enable device manufacturers to build more intelligent, more engaging voice experiences for smartthings-connected devices. sessions mobile, design, ui/ux what’s new in one ui 5 one ui 5 pushes personalization and productivity to the next level. explore new features that enable you to build a galaxy experience that reflects your personal style and help you to get more done on all your devices, wherever or whenever you need to.
We use cookies to improve your experience on our website and to show you relevant advertising. Manage you settings for our cookies below.
These cookies are essential as they enable you to move around the website. This category cannot be disabled.
These cookies collect information about how you use our website. for example which pages you visit most often. All information these cookies collect is used to improve how the website works.
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and tailor the website to provide enhanced features and content for you.
You have successfully updated your cookie preferences.