• Learn
    • Code Lab
    • Foldables and Large Screens
    • One UI Beta
    • Samsung Developers Podcasts
  • Develop
    • Mobile/Wearable
    • Galaxy GameDev
    • Galaxy Themes
    • Galaxy Watch
    • Health
    • Samsung Blockchain
    • Samsung DeX
    • Samsung IAP
    • Samsung Internet
    • Samsung Pay
    • Samsung Wallet
    • View All
      • Galaxy AR Emoji
      • Galaxy Accessory
      • Galaxy Edge
      • Galaxy Z
      • Galaxy Performance
      • Galaxy FM Radio
      • Galaxy S Pen Remote
      • Galaxy Sensor Extension
      • PENUP
      • Samsung Automation
      • Samsung Neural
      • Samsung TEEGRIS
      • Samsung eSE SDK
      • Galaxy Watch for Tizen
      • Watch Face Studio
      • One UI Watch for Tizen
      • Galaxy Watch Studio Converter
      • Samsung IAP for Galaxy Watch (Tizen)
    • Visual Display
    • Smart TV
    • Smart Hospitality Display
    • Smart Signage
    • Digital Appliance
    • Family Hub
    • Platform
    • Bixby
    • Knox
    • SmartThings
    • Tizen.NET
  • Design
    • Design System
    • One UI
    • One UI Watch
    • Smart TV
  • Distribute
    • Galaxy Store
    • TV Seller Office
    • Galaxy Store Games
    • Samsung Podcasts
  • Support
    • Developer Support
    • Remote Test Lab
    • Issues and Bugs Channel
    • Samsung Android USB Driver
    • Galaxy Emulator Skin
  • Connect
    • Blog
    • News
    • Forums
    • Events
    • Samsung Developer Conference
    • SDC23
    • SDC22
    • SDC21
    • SDC19 and Previous Events
  • Sign In
Top Global Search Form
Recommendation
  • Blog
  • Code Lab
  • Foldable and Large Screen Optimization
  • Forums
  • Galaxy Emulator Skin
  • Galaxy GameDev
  • Health
  • Remote Test Lab
  • Samsung Developer Conference
  • SDC22
  • Watch Face Studio
All Search Form
Recommendation
    Suggestion
      All Search Form
      Filter
      Filter
      Filter
      • ALL
      • DOCS (100)
      • SDK
      • API REFERENCE
      • CODE LAB
      • BLOG
      • NEWS/EVENTS
      • OTHERS
        api reference code lab blog news/events
      1. Develop
      2. Health

      doc

      Health | Publications

      publications mouth breathing detection using audio captured through earbuds author | tousif ahmed,mahbubur rahman,ebrahim nematihosseinabadi,jilong kuang,alex gao published | international conference on acoustics, speech, and signal processing (icassp) date | 2023.06.25 view more breathie: estimating breathing inhale exhale ratio using motion sensor data from commodity earbuds author | nafiul rashid,mahbubur rahman,tousif ahmed,jilong kuang,alex gao published | international conference on acoustics, speech, and signal processing (icassp) date | 2023.06.05 view more improving heart rate and heart rate variability estimation from video through a hr-rr-tuned filter author | retiree,li zhu,korosh vatanparvar,jilong kuang,alex gao published | international conference on acoustics, speech, and signal processing (icassp) date | 2023.06.04 view more breathing rate tracking using earbuds in uncontrolled environments author | tousif ahmed,mahbubur rahman,mohsin ahmed,ebrahim nematihosseinabadi,jilong kuang,alex gao published | international conference on human factors in computing systems (chi) date | 2023.04.21 view more next-generation smart watches to estimate whole-body composition using bioimpedance analysis: accuracy and precision in a diverse, multiethnic sample author | jonathan p bennett, yong en liu, nisa n kelly, brandon k quon, michael c wong,cassidy mccarthy, steven b heymsfield, john a shepherd published | elsevier, the american journal of clinical nutrition date | 2022.07.26 view more performance evaluation of a wrist-worn reflectance pulse oximeter during sleep author | hyunjun jung, dongyeop kim, wonkyu lee, hyejung seo, jinwoo seo, jongmin choi, eun yeon joo published | elsevier, sleep health date | 2022.07.09 view more atrial fibrillation detection and atrial fibrillation burden estimation via wearables author | li zhu,viswam nathan,jilong kuang,jacob kim,alex gao published | ieee journal of biomedical and health informat date | 2022.05.01 view more validation of blood pressure measurement using a smartwatch in patients with parkinson’s disease author | jong hyeon ahn, joomee song, inyoung choi, jinyoung youn, jin whan cho published | front. neurol date | 2021.06.29 view more a comprehensive approach for classification of the cough type* author | ebrahim nemati, md mahbubur rahman, viswam nathan, korosh vatanparvar, jilong kuang published | ieee engineering in medicine & biology society (embc) date | 2020.07.22 view more deep learning based quantification of ovary and follicles using 3d transvaginal ultrasound in assisted reproduction author | praful mathur, karan kakwani, diplav, srinivas rao kudavelly, ramaraju ga published | ieee engineering in medicine & biology society (embc) date | 2020.07.20 view more coughgan: generating synthetic coughs that improve respiratory disease classification author | vishwajith ramesh, korosh vatanparvar, ebrahim nemati, viswam nathan, md mahbubur rahman, jilong kuang published | ieee engineering in medicine & biology society (embc) date | 2020.07.20 view more adapting to noise in speech obfuscation by audio profiling using generative models for passive health monitoring author | korosh vatanparvar, viswam nathan, ebrahim nemati, md mahbubur rahman, jilong kuang published | ieee engineering in medicine & biology society (embc) date | 2020.07.20 view more coughmatch – subject verification using cough for personal passive health monitoring author | korosh vatanparvar, ebrahim nemati, viswam nathan, md mahbubur rahman, jilong kuang published | ieee engineering in medicine & biology society (embc) date | 2020.07.20 view more smart alarm based on sleep stages prediction author | kostyantyn slyusarenko, illia fedorin published | ieee engineering in medicine & biology society (embc) date | 2020.05.24 view more a generative model for speech segmentation and obfuscation for remote health monitoring author | korosh vatanparvar, viswam nathan, ebrahim nemati, md mahbubur rahman, jilong kuang published | ieee-embs international conference on biomedical and health informatics(bhi) and the body sensor networks(bsn) conferences date | 2019.05.21 view more assessment of chronic pulmonary disease patients using biomarkers from natural speech recorded by mobile devices author | viswam nathan, korosh vatanparvar, md mahbubur rahman, ebrahim nemati, jilong kuang published | ieee-embs international conference on biomedical and health informatics(bhi) and the body sensor networks(bsn) conferences date | 2019.05.20 view more mlung: privacy-preserving naturally windowed lung aclvity deteclon for pulmonary palents author | mohsin y ahmed, md mahbubur rahman, viswam nathan, ebrahim nemati, korosh vatanparvar, jilong kuang published | ieee-embs international conference on biomedical and health informatics(bhi) and the body sensor networks(bsn) conferences date | 2019.05.20 view more

      https://developer.samsung.com/health/publications.html
      1. Develop
      2. Health

      doc

      Health Data Store

      health data store the sdk provides the health data store to access the health data with a user’s consent. the data in the health data store can be shared with other partner apps also. preparing data access an application needs to connect the health data store, and acquire data permission to access the data in the health data store. the following figure shows a basic flow for working with samsung health. in case of connection failure, all exceptions should be handled clearly with a proper message to the user. it helps to prevent unexpected operations on your application. for detailed code, see: app manifest health data connection snippet acquiring data permission snippet health data query healthdataresolver helps to access the data with apis of the following figure. all queries except inserting data can be requested through a filter to set the target range for a query. a data query is sent asynchronously or synchronously. asynchronous query is used usually and you can select one of the methods for your need. see the following examples for more information. asynchronous data query synchronous data query the query result is retrieved as the following table. request result insert()update()delete() baseresult read() readresult aggregate() aggregateresult see data query snippets in api reference. filter healthdataresolver.filter is very useful to clear the data range for reading, updating, and aggregating health data. multiple filters can be combined with: and() or() see more descriptions in api reference. data normalization the health data is stored based on the normalized unit as defined in international system of unit (si) in the following table. item unit height cm weight kg temperature celsius blood glucose mmol/l blood pressure mmhg hba1c % spo2 % calorie kcal speed m/s distance meter time millisecond water intake ml caffeine intake mg data normalization enables your application to read health data without the specific unit. it means that you should be careful to unify the data units when inserting health data to the health data store. healthdataunit helps to convert data value between different units. converting unit

      https://developer.samsung.com/health/android/data/guide/health-data-store.html
      1. Develop
      2. Health

      doc

      Health Data Type

      health data type the sdk provides useful predefined and custom data types. the supported data types are: activity daily step count trend step count exercise floorsclimbed rest sleep sleepstage food nutrition caffeine intake water intake health care body temperature blood glucose blood pressure heart rate oxygen saturation hba1c height weight see api reference for more data types. health document healthdocument environment info ambient temperature and humidity uv exposure user profile user profile (read-only) all data types have the following mandatory properties in the following table. each data type’s detailed properties are written in the api reference. property description uuid id of health data.assigned by the system when new data is created in samsung health. created_time utc time when data is created.assigned by the system when new data is created in samsung health. updated_time utc time when data is updated.assigned by the system when new data is created in samsung health. package_name application package name which provides data.assigned by the system when new data is created in samsung health. device_uuid device id which provides health data.

      https://developer.samsung.com/health/android/data/guide/health-data-type.html
      1. Develop
      2. Health

      doc

      Health Connect FAQ

      health connect faq to access samsung health data can i access samsung health data with health connect? yes. samsung health synchronizes data with health connect since version 6.22.5 (october 2022) and later. to read samsung health data or insert your application data to samsung health through health connect apis, data permission must be granted for health connect. health data from the galaxy watch is transferred to the samsung health application on the user’s smartphone and synchronized to health connect. for more information, see accessing samsung health data through health connect. which devices does health connect support? the health connect application can be installed on android mobile devices. it does not support wear os devices. which data types are synchronized between samsung health and health connect? activity data, such as steps and exercise, heart rate, and sleep, are synchronized between samsung health and health connect. for more information, see accessing samsung health data through health connect. can health connect read data from a galaxy watch? yes, indirectly. health data on the galaxy watch is sent to the samsung health application on the user’s smartphone and can be synchronized to health connect. for battery life reasons, the timing and frequency of data synchronization between the galaxy watch and samsung health follows its own policy. on the smartphone, if samsung health and health connect have been linked for data synchronization, samsung health inserts or updates its data to health connect as soon as data is created or changed. for more information, see the accessing samsung health data through health connect blog post. i cannot see samsung health data in health connect. what should i do? to make sure that data synchronization between samsung health and health connect is working correctly: in google play, check that the latest samsung health and health connect application versions are installed. if you want to access galaxy watch data, check the samsung health application version on the watch too. enable data permissions in the samsung health application. in samsung health, go to ”settings > health connect > app permissions > samsung health”. noteyou must enable the permissions through samsung health > settings > health connect, not through the phone settings > apps > health connect. in samsung health, go to “settings > sync with samsung account” and tap “sync now” .

      https://developer.samsung.com/health/health-connect-faq.html
      1. Develop
      2. Health

      doc

      Health Device Specs

      health device specs all samsung health device specs | apr 11, 2019 samsung health provides ble compatible guidelines and samsung health specifications to connect ble health devices with samsung health. ble compatible guidelines the following health devices can connect with samsung health through ble compatible guidelines. compatibility guideline - ble blood pressure monitors | v1.0 compatibility guideline - ble glucose meters | v1.0 compatibility guideline - ble heart rate monitors | v1.0 compatibility guideline - ble weight scales | v2.0 samsung health specifications the following health devices can connect with samsung health through samsung health specifications. samsung health specifications - ble enhanced heart rate monitors | v1.0 samsung health specifications - ble exercise monitors | v1.0 samsung health specifications - ble pedometers | v1.0 samsung health specifications - ble sleep monitors | v1.0 samsung health specifications - ble multiple health service device | v1.0 if a health device implements one more specs above ble multiple health service device specs should be applied together.

      https://developer.samsung.com/health/device/device-specs.html
      1. Develop
      2. Health

      doc

      Hello Health Data

      hello health data the following sections give you fundamentals for developing the samsung health's partner app. check first the development environment for samsung health's partner apps. importing library add the following library to the “libs” folder in your created application project. samsung-health-data-a.b.c.aar health data store connection add a <queries> element in your app manifest. <manifest . . . > <queries> <package android:name="com.sec.android.app.shealth" /> </queries> </manifest> connect to the health data store with healthdatastore. public class mainactivity extends activity { public static final string app_tag = "simplehealth"; private static mainactivity minstance = null; private healthdatastore mstore; private healthconnectionerrorresult mconnerror; private set<permissionkey> mkeyset; @override public void oncreate(bundle savedinstancestate) { // ... minstance = this; mkeyset = new hashset<permissionkey>(); mkeyset.add(new permissionkey(healthconstants.stepcount.health_data_type, permissiontype.read)); // create a healthdatastore instance and set its listener mstore = new healthdatastore(this, mconnectionlistener); // request the connection to the health data store mstore.connectservice(); } you can end the health data store connection when the activity is destroyed. @override public void ondestroy() { mstore.disconnectservice(); super.ondestroy(); } the connection result is sent to healthdatastore.connectionlistener. if it succeeds, acquiring data permission or querying data will be available. private final healthdatastore.connectionlistener mconnectionlistener = new healthdatastore.connectionlistener() { @override public void onconnected() { log.d(app_tag, "health data service is connected."); healthpermissionmanager pmsmanager = new healthpermissionmanager(mstore); try { // check whether the permissions that this application needs are acquired // request the permission for reading step counts if it is not acquired // get the current step count and display it if data permission is required // ... } catch (exception e) { log.e(app_tag, e.getclass().getname() + " - " + e.getmessage()); log.e(app_tag, "permission setting fails."); } } @override public void onconnectionfailed(healthconnectionerrorresult error) { log.d(app_tag, "health data service is not available."); showconnectionfailuredialog(error); } @override public void ondisconnected() { log.d(app_tag, "health data service is disconnected."); } }; the connection to the health data store can fail and you can check its error result through onconnectionfailed(). if there is an error, an application checks whether the health framework provides a solution with hasresolution() and calls resolve(). if the health framework provides its solution, resolve() makes an application move to one of the following page without a dialog message: app market's samsung health page to install or update it device's settings page to make samsung health available samsung health user's agreement page an application needs to show a proper message for each error case and call resolve(). private void showconnectionfailuredialog(healthconnectionerrorresult error) { alertdialog.builder alert = new alertdialog.builder(this); mconnerror = error; string message = "connection with samsung health is not available"; if (mconnerror.hasresolution()) { switch(error.geterrorcode()) { case healthconnectionerrorresult.platform_not_installed: message = "please install samsung health"; break; case healthconnectionerrorresult.old_version_platform: message = "please upgrade samsung health"; break; case healthconnectionerrorresult.platform_disabled: message = "please enable samsung health"; break; case healthconnectionerrorresult.user_agreement_needed: message = "please agree with samsung health policy"; break; default: message = "please make samsung health available"; break; } } alert.setmessage(message); alert.setpositivebutton("ok", new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int id) { if (mconnerror.hasresolution()) { mconnerror.resolve(minstance); } } }); if (error.hasresolution()) { alert.setnegativebutton("cancel", null); } alert.show(); } see the health data store for more information. permission request the meta-data element for the required data permission value in manifest works with the permission request api. if you want to request data permission for reading the step count, write its value in your application project's manifest as the following example. see privacy check flow in privacy. <application <meta-data android:name="com.samsung.android.health.permission.read" android:value="com.samsung.health.step_count" /> </application> create a permission key set and add a permission key for reading the step count. public class mainactivity extends activity { private set<permissionkey> mkeyset; @override public void oncreate(bundle savedinstancestate) { // ... mkeyset = new hashset<permissionkey>(); mkeyset.add(new permissionkey(healthconstants.stepcount.health_data_type, permissiontype.read)); // connect to health data store } and call healthpermissionmanager.requestpermissions() with its listener. private final healthdatastore.connectionlistener mconnectionlistener = new healthdatastore.connectionlistener() { @override public void onconnected() { log.d(app_tag, "health data service is connected."); healthpermissionmanager pmsmanager = new healthpermissionmanager(mstore); try { // check whether the permissions that this application needs are acquired map<permissionkey, boolean> resultmap = pmsmanager.ispermissionacquired(mkeyset); if (resultmap.containsvalue(boolean.false)) { // request the permission for reading step counts if it is not acquired pmsmanager.requestpermissions(mkeyset, mainactivity.this).setresultlistener(mpermissionlistener); } else { // get the current step count and display it // ... } } catch (exception e) { log.e(app_tag, e.getclass().getname() + " - " + e.getmessage()); log.e(app_tag, "permission setting fails."); } } // ... }; if requestpermissions() is called successfully, the permission ui is popped up to the user. the user's permission information is saved by selecting "done" after the user allows each data permission. and it is received through healthresultholder.resultlistener. private final healthresultholder.resultlistener<permissionresult> mpermissionlistener = new healthresultholder.resultlistener<permissionresult>() { @override public void onresult(permissionresult result) { log.d(app_tag, "permission callback is received."); map<permissionkey, boolean> resultmap = result.getresultmap(); if (resultmap.containsvalue(boolean.false)) { // requesting permission fails } else { // get the current step count and display it } } }; } see the health permission manager for more information.

      https://developer.samsung.com/health/android/data/guide/hello-health-data.html
      1. Learn
      2. Code Lab

      codelab

      Create a health research app using Samsung Health Stack

      create a health research app using samsung health stack objective create a health research app that collects and processes participant's health data, survey responses, and task results using samsung health stack. overview samsung health stack is an open-source technology stack offering end-to-end solutions for collecting and analyzing data from wearable devices in android and wear os environments. with applications ranging from medical research to clinician services and beyond, this tech stack provides the tools and infrastructure necessary to expedite the development and deployment of health-based studies. the framework includes: samsung health stack app sdk - a software development kit (sdk) for building android and wear os apps capable of collecting data from wearable devices. web portal - a customizable interface for creating surveys, managing team members, tracking participants, and analyzing data. backend services - api endpoints to access and interact with a robust data engine. see samsung health stack descriptions for detailed information. set up your environment you will need the following: installed and running samsung health stack backend system installed samsung health stack web portal firebase private key used during the backend system installation android studio (latest version recommended) android jetpack compose (latest version recommended) samsung galaxy mobile device with health connect app and samsung health app installed samsung galaxy watch synced to the mobile device google account sample code here is a sample code for you to start coding in this code lab. download it and start your learning experience! research app sample code (4.09 mb) create a firebase project follow the instructions at firebase.google.com/docs/android/setup to add a firebase project to the firebase account you created during the backend system installation. set applicationid as healthstack.sample and download the resulting google-services.json file from firebase. to learn more, see installing the app sdk - create a firebase project. create a new study sign in to the web portal page you deployed. on the study collection page, click the create new study button. noteonly the account who has team admin role can create a new study. see the role-based access control for more details about the differing levels of access permission granted to different roles. set your study name and logo. then click the continue button to create your study. select the principal investigator role and click the confirm button. the overview page appears like below: to connect your app to the backend system of your web portal, you need to know the id of your study. you can get the study id by opening chrome's developer tools. right-click on the web portal page and select inspect. then, open the network panel. click study settings from the left navigation bar. you can see activities recorded on the network tab. the value after projectid= is the id of the study, which you need to set up in the research app. connect the research app to the backend system in android studio, click open to open the project files of the research app. locate the downloaded android project (codelab-before) from the directory and click ok. copy and paste the downloaded google-services.json from firebase to samples > researchsample module. go to samples > researchsample > res > values, and in the strings.xml file, set the following values to connect the app to the backend system: research_platform_endpoint - backend system’s endpoint, including the port number research_project_id - id of the study created <!-- backend integration --> <string name="research_platform_endpoint">http://you.must.set.backend.url</string> <string name="research_project_id">study_id</string> customize the introduction page and eligibility survey the sample research app already includes introduction page and eligibility survey, which you can customize to align with the objective of your study. to modify the introduction page and eligibility survey questions, go to samples > researchsample > java > healthstack.sample and open the onboardingmodule.kt file. introduction page go to the intromodel constructor within the intro function, and create two introsections as below: overview - "a study on walking over an hour daily versus non-walkers." description - "we want to conduct a study to compare the daily life patterns of people who walk more than an hour each day and those who don't." sections = listof( introsection( "overview", "a study on walking over an hour daily versus non-walkers.", ), introsection( "description", "we want to conduct a study to compare the daily life patterns of people " + "who walk more than an hour each day and those who don’t." ) ) the introduction page would look like as below: eligibility survey part of the onboarding process is asking the participants questions through an eligibility survey to determine their suitability for your study. the eligibility survey consists of three steps: eligibilityintrostep - displays an introduction about the survey eligibilitycheckerstep - displays the eligibility questions eligibilityresultstep - displays the result of the survey based on the answers the eligibilitycheckerstep receives the eligibilityquestions. the questions can be a choicequestionmodel, datatimequestionmodel, or multichoicequestionmodel, depending on the type of survey question model you set. modify the eligibility question pages as below: eligibility question 1 type choicequestionmodel id average_walking_time query how many minutes on average do you spend walking each day? explanation unit: minute candidates listof(0, 30, 60, 90, 120) viewtype slider eligibility question 2 type choicequestionmodel id tracking_device query are you willing to wear a tracking device to monitor your dailywalking activity? candidates listof("yes, i'm willing to use a tracking device", "no, i'm notcomfortable using any tracking device") answer yes, i’m willing to use a tracking device eligibility question 3 type choicequestionmodel id participate query are you available and willing to commit to participating in thestudy for a specified duration? candidates listof("yes, i'm available and willing to commit", "no, i'm notavailable or willing to commit") answer yes, i’m available and willing to commit. private val eligibilityquestions: list<questionmodel<any>> = listof( choicequestionmodel( id = "average_walking_time", query = "how many minutes on average do you spend walking each day?", explanation = "unit: minute", candidates = listof(0, 30, 60, 90, 120), viewtype = slider ), choicequestionmodel( id = "tracking_device", query = "are you willing to wear a tracking device to monitor your daily walking activity?", candidates = listof( "yes, i’m willing to use a tracking device", "no, i’m not comfortable using any tracking device" ), answer = "yes, i’m willing to use a tracking device" ), choicequestionmodel( id = "participate", query = "are you available and willing to commit to participating in the study for a specified duration?", candidates = listof("yes, i’m available and willing to commit", "no, i’m not available or willing to commit"), answer = "yes, i’m available and willing to commit" ) ) you can make a pass condition for each question by setting the answer field. a failed result means the participant is not eligible for the study. after defining eligibility questions, the eligibility survey pages would look like as below: set health data permissions you can request permission to collect health data from your study participants. however, before requesting permissions, your app must first declare them in the manifest. go to researchsample module > res > values. in health_permissions.xml, you can declare permissions to read or write data on health connect for steps, sleepsession, sleepstage, oxygensaturation, and bloodpressure data types. notepermission to read and write heartrate data is already declared in the project. <item>androidx.health.permission.steps.read</item> <item>androidx.health.permission.steps.write</item> <item>androidx.health.permission.sleepsession.read</item> <item>androidx.health.permission.sleepsession.write</item> <item>androidx.health.permission.sleepstage.read</item> <item>androidx.health.permission.sleepstage.write</item> <item>androidx.health.permission.oxygensaturation.read</item> <item>androidx.health.permission.oxygensaturation.write</item> <item>androidx.health.permission.bloodpressure.read</item> <item>androidx.health.permission.bloodpressure.write</item> tipfor more information, see the list of data types and permissions. then, go back to healthstack.sample folder. in researchapplication.kt, request permissions from the participants to collect required health data. val healthdatarequired = listof("heartrate", "sleepsession", "sleepstage", "bloodpressure", "steps", "oxygensaturation") tipsee the list of health data types you can collect on health connect. set sync interval and choose health data to display you can set the sync interval per health data type. however, it is recommended to set a minimum interval of 15 minutes because the app is using android's workmanager. tipto learn more about the workmanager, see periodicworkrequest. in mainactivity.kt, set healthdatasyncspecs as below: health data type sync interval heartrate 15 minutes steps 20 hours sleepsession 1 day sleepstage 1 day oxygensaturation 30 minutes bloodpressure 30 minutes val healthdatasyncspecs = listof( syncmanager.healthdatasyncspec("heartrate", 15, timeunit.minutes), syncmanager.healthdatasyncspec("steps", 20, timeunit.hours), syncmanager.healthdatasyncspec("sleepsession", 1, timeunit.days), syncmanager.healthdatasyncspec("sleepstage", 1, timeunit.days), syncmanager.healthdatasyncspec("oxygensaturation", 30, timeunit.minutes), syncmanager.healthdatasyncspec("bloodpressure", 30, timeunit.minutes), ) you can set which data type to display in the research app. the status card for heart rate is already set to display. to show other status cards, such as sleepsessionstatus, add them to the list of healthdatatodisplay. val healthdatatodisplay = listof(heartratestatus, sleepsessionstatus, taskstatus) run the app, join the study and sync your health data build and run the app on a samsung galaxy mobile device. ensure the samsung health app and health connect app is installed on the device and a galaxy watch is connected. notereset the app to its initial state by clearing its data. go to your phone's settings and then swipe to and tap apps. select or search for the researchsample app. tap storage, tap clear data, and then click ok. in the research app, you can join the study by signing in with your google account after passing the eligibility survey, providing consent, and allowing data access to health connect. the research app shows your heart rate data (bpm) and the time you spent sleeping (hrs) based on the data from your galaxy watch and mobile device. notethe data shows and updates in the app based on the sync interval you set. if you want the heart rate data to display immediately, you can measure your heart rate manually using the galaxy watch. then, click the sync health data button in the research app's settings. check health connect's recent logs if data is not showing or updating. the web portal also displays and processes the data from the research. to see the average heart rate data, go to the overview section. scroll to the participant list table, then click the participant data row. the participant management shows health data collected on average, such as heart rate. create a survey task a survey is a sequence of questions that collect information from the participants in your study. in this step, create a survey task and see the result from the web portal. go to the study management section and expand the task management. open the surveys tab and click the create survey button on the top right corner. set survey title as daily survey. then, write three questions as below: after writing all the survey questions, click the publish button. set the frequency as daily and the publish time as early as possible. then, click the publish button on the bottom right corner. you can find your survey task on the published list. go to the research app and touch the refresh button next to upcoming tasks or today to see the survey you created. answer and complete the survey task. go back to the web portal. click your survey task from the published list. reload the web page or re-login to get the result. you can see the survey report in the responses and analytics tab. create an activity task activities allow researchers to collect specific types of data from users. for this study, add an activity to collect measurements related to manual dexterity. in study management, go to the activities tab and click the create activity button. select motor for the activity category and choose tapping speed. click the create button. click the publish button on the task edit page. set frequency as daily and publish time as early as possible. then, click the publish button. you can find your activity task on the published list. in the research app, touch the refresh button to see the newly added activity. open and perform the activity task. in the web portal, click your activity task from the published list. enter the participant id to see the collected data. you're done! congratulations! you have successfully achieved the goal of this code lab. now, you can create your own research app that can collect and process users’ health data, answers to survey and activity task results for research purposes by yourself! to learn more, see samsung health stack.

      https://developer.samsung.com/codelab/health/research-app.html
      1. Learn
      2. Code Lab

      codelab

      Measure skin temperature on Galaxy Watch with Samsung Privileged Health SDK

      measure skin temperature on galaxy watch with samsung privileged health sdk objective create a health app for galaxy watch, operating on wear os powered by samsung, utilizing samsung privileged health sdk to obtain skin temperature measurement results. partnership request in this code lab, you will use a specially prepared mock library. it has limited functionality and uses dummy data instead of real-time data. you will need the full version of the samsung privileged health sdk library to get real values, which is available to samsung partners. apply as a partner by checking out the partner app program for exclusive samsung privileged health sdk access. overview samsung privileged health sdk provides means of accessing and tracking health information contained in the health data storage. its tracking service gives raw and processed sensor data such as accelerometer and body composition data sent by the samsung bioactive sensor. the active sensor of galaxy watch runs powerful health sensors such as photoplethysmogram (ppg), electrocardiogram (ecg), bioelectrical impedance analysis (bia), sweat loss, and spo2. see samsung privileged health sdk descriptions for detailed information. set up your environment you will need the following: galaxy watch5 or newer with updated health platform 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! skin temperature tracking sample code (123.64 kb) notethis code lab uses mock library, which has limited functionality with dummy data. data from the mock library is not from the galaxy watch’s real sensor data. you need a full version of the samsung privileged health sdk library to get actual values and it's only available to registered partners. the code lab works using a mock library on the galaxy watch4 or newer, while the official library works using galaxy watch5 or newer. 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 will display as on the image below. afterwards, developer options will 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 will see the following message in android studio’s 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 this step is only applicable to registered partners of samsung privileged health sdk. you can replace priv-health-tracking-mock-2023.aar in app > libs with the real library to receive real sensor data with the application. this requires health platform to be set in developer mode: on your watch go to settings > apps > health platform. quickly tap health platform title for 10 times. this enables developer mode and displays [dev mode] below the title. to stop using developer mode, quickly tap health platform title for 10 times to disable it. start your project after downloading the sample code containing the project files, open your android studio and click open to open an existing project. locate the downloaded android project (skintemptracking) from the directory and click ok. check tracking capabilities to track the data with the sdk, the device must support skin temperature, like the galaxy watch5. skin temperature tracking can work in 2 modes: batching and on-demand. the tracker type for batching is healthtrackertype.skin_temperature_continuous and healthtrackertype.skin_temperature for on-demand. in this code lab, you are going to use on-demand tracker. in connectionmanager.java, navigate to isskintemperatureavailable() function. use a provided healthtrackingservice object to create a healthtrackercapability instance, and send it to checkavailabletrackers() function, and assign its result to availabletrackers list. gettrackingcapability() returns a healthtrackercapability instance in healthtrackingservice object healthtrackingservicehealthtrackingservice initiates a connection to samsung's health tracking service and provides a healthtracker instance to track a healthtrackertype. public healthtrackercapability gettrackingcapability() provide a healthtrackercapability instance to get a supporting healthtrackertype list. /****************************************************************************************** * [practice 1] check capabilities to confirm skin temperature availability * * ---------------------------------------------------------------------------------------- * * (hint) replace todo 1 with java code * get healthtrackercapability object from healthtrackingservice * send the object to checkavailabletrackers() ******************************************************************************************/ boolean isskintemperatureavailable(healthtrackingservice healthtrackingservice) { if (healthtrackingservice == null) return false; @suppresswarnings("unusedassignment") list<healthtrackertype> availabletrackers = null; //"todo 1" if (availabletrackers == null) return false; else return availabletrackers.contains(healthtrackertype.skin_temperature); } initialization of skin temperature tracker before starting the measurement, initialize the skin temperature tracker by creating a healthtracker object. in skintemperaturelistener.java, navigate to setskintemperaturetracker(). using the provided healthtrackingservice object, create an instance of the healthtracker class of skin_temperature type and assign it to the skintemperaturetracker object. gethealthtracker() with healthtrackertype.skin_temperature as an argument creates a healthtracker instance after a single measurement, the tracker should be stopped when using on-demand measurement. for continuous measurement, use healthtrackertype.skin_temperature_continuous healthtrackingservicehealthtrackingservice initiates a connection to samsung's health tracking service and provides a healthtracker instance to track a healthtrackertype. healthtracker gethealthtracker(healthtrackertype healthtrackertype) create a healthtracker instance for the given healthtrackertype. /******************************************************************************************* * [practice 2] setup skin temperature tracker * * ---------------------------------------------------------------------------------------- * * (hint) replace todo 2 with java code * initialize skintemperaturetracker with proper samsung privileged health sdk functionality * call gethealthtracker() on healthtrackingservice object * use healthtrackertype.skin_temperature as an argument ******************************************************************************************/ void setskintemperaturetracker(healthtrackingservice healthtrackingservice) { //"todo 2" } starting and stopping the tracker for the client app to obtain the data through the sdk, set a listener method on healthtracker. this method is called every time there is new data. healthtrackerhealthtracker enables an application to set an event listener and get tracking data for a specific healthtrackertype. public void seteventlistener(healthtracker.trackereventlistener listener) set an event listener to the healthtracker instance. void starttracker() { if (!ishandlerrunning) { skintemperaturehandler.post(() -> skintemperaturetracker.seteventlistener(skintemperaturelistener)); ishandlerrunning = true; } } after the finished measurement, the on-demand tracker should be stopped. you can do that by unsetting the event listener from healthtracker. healthtrackerhealthtracker enables an application to set an event listener and get tracking data for a specific healthtrackertype. public void unseteventlistener() stop the registered event listener to this healthtracker instance. void stoptracker() { if (skintemperaturetracker != null) skintemperaturetracker.unseteventlistener(); skintemperaturehandler.removecallbacksandmessages(null); ishandlerrunning = false; } process obtained skin temperature data the answer from the healthtrackingservice is asynchronous. the skintemperaturelistener receives the callback containing a data point with all the required information. follow the steps below to get skin temperature data: in skintemperaturelistener.java, go to the updateskintemperature() function and read skin temperature data from datapoint: get skin temperature status using datapoint api (key: valuekey.skintemperatureset.status). get skin temperature value using datapoint api (key: valuekey.skintemperatureset.object_temperature). get ambient temperature value using datapoint api (key: valuekey.skintemperatureset.ambient_temperature) datapointdatapoint provides a map of valuekey and value with a timestamp. public <t>t getvalue(valuekey<t>type) get data value for the given key. private final healthtracker.trackereventlistener skintemperaturelistener = new healthtracker.trackereventlistener() { @override public void ondatareceived(@nonnull list<datapoint> list) { stoptracker(); for (datapoint data : list) { updateskintemperature(data); } } }; /******************************************************************************************* * [practice 3] read values from datapoint object * - get skin temperature status value * - get wrist skin temperature value - it's named "object_temperature" in the library * - get ambient temperature value ------------------------------------------------------------------------------------------- * - (hint) replace todo 3 with parts of code * (1) remove skintemperaturestatus.invalid_measurement and * set status from 'datapoint' object using data.getvalue(valuekey.skintemperatureset.status) * * if status is 'skintemperaturestatus.successful_measurement' then: * (2) set wristskintemperaturevalue from 'datapoint' object using: * data.getvalue(valuekey.skintemperatureset.object_temperature); * (3) set ambienttemperaturevalue from 'datapoint' object using: * data.getvalue(valuekey.skintemperatureset.ambient_temperature); ******************************************************************************************/ void updateskintemperature(datapoint data) { final int status = skintemperaturestatus.invalid_measurement; float wristskintemperaturevalue = 0; float ambienttemperaturevalue = 0; //"todo 3" trackerdatasubject.notifyskintemperaturetrackerobservers(status, ambienttemperaturevalue, wristskintemperaturevalue); } run unit tests for your convenience, you will find an additional unit tests package. this will let you verify your code changes even without using a physical watch. see the instruction below on how to run unit tests: right click on com.samsung.health.skintemptracking (test) and execute run 'tests in 'com.samsung.health.skintemptrackin" command. if you have completed all the tasks correctly, you can see all the unit tests pass successfully. run the app after building the apk, you can run the application on a connected device to measure your skin temperature. once the app starts, allow the app to receive data from the body sensors. afterwards, the screen shows the application. tap the measure button to get your skin temperature. to stop measuring, tap on the stop button. you're done! congratulations! you have successfully achieved the goal of this code lab. now, you can create a health app that measures skin temperature by yourself! to learn more about samsung health, visit: developer.samsung.com/health

      https://developer.samsung.com/codelab/health/skin-temperature.html
      1. Learn
      2. Code Lab

      codelab

      Transfer heart rate data from Galaxy Watch to a mobile device with Samsung Privileged Health SDK

      transfer heart rate data from galaxy watch to a mobile device with samsung privileged health sdk 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. partnership request in this code lab, you will use a specially prepared mock library. it has limited functionality and uses dummy data instead of real-time data. you will need the full version of the samsung privileged health sdk library to get real values, which is available to samsung partners. apply as a partner by checking out the partner app program for exclusive samsung privileged health sdk access. overview with this code lab, you can measure various health data using samsung privileged health sdk and send it to a paired android mobile device for further processing. using a paired mobile device will make the data more organized by taking advantage of a bigger screen and saving health data to a local database or remote server. see samsung privileged health sdk descriptions for detailed information. set up your environment you will need the following: galaxy watch4 or newer, powered by wear os 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 (196.70 kb) notethis code lab uses mock library, which has limited functionality with dummy data. data from the mock library is not from the galaxy watch’s real sensor data. you need a full version of the samsung privileged health sdk library to get actual values and it's only available to registered partners. 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 will display as on the image below. afterwards, developer options will 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 will 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 this step is only applicable to registered partners of samsung privileged health sdk. you can replace priv-health-tracking-mock-2023.aar in app > libs with the real library to receive real sensor data with the application. this requires health platform to be set in developer mode: on your watch go to settings > apps > health platform. quickly tap health platform title for 10 times. this enables developer mode and displays [dev mode] below the title. to stop using developer mode, quickly tap health platform title for 10 times to disable it. 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 after downloading the sample code containing the project files, in android studio click open to open an existing project. locate the downloaded android project (hrdatatransfer-code-lab) from the directory and click ok. parse data from the watch after opening the sample project, you need to parse the ibi data collected while tracking the heart rate-related data. 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 the wear > java > data > com.samsung.health.hrdatatransfer. 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 it up so it can send data to a paired android mobile device. first, check if the devices within range have proper capabilities. the capability data type is a string and is used when sending a message on both devices. go to the wear > java > com.samsung.health.hrdatatransfer > data. in capabilityrepositoryimpl.kt, and fill in the function below: /************************************************************************************** * [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 } the purpose of this exercise is to identify which nodes have the exact capability you are looking for (represented by capability argument). you need those nodes later to send the message to them. 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. go to the 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 } run unit tests for your convenience, you will find an additional unit tests package. this will let 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. do the same step with the mobile module. if you have completed all the tasks correctly, you will 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! to learn more about samsung health, visit: developer.samsung.com/health

      https://developer.samsung.com/codelab/health/heart-rate-data-transfer.html
      1. Develop
      2. Health

      doc

      Connection Design Guide

      connection design guide samsung health's partner apps can connect to samsung health with samsung health sdk for android. a partner app needs to inform samsung health users that the app connects with samsung health and that it shares data. the connection design guide provides connection flows with unified look and feel for partner apps. notification of samsung health connection menu for connecting to samsung health permission setting menu samsung health name and icon notification of samsung health connection the launch screen of a partner app, event pop-up, or information space is a good approach to notify users of connecting with samsung health. a partner app needs to inform users with as concrete description and information as possible. do show explicitly a notification of working with samsung health as a partner app. the app's launch screen is recommended. do include a concrete description of the data synced with samsung health. do show the "samsung health" name or its icon. see the naming and icon guide. do add a ui flow to show the data permission pop-up after the notification message. menu for connecting to samsung health a partner app should provide a menu with a convenient interface for the user to change the data sync setting with samsung health. do create a menu to set the samsung health's data permission. do use a straightforward menu name like "connect to samsung health". recommended contents in "connect to samsung health" are: benefits available through samsung health connection and the data synced with samsung health link to samsung health do add an option to install samsung health through "connect to samsung health" if it is not installed. do show a samsung health's data permission popup through the menu. do place "connect to samsung health" where the user can find it easily. do not place "connect to samsung health" under multiple layers that are difficult for the user to find. samsung health name & icon samsung health's name and its icon in a partner app should be used properly. samsung health name - "samsung health" do use the name "samsung health". do not modify the official name, “samsung health”. examples of what to avoid are: shealth shealth s health s-health samsunghealth samsung health's icon do use the latest icon. you can get it here. its official icon is: samsung health's icon (april 11th, 2019) (185kb) do not modify the icon. do not use any other resource images of samsung health except its icon. do not use the samsung health's icon or similar icon for your own application.

      https://developer.samsung.com/health/android/connection-design.html
      No Search Results
      No Search results. Try using another keyword.
      • <<
      • <
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7
      • 8
      • 9
      • 10
      • >
      • >>
      Samsung Developers
      Samsung Developers
      Quick Link
      • Android USB Driver
      • Code Lab
      • Galaxy Emulator Skin
      • Foldables and Large Screens
      • One UI Beta
      • Remote Test Lab
      • Samsung Developers Podcast
      Family Site
      • Bixby
      • Knox
      • Samsung Pay
      • SmartThings
      • Tizen
      • Samsung Research
      • SamsungOpen Source
      • Samsung Dev Spain
      • Samsung Dev Brazil
      Legal
      • Terms
      • Privacy
      • Open Source License
      • Cookie Policy
      Social Communications
      • Facebook
      • Instagram
      • Twitter
      • YouTube
      • Buzzsprout
      • Rss
      • Linkedin
      • System Status
      • Site Map
      • System Status
      • Site Map
      • facebook
      • instagram
      • twitter
      • youtube
      • buzzsprout
      • rss
      • linkedin

      Copyright © 2023 SAMSUNG. All rights reserved.