CINXE.COM
Search | Samsung Developer
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" /> <title>Search | Samsung Developer</title> <link rel="canonical" href="/search" /> <meta name="description" content=""> <meta name="author" content=""> <meta name="keywords" content=""> <!-- Open Graph tags --> <meta property="og:site_name" content="Samsung Developer"> <meta property="og:title" content="Search | Samsung Developer"> <meta property="og:description" content="The world runs on you."> <meta property="og:type" content="website"> <meta property="og:url" content="/search"> <meta property="og:locale" content="en_US"> <meta property="og:image" content="https://d3unf4s5rp9dfh.cloudfront.net/public/img/common/SNS_1280x630.png"> <!-- Twitter card tags --> <meta name="twitter:site" content="@samsung_dev"> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="Search | Samsung Developer"> <meta name="twitter:description" content="The world runs on you."> <meta name="twitter:domain" content="http://developer.samsung.com/"> <meta property="twitter:image" content="https://d3unf4s5rp9dfh.cloudfront.net/public/img/common/SNS_1280x630.png"> <link rel="icon" type="image/png" href="https://d3unf4s5rp9dfh.cloudfront.net/public/favicon-2023.ico" /> <link rel="manifest" href="https://d3unf4s5rp9dfh.cloudfront.net/public/manifest.json" /> <meta name="google-site-verification" content="" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <meta name="theme-color" content="#000000" /> <meta name="csrf-token" content=""/> <meta name="user-locale" content="SGP"/> <meta name="user-country" content="SG"/> <meta name="user-lang" content="*"/> <meta name="env" content="production"/> <link rel="preload" href="https://d3unf4s5rp9dfh.cloudfront.net/public/fonts/SamsungOne-400.woff2" as="font" type="font/woff2" crossorigin="anonymous"/> <link rel="preload" href="https://d3unf4s5rp9dfh.cloudfront.net/public/fonts/SamsungOne-700.woff2" as="font" type="font/woff2" crossorigin="anonymous"/> <link rel="preload" href="https://d3unf4s5rp9dfh.cloudfront.net/public/fonts/SamsungSharpSans-Bold.woff" as="font" type="font/woff2" crossorigin="anonymous" /> <link rel="preload" href="https://d3unf4s5rp9dfh.cloudfront.net/public/fonts/SamsungSharpSans-Medium.woff" as="font" type="font/woff2" crossorigin="anonymous" /> <link rel="preload" href="https://d3unf4s5rp9dfh.cloudfront.net/public/fonts/SamsungOneKorean-400.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> <link rel="preload" href="https://d3unf4s5rp9dfh.cloudfront.net/public/fonts/SamsungOneKorean-700.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> <link rel="preload" href="https://d3unf4s5rp9dfh.cloudfront.net/public/fonts/SamsungSharpSans-Bold.woff2" as="font" type="font/woff2" crossorigin="anonymous" /> <link rel="stylesheet" href="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/css/sdp.vendors.min.css"/> <link rel="stylesheet" href="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/css/sdp.global.min.css"/> <link rel="stylesheet" href="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/css/sdp.app.min.css"/> <link rel="stylesheet" href="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/css/sdp.docs.min.css"/> <script type="text/javascript" src="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/js/sdp.vendors.min.js"></script> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=GTM-THSQV3D"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'GTM-THSQV3D'); </script> <!-- Start External Google Tags for tracking login flow --> <!-- End: External Google Tags for tracking login flow --> </head> <body> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-THSQV3D" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!-- Start External Google Tags for tracking login flow --> <div id="app" attr-url="/search" attr-ga-enabled="1" attr-cms=""> <div class="wrapper"> <header class="sdp-header doc" data-target="header" translate="no" data-component="true"> <div class="header-global-nav"> <!-- Logo, Utility Menu --> <div class="global-nav-top-box"> <div class="global-nav-top"> <i role="button" class="global-nav-menu" data-target="gnb"> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M18 4.125H2" stroke="#1E1E1E" stroke-width="1.5"></path> <path d="M2 10.125H18" stroke="#1E1E1E" stroke-width="1.5"></path> <path d="M18 16.125H2" stroke="#1E1E1E" stroke-width="1.5"></path> </svg> </i> <a class="global-nav-logo" href="/"> <svg width="180" height="24" viewBox="0 0 180 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1_13833)"> <path d="M5.184 18.43C2.826 18.43 1.26 17.422 0.054 16.072L2.286 14.308C2.952 15.46 3.96 16.09 5.166 16.09C6.462 16.09 7.164 15.244 7.164 14.326C7.164 13.228 5.814 12.868 4.428 12.436C2.646 11.86 0.702 11.194 0.702 8.692C0.702 6.586 2.538 4.93 5.058 4.93C7.164 4.93 8.406 5.74 9.468 6.838L7.452 8.368C6.894 7.522 6.102 7.108 5.076 7.108C3.87 7.108 3.24 7.756 3.24 8.602C3.24 9.664 4.482 9.97 5.922 10.456C7.704 11.032 9.72 11.824 9.72 14.344C9.72 16.414 8.064 18.43 5.184 18.43ZM15.9503 18.466C13.4123 18.466 10.7663 16.45 10.7663 12.994C10.7663 9.502 13.3223 7.504 15.9863 7.504C17.3723 7.504 18.5963 8.062 19.3703 8.98V7.72H21.8003V18.25H19.3703V16.882C18.5963 17.872 17.3363 18.466 15.9503 18.466ZM16.3463 16.234C18.1643 16.234 19.4962 14.776 19.4962 12.958C19.4962 11.158 18.1643 9.718 16.3463 9.718C14.5463 9.718 13.1603 11.14 13.1603 12.958C13.1603 14.794 14.5463 16.234 16.3463 16.234ZM23.2723 18.25V7.72H25.6843V8.944C26.3503 8.062 27.3943 7.504 28.6903 7.504C30.3463 7.504 31.4803 8.17 32.1103 9.322C32.8303 8.224 34.0543 7.504 35.5663 7.504C38.4283 7.504 39.8503 9.16 39.8503 11.914V18.25H37.3663V12.112C37.3663 10.582 36.5923 9.61 35.0803 9.61C33.7663 9.61 32.7583 10.51 32.7583 12.364V18.25H30.2923V12.04C30.2923 10.528 29.5363 9.61 28.0783 9.61C26.7103 9.61 25.7023 10.546 25.7023 12.418V18.25H23.2723ZM45.1972 18.466C42.8392 18.466 41.3632 17.566 40.5172 15.91L42.7672 14.83C43.2712 15.82 44.1532 16.36 45.3052 16.36C46.5112 16.36 47.1052 15.784 47.1052 15.082C47.1052 14.308 45.9352 14.164 44.6392 13.876C42.8392 13.498 40.9492 12.922 40.9492 10.708C40.9492 9.016 42.5872 7.486 45.0892 7.486C47.2312 7.486 48.5812 8.314 49.3912 9.664L47.3212 10.708C46.8892 9.97 46.0972 9.502 45.0892 9.502C43.9372 9.502 43.3972 10.042 43.3972 10.636C43.3972 11.338 44.2252 11.518 45.8092 11.86C47.5372 12.202 49.5172 12.814 49.5172 15.028C49.5172 16.504 48.2032 18.466 45.1972 18.466ZM59.9517 7.72V18.25H57.5397V17.044C56.8737 17.926 55.8657 18.466 54.5157 18.466C51.9957 18.466 50.4657 16.828 50.4657 13.966V7.72H52.9317V13.714C52.9317 15.352 53.6517 16.36 55.1817 16.36C56.5317 16.36 57.5217 15.352 57.5217 13.498V7.72H59.9517ZM61.452 18.25V7.72H63.864V9.016C64.566 8.098 65.646 7.504 67.014 7.504C69.66 7.504 71.19 9.142 71.19 12.004V18.25H68.724V12.256C68.724 10.618 67.932 9.61 66.348 9.61C64.962 9.61 63.882 10.618 63.882 12.472V18.25H61.452ZM80.8765 18.07V16.846C80.1025 17.854 78.8605 18.466 77.4385 18.466C74.9005 18.466 72.2545 16.45 72.2545 12.994C72.2545 9.502 74.8105 7.504 77.4745 7.504C78.8605 7.504 80.0845 8.116 80.8585 9.07V7.72H83.2885V17.98C83.2885 20.932 81.3985 23.344 77.8525 23.344C75.1165 23.344 73.4065 22.066 72.4525 20.32L74.6125 19.006C75.3865 20.428 76.2145 21.112 77.8885 21.112C79.7245 21.112 80.8765 19.672 80.8765 18.07ZM77.8345 16.234C79.6525 16.234 80.9845 14.776 80.9845 12.958C80.9845 11.158 79.6525 9.718 77.8345 9.718C76.0345 9.718 74.6485 11.14 74.6485 12.958C74.6485 14.794 76.0345 16.234 77.8345 16.234ZM89.174 18.25V5.11H92.756C97.184 5.11 99.704 7.954 99.704 11.68C99.704 15.424 96.86 18.25 92.864 18.25H89.174ZM92.468 7.378H91.622V15.982H92.576C95.456 15.982 97.256 14.128 97.256 11.68C97.256 9.16 95.726 7.378 92.468 7.378ZM106.012 18.466C102.7 18.466 100.45 16.054 100.45 13.012C100.45 9.934 102.844 7.504 105.922 7.504C109.054 7.504 111.34 9.808 111.34 12.922V13.84H102.772C103.114 15.334 104.284 16.324 106.012 16.324C107.38 16.324 108.424 15.604 108.928 14.47L110.926 15.622C110.008 17.332 108.388 18.466 106.012 18.466ZM105.922 9.646C104.464 9.646 103.33 10.51 102.898 11.806H108.874C108.514 10.384 107.434 9.646 105.922 9.646ZM115.182 18.25L111.168 7.72H113.706L116.424 15.136L119.088 7.72H121.59L117.63 18.25H115.182ZM126.895 18.466C123.583 18.466 121.333 16.054 121.333 13.012C121.333 9.934 123.727 7.504 126.805 7.504C129.937 7.504 132.223 9.808 132.223 12.922V13.84H123.655C123.997 15.334 125.167 16.324 126.895 16.324C128.263 16.324 129.307 15.604 129.811 14.47L131.809 15.622C130.891 17.332 129.271 18.466 126.895 18.466ZM126.805 9.646C125.347 9.646 124.213 10.51 123.781 11.806H129.757C129.397 10.384 128.317 9.646 126.805 9.646ZM133.311 18.25V4.93H135.759V18.25H133.311ZM142.273 18.466C139.231 18.466 136.819 16.018 136.819 12.994C136.819 9.916 139.231 7.504 142.273 7.504C145.297 7.504 147.727 9.916 147.727 12.994C147.727 16.018 145.297 18.466 142.273 18.466ZM142.273 16.18C144.001 16.18 145.333 14.74 145.333 12.994C145.333 11.212 144.001 9.79 142.273 9.79C140.527 9.79 139.213 11.212 139.213 12.994C139.213 14.74 140.527 16.18 142.273 16.18ZM154.648 18.466C153.208 18.466 151.948 17.944 151.21 17.008V23.092H148.798V7.72H151.21V9.124C151.948 8.134 153.19 7.504 154.63 7.504C157.276 7.504 159.814 9.502 159.814 12.994C159.814 16.45 157.186 18.466 154.648 18.466ZM154.252 16.234C156.034 16.234 157.42 14.794 157.42 12.958C157.42 11.14 156.034 9.718 154.252 9.718C152.434 9.718 151.12 11.158 151.12 12.958C151.12 14.776 152.434 16.234 154.252 16.234ZM166.129 18.466C162.817 18.466 160.567 16.054 160.567 13.012C160.567 9.934 162.961 7.504 166.039 7.504C169.171 7.504 171.457 9.808 171.457 12.922V13.84H162.889C163.231 15.334 164.401 16.324 166.129 16.324C167.497 16.324 168.541 15.604 169.045 14.47L171.043 15.622C170.125 17.332 168.505 18.466 166.129 18.466ZM166.039 9.646C164.581 9.646 163.447 10.51 163.015 11.806H168.991C168.631 10.384 167.551 9.646 166.039 9.646ZM172.546 18.25V7.72H174.958V9.286C175.444 8.242 176.344 7.72 177.658 7.72C178.432 7.72 179.026 7.9 179.512 8.17L178.594 10.474C178.234 10.24 177.838 10.06 177.136 10.06C175.714 10.06 174.976 10.816 174.976 12.634V18.25H172.546Z" fill="black"></path> </g> <defs> <clipPath id="clip0_1_13833"> <rect width="180" height="23.5" fill="white" transform="translate(0 0.25)"></rect> </clipPath> </defs> </svg> </a> <div class="global-nav-util-group"> <div class="util-group-search" data-open="headerSearch"> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M17.2529 17.2511L12.5469 12.5142" stroke="#1E1E1E" stroke-width="1.5"></path> <path d="M14.3843 8.55871C14.3843 11.7763 11.776 14.385 8.55883 14.385C5.34167 14.385 2.7334 11.7763 2.7334 8.55871C2.7334 5.34107 5.34167 2.73242 8.55883 2.73242C11.776 2.73242 14.3843 5.34107 14.3843 8.55871Z" stroke="#1E1E1E" stroke-width="1.5"></path> </svg> <span>Search</span> </div> <!-- before login --> <a class="util-group-sign-in" href="/login?redirectURL=%2Fsearch%3Fquery%3DSamsung"> <span>Sign in</span> </a> </div> </div> </div> <!-- Dimmed Effect --> <div class="header-dimmed" data-target="headerDimmed"></div> <!-- filter --> <div id="filter"></div> <!-- GNB --> <div class="global-nav-bottom-fixed"> <div class="global-nav-bottom" data-open="gnb"> <div class="nav-btm-logo"> <i role="button" class="nav-btm-close" data-close="gnb"> <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.00017 4L16 15.9998" stroke="#1E1E1E" stroke-width="1.5"></path> <path d="M4 15.9998L15.9998 4" stroke="#1E1E1E" stroke-width="1.5"></path> </svg> </i> <svg width="180" height="24" viewBox="0 0 180 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_1_13833)"> <path d="M5.184 18.43C2.826 18.43 1.26 17.422 0.054 16.072L2.286 14.308C2.952 15.46 3.96 16.09 5.166 16.09C6.462 16.09 7.164 15.244 7.164 14.326C7.164 13.228 5.814 12.868 4.428 12.436C2.646 11.86 0.702 11.194 0.702 8.692C0.702 6.586 2.538 4.93 5.058 4.93C7.164 4.93 8.406 5.74 9.468 6.838L7.452 8.368C6.894 7.522 6.102 7.108 5.076 7.108C3.87 7.108 3.24 7.756 3.24 8.602C3.24 9.664 4.482 9.97 5.922 10.456C7.704 11.032 9.72 11.824 9.72 14.344C9.72 16.414 8.064 18.43 5.184 18.43ZM15.9503 18.466C13.4123 18.466 10.7663 16.45 10.7663 12.994C10.7663 9.502 13.3223 7.504 15.9863 7.504C17.3723 7.504 18.5963 8.062 19.3703 8.98V7.72H21.8003V18.25H19.3703V16.882C18.5963 17.872 17.3363 18.466 15.9503 18.466ZM16.3463 16.234C18.1643 16.234 19.4962 14.776 19.4962 12.958C19.4962 11.158 18.1643 9.718 16.3463 9.718C14.5463 9.718 13.1603 11.14 13.1603 12.958C13.1603 14.794 14.5463 16.234 16.3463 16.234ZM23.2723 18.25V7.72H25.6843V8.944C26.3503 8.062 27.3943 7.504 28.6903 7.504C30.3463 7.504 31.4803 8.17 32.1103 9.322C32.8303 8.224 34.0543 7.504 35.5663 7.504C38.4283 7.504 39.8503 9.16 39.8503 11.914V18.25H37.3663V12.112C37.3663 10.582 36.5923 9.61 35.0803 9.61C33.7663 9.61 32.7583 10.51 32.7583 12.364V18.25H30.2923V12.04C30.2923 10.528 29.5363 9.61 28.0783 9.61C26.7103 9.61 25.7023 10.546 25.7023 12.418V18.25H23.2723ZM45.1972 18.466C42.8392 18.466 41.3632 17.566 40.5172 15.91L42.7672 14.83C43.2712 15.82 44.1532 16.36 45.3052 16.36C46.5112 16.36 47.1052 15.784 47.1052 15.082C47.1052 14.308 45.9352 14.164 44.6392 13.876C42.8392 13.498 40.9492 12.922 40.9492 10.708C40.9492 9.016 42.5872 7.486 45.0892 7.486C47.2312 7.486 48.5812 8.314 49.3912 9.664L47.3212 10.708C46.8892 9.97 46.0972 9.502 45.0892 9.502C43.9372 9.502 43.3972 10.042 43.3972 10.636C43.3972 11.338 44.2252 11.518 45.8092 11.86C47.5372 12.202 49.5172 12.814 49.5172 15.028C49.5172 16.504 48.2032 18.466 45.1972 18.466ZM59.9517 7.72V18.25H57.5397V17.044C56.8737 17.926 55.8657 18.466 54.5157 18.466C51.9957 18.466 50.4657 16.828 50.4657 13.966V7.72H52.9317V13.714C52.9317 15.352 53.6517 16.36 55.1817 16.36C56.5317 16.36 57.5217 15.352 57.5217 13.498V7.72H59.9517ZM61.452 18.25V7.72H63.864V9.016C64.566 8.098 65.646 7.504 67.014 7.504C69.66 7.504 71.19 9.142 71.19 12.004V18.25H68.724V12.256C68.724 10.618 67.932 9.61 66.348 9.61C64.962 9.61 63.882 10.618 63.882 12.472V18.25H61.452ZM80.8765 18.07V16.846C80.1025 17.854 78.8605 18.466 77.4385 18.466C74.9005 18.466 72.2545 16.45 72.2545 12.994C72.2545 9.502 74.8105 7.504 77.4745 7.504C78.8605 7.504 80.0845 8.116 80.8585 9.07V7.72H83.2885V17.98C83.2885 20.932 81.3985 23.344 77.8525 23.344C75.1165 23.344 73.4065 22.066 72.4525 20.32L74.6125 19.006C75.3865 20.428 76.2145 21.112 77.8885 21.112C79.7245 21.112 80.8765 19.672 80.8765 18.07ZM77.8345 16.234C79.6525 16.234 80.9845 14.776 80.9845 12.958C80.9845 11.158 79.6525 9.718 77.8345 9.718C76.0345 9.718 74.6485 11.14 74.6485 12.958C74.6485 14.794 76.0345 16.234 77.8345 16.234ZM89.174 18.25V5.11H92.756C97.184 5.11 99.704 7.954 99.704 11.68C99.704 15.424 96.86 18.25 92.864 18.25H89.174ZM92.468 7.378H91.622V15.982H92.576C95.456 15.982 97.256 14.128 97.256 11.68C97.256 9.16 95.726 7.378 92.468 7.378ZM106.012 18.466C102.7 18.466 100.45 16.054 100.45 13.012C100.45 9.934 102.844 7.504 105.922 7.504C109.054 7.504 111.34 9.808 111.34 12.922V13.84H102.772C103.114 15.334 104.284 16.324 106.012 16.324C107.38 16.324 108.424 15.604 108.928 14.47L110.926 15.622C110.008 17.332 108.388 18.466 106.012 18.466ZM105.922 9.646C104.464 9.646 103.33 10.51 102.898 11.806H108.874C108.514 10.384 107.434 9.646 105.922 9.646ZM115.182 18.25L111.168 7.72H113.706L116.424 15.136L119.088 7.72H121.59L117.63 18.25H115.182ZM126.895 18.466C123.583 18.466 121.333 16.054 121.333 13.012C121.333 9.934 123.727 7.504 126.805 7.504C129.937 7.504 132.223 9.808 132.223 12.922V13.84H123.655C123.997 15.334 125.167 16.324 126.895 16.324C128.263 16.324 129.307 15.604 129.811 14.47L131.809 15.622C130.891 17.332 129.271 18.466 126.895 18.466ZM126.805 9.646C125.347 9.646 124.213 10.51 123.781 11.806H129.757C129.397 10.384 128.317 9.646 126.805 9.646ZM133.311 18.25V4.93H135.759V18.25H133.311ZM142.273 18.466C139.231 18.466 136.819 16.018 136.819 12.994C136.819 9.916 139.231 7.504 142.273 7.504C145.297 7.504 147.727 9.916 147.727 12.994C147.727 16.018 145.297 18.466 142.273 18.466ZM142.273 16.18C144.001 16.18 145.333 14.74 145.333 12.994C145.333 11.212 144.001 9.79 142.273 9.79C140.527 9.79 139.213 11.212 139.213 12.994C139.213 14.74 140.527 16.18 142.273 16.18ZM154.648 18.466C153.208 18.466 151.948 17.944 151.21 17.008V23.092H148.798V7.72H151.21V9.124C151.948 8.134 153.19 7.504 154.63 7.504C157.276 7.504 159.814 9.502 159.814 12.994C159.814 16.45 157.186 18.466 154.648 18.466ZM154.252 16.234C156.034 16.234 157.42 14.794 157.42 12.958C157.42 11.14 156.034 9.718 154.252 9.718C152.434 9.718 151.12 11.158 151.12 12.958C151.12 14.776 152.434 16.234 154.252 16.234ZM166.129 18.466C162.817 18.466 160.567 16.054 160.567 13.012C160.567 9.934 162.961 7.504 166.039 7.504C169.171 7.504 171.457 9.808 171.457 12.922V13.84H162.889C163.231 15.334 164.401 16.324 166.129 16.324C167.497 16.324 168.541 15.604 169.045 14.47L171.043 15.622C170.125 17.332 168.505 18.466 166.129 18.466ZM166.039 9.646C164.581 9.646 163.447 10.51 163.015 11.806H168.991C168.631 10.384 167.551 9.646 166.039 9.646ZM172.546 18.25V7.72H174.958V9.286C175.444 8.242 176.344 7.72 177.658 7.72C178.432 7.72 179.026 7.9 179.512 8.17L178.594 10.474C178.234 10.24 177.838 10.06 177.136 10.06C175.714 10.06 174.976 10.816 174.976 12.634V18.25H172.546Z" fill="black"></path> </g> <defs> <clipPath id="clip0_1_13833"> <rect width="180" height="23.5" fill="white" transform="translate(0 0.25)"></rect> </clipPath> </defs> </svg> </div> <ul class="nav-btm-menu" data-target="navMenu"> <li class="nav-item"> <a href="/learn">Learn</a> <i class="nav-btm-menu-arrow" role="button" data-target="navArrow"></i> <div class="nav-dynamic-menu"> <div class="dynamic-menu-item-contents"> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/codelab">Code Lab</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/foldables-and-largescreens">Foldables and Large Screens</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/one-ui-beta">One UI Beta</a></li> </ul> </div> </div> </div> </li> <li class="nav-item"> <a href="/develop">Develop</a> <i class="nav-btm-menu-arrow" role="button" data-target="navArrow"></i> <div class="nav-dynamic-menu"> <div class="dynamic-menu-item-contents"> <div class="contents-item"> <p class="contents-item-title">Mobile/Wearable</p> <ul class="contents-item-list"> <li class="nav-item"> <a href="/galaxy-gamedev">Galaxy GameDev</a> </li> <li class="nav-item"> <a href="/galaxy-themes">Galaxy Themes</a> </li> <li class="nav-item"> <a href="/galaxy-watch">Galaxy Watch</a> </li> <li class="nav-item"> <a href="/health">Health</a> </li> <li class="nav-item"> <a href="/blockchain">Samsung Blockchain</a> </li> <li class="nav-item"> <a href="/samsung-dex">Samsung DeX</a> </li> <li class="nav-item"> <a href="/iap">Samsung IAP</a> </li> <li class="nav-item"> <a href="/internet">Samsung Internet</a> </li> <li class="nav-item"> <a href="/wallet">Samsung Wallet</a> </li> <li class="nav-item"> <a href="/mobile"> <span class="contents-underline">See all mobile products</span> <span class="arrow"> <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.45654 11.9L9.35659 6.99999L4.45654 2.09995" stroke="currentColor" stroke-width="1.05001"></path> </svg> </span> </a> <ul class="contents-item-list navbar-depth3 d-none"> <li class="d-none"> <a href="/pay/partner"><span>Samsung Pay Partner</span></a> </li> <li class="d-none"> <a href="/pay"><span>Samsung Pay</span></a> </li> <li class="d-none"> <a href="/galaxy-ar-emoji"><span>Galaxy AR Emoji</span></a> </li> <li class="d-none"> <a href="/galaxy-accessory"><span>Galaxy Accessory</span></a> </li> <li class="d-none"> <a href="/galaxy-edge"><span>Galaxy Edge</span></a> </li> <li class="d-none"> <a href="/galaxy-z"><span>Galaxy Z</span></a> </li> <li class="d-none"> <a href="/galaxy-performance"><span>Galaxy Performance</span></a> </li> <li class="d-none"> <a href="/galaxy-fm-radio"><span>Galaxy FM Radio</span></a> </li> <li class="d-none"> <a href="/galaxy-spen-remote"><span>Galaxy S Pen Remote</span></a> </li> <li class="d-none"> <a href="/galaxy-sensor-extension"><span>Galaxy Sensor Extension</span></a> </li> <li class="d-none"> <a href="/penup"><span>PENUP</span></a> </li> <li class="d-none"> <a href="/automation"><span>Samsung Automation</span></a> </li> <li class="d-none"> <a href="/neural"><span>Samsung Neural</span></a> </li> <li class="d-none"> <a href="/teegris"><span>Samsung TEEGRIS</span></a> </li> <li class="d-none"> <a href="/ese"><span>Samsung eSE SDK</span></a> </li> <li class="d-none"> <a href="/galaxy-watch-tizen"><span>Galaxy Watch for Tizen</span></a> </li> <li class="d-none"> <a href="/watch-face-studio"><span>Watch Face Studio</span></a> </li> <li class="d-none"> <a href="/one-ui-watch-tizen"><span>One UI Watch for Tizen</span></a> </li> <li class="d-none"> <a href="/gws-converter"><span>Galaxy Watch Studio Converter</span></a> </li> <li class="d-none"> <a href="/galaxy-watch-iap"><span>Samsung IAP for Galaxy Watch (Tizen)</span></a> </li> </ul> </li> </ul> </div> <div class="contents-item"> <p class="contents-item-title">Visual Display</p> <ul class="contents-item-list"> <li><a href="/smarttv/develop">Smart TV</a></li> <li><a href="/smarttv/hospitality-display">Smart Hospitality Display</a></li> <li><a href="/smarttv/signage">Smart Signage</a></li> </ul> </div> <div class="contents-item"> <p class="contents-item-title">Digital Appliance</p> <ul class="contents-item-list"> <li><a href="/family-hub">Family Hub</a></li> </ul> </div> <div class="contents-item"> <p class="contents-item-title">Platform</p> <ul class="contents-item-list"> <li><a href="/bixby">Bixby</a></li> <li><a href="/knox">Knox</a></li> <li><a href="/smartthings">SmartThings</a></li> <li><a href="/tizen">Tizen.NET</a></li> </ul> </div> </div> </div> </li> <li class="nav-item"> <a href="/design">Design</a> <i class="nav-btm-menu-arrow" role="button" data-target="navArrow"></i> <div class="nav-dynamic-menu"> <div class="dynamic-menu-item-contents"> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/design-system">Design System</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/one-ui">One UI</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/one-ui-watch">One UI Watch</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/smarttv/design">Smart TV</a></li> </ul> </div> </div> </div> </li> <li class="nav-item"> <a href="/distribute">Distribute</a> <i class="nav-btm-menu-arrow" role="button" data-target="navArrow"></i> <div class="nav-dynamic-menu"> <div class="dynamic-menu-item-contents"> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/galaxy-store">Galaxy Store</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/tv-seller-office">TV Seller Office</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/galaxy-games">Galaxy Store Games</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/instant-plays">Instant Plays</a></li> </ul> </div> </div> </div> </li> <li class="nav-item"> <a href="/support">Support</a> <i class="nav-btm-menu-arrow" role="button" data-target="navArrow"></i> <div class="nav-dynamic-menu"> <div class="dynamic-menu-item-contents"> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="https://forum.developer.samsung.com">Forums</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/dev-support">Dev Support</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/remote-test-lab">Remote Test Lab</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/android-usb-driver">Samsung Android USB Driver</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/galaxy-emulator-skin">Galaxy Emulator Skin</a></li> </ul> </div> </div> </div> </li> <li class="nav-item"> <a href="/connect">Connect</a> <i class="nav-btm-menu-arrow" role="button" data-target="navArrow"></i> <div class="nav-dynamic-menu"> <div class="dynamic-menu-item-contents"> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/news">News and Updates</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="/events">Events</a></li> </ul> </div> <div class="contents-item"> <ul class="contents-item-list"> <li><a href="https://www.samsungdeveloperconference.com/">Samsung Developer Conference</a></li> </ul> </div> </div> </div> </li> <li class="single nav-item"> <a href="/blog">Blog</a> </li> <!-- before login --> <li class="only-mobile"><a href="/login?redirectURL=%2Fsearch%3Fquery%3DSamsung">Sign in</a></li> </ul> </div> </div> </div> <!-- Search --> <div class="sdp-header-search" data-target="headerSearch"> <div class="header-search-body"> <div class="base-search-input-box"> <input type="text" class="base-search-input" placeholder="Search developer.samsung.com" data-target="searchInput"> <!-- remove icon --> <svg class="icon-remove" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-target="searchRemove"> <circle cx="12" cy="12" r="12" fill="#EAEAEA"></circle> <path d="M7.33301 7.3335L16.6663 16.6668" stroke="#9E9E9E" stroke-width="1.06667"></path> <path d="M16.6663 7.3335L7.33301 16.6668" stroke="#9E9E9E" stroke-width="1.06667"></path> </svg> <!-- search icon --> <svg class="icon-search" width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg"> <g id="Group"> <path id="Vector" d="M37.4072 37.4034L26.1128 26.0347" stroke="black" stroke-width="3.60003"></path> <path id="Vector_2" d="M30.5248 16.5413C30.5248 24.2637 24.2649 30.5245 16.5437 30.5245C8.8224 30.5245 2.5625 24.2637 2.5625 16.5413C2.5625 8.81893 8.8224 2.55811 16.5437 2.55811C24.2649 2.55811 30.5248 8.81893 30.5248 16.5413Z" stroke="black" stroke-width="3.60003"></path> </g> </svg> </div> </div> <div class="header-search-recommend"> <ul class="recommend-ul"> <!-- Recommendation list --> <li><p>Recommendations</p></li> <li class="sdp-search-result-item" attr-keyword="Blog"> <a href="/search?query=Blog"> <span>Blog</span> </a> </li> <li class="sdp-search-result-item" attr-keyword="Code Lab"> <a href="/search?query=Code%20Lab"> <span>Code Lab</span> </a> </li> <li class="sdp-search-result-item" attr-keyword="Foldable and Large Screen Optimization"> <a href="/search?query=Foldable%20and%20Large%20Screen%20Optimization"> <span>Foldable and Large Screen Optimization</span> </a> </li> <li class="sdp-search-result-item" attr-keyword="Health"> <a href="/search?query=Health"> <span>Health</span> </a> </li> <li class="sdp-search-result-item" attr-keyword="Samsung Wallet"> <a href="/search?query=Samsung%20Wallet"> <span>Samsung Wallet</span> </a> </li> <li class="sdp-search-result-item" attr-keyword="SDC24"> <a href="/search?query=SDC24"> <span>SDC24</span> </a> </li></ul> </div> <i class="header-search-close" data-close="headerSearch"> <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1.00017 1L13 12.9998" stroke="#1E1E1E" stroke-width="1.5"></path> <path d="M1 12.9998L12.9998 1" stroke="#1E1E1E" stroke-width="1.5"></path> </svg> </i> </div> <!-- Dimmed Effect --> <div class="header-dimmed" data-target="subNavDimmed"></div> </header> <section class="page-search" attr-page-id="search-v2"> <header class="page-search-header"> <div class="base-container"> <div class="base-search-input-box"> <input type="text" class="base-search-input" placeholder="Search in" data-target="searchInput" value="Samsung" id="search-text-input"/> <!-- remove icon --> <svg class="icon-remove" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-target="searchRemove"> <circle cx="12" cy="12" r="12" fill="#EAEAEA"/> <path d="M7.33301 7.3335L16.6663 16.6668" stroke="#9E9E9E" stroke-width="1.06667"/> <path d="M16.6663 7.3335L7.33301 16.6668" stroke="#9E9E9E" stroke-width="1.06667"/> </svg> <!-- search icon --> <svg class="icon-search" width="39" height="39" viewBox="0 0 39 39" fill="none" xmlns="http://www.w3.org/2000/svg"> <g id="Group"> <path id="Vector" d="M37.4072 37.4034L26.1128 26.0347" stroke="black" stroke-width="3.60003"/> <path id="Vector_2" d="M30.5248 16.5413C30.5248 24.2637 24.2649 30.5245 16.5437 30.5245C8.8224 30.5245 2.5625 24.2637 2.5625 16.5413C2.5625 8.81893 8.8224 2.55811 16.5437 2.55811C24.2649 2.55811 30.5248 8.81893 30.5248 16.5413Z" stroke="black" stroke-width="3.60003"/> </g> </svg> </div> </div> </header> <div class="base-page-layout bg-light-gray page-dev-support"> <div class="base-container"> <div class="page-search-body"> <!-- filter --> <article class="search-filter-box"> <button class="search-filter-button" type="button" data-open="searchFilter"> <span>Filter</span> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="17" viewBox="0 0 18 17" fill="none"> <path fill-rule="evenodd" clip-rule="evenodd" d="M0.874697 1.3335C0.760113 1.3335 0.732613 1.39975 0.813655 1.48079L7.39407 8.0612C7.47511 8.14225 7.54136 8.30225 7.54136 8.41683V12.3752C7.54136 12.4897 7.60761 12.6497 7.68866 12.7308L10.3107 15.3529C10.3918 15.4339 10.458 15.4064 10.458 15.2918V8.41683C10.458 8.30225 10.5243 8.14225 10.6053 8.0612L17.1857 1.48079C17.2668 1.39975 17.2393 1.3335 17.1247 1.3335H0.874697Z" stroke="#363636" stroke-width="1.5"/> </svg> </button> <div class="search-filter" data-target="searchFilter"> <div class="search-filter-header"> <p class="search-filter-title">Filter</p> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" data-close="searchFilter"> <path d="M1 1L15 15" stroke="black" stroke-width="1.6"/> <path d="M15 1L1 15" stroke="black" stroke-width="1.6"/> </svg> </div> <div class="search-filter-body"> <ul class="filter-accordion"> <li> <div class="filter-accordion-header collapsed" data-toggle="collapse" data-target="#collapse01"> <span>Content Type</span> <i class="filter-accordion-arrow"></i> </div> <div id="collapse01" class="filter-accordion-body collapse"> <ul class="filter-accordion-body-ul filter-type"> <li> <label class="base-checkbox"> <input type="checkbox" value="all" checked hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> ALL <span> 100 </span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" value="docs" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> DOCS <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" value="sdk" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> SDK <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" value="apidoc" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> API reference <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" value="codelab" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Code lab <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" value="blog" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Blog <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" value="news,events" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> News/Events <span></span> </span> </span> </label> </li> </ul> </div> </li> <li> <div class="filter-accordion-header collapsed" data-toggle="collapse" data-target="#collapse02"> <span>Category</span> <i class="filter-accordion-arrow"></i> </div> <div id="collapse02" class="filter-accordion-body collapse"> <ul class="filter-accordion-body-ul filter-category"> <li> <label class="base-checkbox"> <input type="checkbox" checked hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> ALL <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> AI <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> IoT <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> UI/UX <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Health <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Game <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Security <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Blockchain <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Web <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Design <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Camera <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> AR/VR/XR <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Mobile <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Galaxy watch <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Smart TV <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Family hub <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Marketplace <span></span> </span> </span> </label> </li> <li> <label class="base-checkbox"> <input type="checkbox" hidden /> <span class="checkbox-label"> <span class="checkbox-icon"></span> <span class="checkbox-text"> Advertisement <span></span> </span> </span> </label> </li> </ul> </div> </li> </ul> </div> <div class="search-filter-footer"> <button type="button" class="filter-reset"> <span>Reset</span> </button> </div> </div> <div class="search-filter-dimmed" data-dimmed="searchFilter"></div> </article> <section class="page-search-contents"> <div class="contents-header"> <div class="base-list-count"> <span class="count-text"> Samsung </span> <span class="count-number">100</span> </div> <!-- <div class="base-form-group"> <div class="dropdown" role="group" required=""> <button type="button" class="btn dropdown-toggle boxed-pill text-left" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span class="txt">Popular</span> </button> <div class="dropdown-menu" aria-labelledby="dropDownTab" x-placement="bottom-start" > <a class="dropdown-item" href="#" data-toggle="tab" data-value="test">Popular</a> <a class="dropdown-item" href="#" data-toggle="tab" data-value="test">Recent</a> <a class="dropdown-item" href="#" data-toggle="tab" data-value="test">Oldest</a> </div> </div> </div> --> </div> <div class="contents-body"> <!-- No Search results --> <div class="search-empty-panel d-none"> Sorry, no results<br class="d-block d-lg-none" /> found for "Samsung" on the website </div> <div class="contents-list-grid"> <a class="search-card" href="/health/blog/en-us/managing-sleep-data-with-samsung-health-and-health-connect"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health, galaxy watch, mobile </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Managing Sleep Data with Samsung Health and Health Connect</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> sleep is an important factor in our everyday life. good sleeping habits play a major role in physical health and overall well-being. with galaxy watch and samsung health, users can track their sleep, evaluate its quality, and get coaching to develop healthy habits. when the user wakes up, the sleep data is analyzed and the user can review key sleep statistics and how much time they spent in each sleep stage. sleep coaching functionality compares data to previous days, so the user can track how their daily routine improvements influence their sleep quality. galaxy watch devices can also measure blood oxygen during sleep, and users with a galaxy watch5 or higher can also track their skin temperature. when a phone is used together with the watch for sleep tracking, snoring detection is also possible. sleep tracking you can leverage samsung health advanced sleep tracking and health connect api to create applications that can read users’ real sleep data and create custom sleep session information that can be synchronized to samsung health. this blog demonstrates how to use the health connect api to read data from health connect, work with session data, and insert data to health connect, using sleep data as an example. to follow along with the steps in this blog, download the sample application: sleep recorder version 1.0 (128,0kb) jan 15, 2024 for more information about samsung health and health connect, see accessing samsung health data through health connect.. sleep data synchronization with health connect the health connect platform collects health-related data and synchronizes it with samsung health, enabling you to use it in your applications. sleep data is created on a smartwatch when the user wakes up. the data must be transferred to a paired mobile device for processing. data transfer is initiated when the mobile device is connected. the processed data creates a sleep record, which samsung health synchronizes to health connect. transfer and synchronization tasks can be delayed, depending on processor availability. prerequisites implementing functionality that uses health data in an application requires health connect library, healthconnectionclient, and permissions. add health connect api library dependencies to use the health connect api features in your application: dependencies { // add health connect library implementation "androidx.health.connect:connect-client:1.1.0-alpha06" } configure the “androidmanifest.xml” file declare the required permissions: <uses-permission android:name="android.permission.health.write_sleep"/> <uses-permission android:name="android.permission.health.read_sleep" /> add <intent-filter> in the <activity> section: <intent-filter> <action android:name="androidx.health.action_show_permissions_rationale" /> </intent-filter> add the <activity-alias> element required in android 14: <activity-alias android:name="viewpermissionusageactivity" android:exported="true" android:targetactivity=".mainmenuactivity" android:permission="android.permission.start_view_permission_usage"> <intent-filter> <action android:name="android.intent.action.view_permission_usage" /> <category android:name="android.intent.category.health_permissions" /> </intent-filter> </activity-alias> add <uses-permission> elements: <uses-permission android:name="android.permission.health.write_sleep"/> <uses-permission android:name="android.permission.health.read_sleep" /> add the <queries> element: <queries> <package android:name="com.google.android.apps.healthdata" /> </queries> note that in this application we also use: <package android:name="com.sec.android.app.shealth" /> adding this element is necessary, since we are going to open the samsung health app. however, if you are interested in using only the health connect api – the above part is not required. get a healthconnect client the healthconnectclient class is an entry point to the health connect api. it automatically manages the connection to the underlying storage layer and handles all ipc and serialization of the outgoing requests and the incoming responses. it is a good practice to ensure that the device running your application actually supports the health connect api library. the library is available only when the health connect application is installed on the device. noteandroid 14 health connect is part of the system and is installed by default. however in earlier versions, it's necessary to check if health connect is present on the device. check for health connect availability. if it is missing, display an error and redirect the user to the app store if installation of the app is possible: when (healthconnectclient.getsdkstatus(this)) { healthconnectclient.sdk_unavailable -> { // error message } healthconnectclient.sdk_unavailable_provider_update_required -> { // error message try { startactivity( intent( intent.action_view, uri.parse("market://details?id=com.google.android.apps.healthdata"), ), ) } catch (e: activitynotfoundexception) { startactivity( intent( intent.action_view, uri.parse("https://play.google.com/store/apps/details?id=com.google.android.apps.healthdata"), ), ) } } if health connect is available, get a healthconnectclient class instance: private val healthconnectclient by lazy { healthconnectclient.getorcreate(context) } request user permissions your application must request permission from the user to use their health data. create a set of permissions for the required data types. the permissions must match those you defined in the androidmanifest.xml file. val permissions = setof( healthpermission.getwritepermission(sleepsessionrecord::class), healthpermission.getreadpermission(sleepsessionrecord::class), ) check whether the user has granted the required permissions: suspend fun hasallpermissions(): boolean { if (healthconnectclient.sdkstatus(context) != healthconnectclient.sdk_available) { return false } return healthconnectclient.permissioncontroller.getgrantedpermissions() .containsall(permissions) } if not, launch the permission request: if (!healthconnectmanager.hasallpermissions()) { requestpermissions.launch(healthconnectmanager.permissions) } create the permissions prompt: private fun createrequestpermissionsobject() { requestpermissions = registerforactivityresult(healthconnectmanager.requestpermissionactivitycontract) { granted -> lifecyclescope.launch { if (granted.isnotempty() && healthconnectmanager.hasallpermissions()) { runonuithread { toast.maketext( this@mainmenuactivity, r.string.permission_granted, toast.length_short, ) .show() } } else { runonuithread { alertdialog.builder(this@mainmenuactivity) .setmessage(r.string.permissions_not_granted) .setpositivebutton(r.string.ok, null) .show() } } } } } retrieve sleep data from health connect in the sample application, to display sleep data, select a date and tap read data. a list of sleep sessions for that day is displayed. when you select a session, the application retrieves and displays its sleep stage information from health connect. to retrieve and display sleep session data: define the desired time range and send it to health connect manager. since a sleep session can start on the day before the selected date, be sure the application also retrieves sleep sessions from the previous day and later ignores the sessions that do not match the desired time range. val starttime = chosenday.minusdays(1).atstartofday(zoneid.systemdefault()).toinstant() val endtime = starttime.plus(2, chronounit.days).minus(1, chronounit.millis) val sleepsessions = healthconnectmanager.readsleepsessionrecords( starttime, endtime, ) retrieve the list of sleep session records in health connect manager. create a readrecordsrequest object and send it to health connect: val request = readrecordsrequest( recordtype = sleepsessionrecord::class, timerangefilter = timerangefilter.between(start, end), ) val response = healthconnectclient.readrecords(request) return response.records display the records in a listview on the application screen: for (session in sleepsessions) { sleepsessionranges.add(timerange.between(session.starttime, session.endtime)) val sessionstart = session.starttime.atzone(zoneid.systemdefault()).format( datetimeformatter.iso_local_time, ) val sessionend = session.endtime.atzone(zoneid.systemdefault()).format( datetimeformatter.iso_local_time, ) sleepstageslists.add(session.stages) sleepsessionsadapter.add("start: $sessionstart\t\tend: $sessionend gmt ${session.startzoneoffset}") } when a session is selected, display its sleep stage details: for (stage in sleepstageslists[sleepsessionindex]) { val stagestart = stage.starttime.atzone(zoneid.systemdefault()).format( datetimeformatter.iso_local_time, ) val stageend = stage.endtime.atzone(zoneid.systemdefault()).format( datetimeformatter.iso_local_time, ) val stagename = healthconnectmanager.enumtostagemap.getvalue(stage.stage) sleepstagesadapter.add("$stagestart\t-\t$stageend\t\t$stagename") } notealthough data is inserted to and stored in health connect in utc time with time zone offset, data retrieved from health connect is displayed in local time. you can extract health connect sleep data from any source, including data from galaxy watch. the following figure shows a sleep session in samsung health and the same data presented in the sample application. sleep data in samsung health and sample application create and insert sleep session data health connect not only allows you to read sleep data that is collected through samsung health, it also enables you to manually insert sleep data that can be synchronized to samsung health. to manually insert sleep data to health connect, you must prepare both a sleep session and sleep stage data. a session is a time interval during which a user performs an activity, such as sleeping. to prepare a session, you need to know its start and end time. in the sample application, an optional time zone offset is also implemented, since data in health connect database is stored in utc. if the session start hour and minute is later than the end hour and minute, the session is interpreted as starting on the previous day. in the following figure, the session is interpreted to have started at 22:00 on 2023-12-10 and ended at 06:00 on 2023-12-11. sleep session duration in the following part of the application, sleep stages can be added within the sleep session. to add a sleep stage, define its start time, end time, and name. for compatibility with samsung health, use the sleep stage names awake, light, rem, and deep. each defined sleep stage is visible in the list. ideally, sleep stages cover the entire sleep session, but this is not a requirement for synchronizing with samsung health. sleep stage creation to create and add a sleep session to health connect: check that the user has granted the necessary permissions: if (!healthconnectmanager.hasallpermissions()) { showdialoginfo(r.string.permissions_not_granted_api_call) return@launch } define the sleep session start and end time: val starttime = sleepsessiontimerange.startdatetimemillis val endtime = sleepsessiontimerange.enddatetimemillis val timezoneoffset = dateofsleepend.offset to add sleep stage data to the session, create a sleepstage record for each stage var sleepstageslist: arraylist<sleepsessionrecord.stage> val sleepstage = sleepsessionrecord.stage( starttime = sleepstagestart, endtime = sleepstageend, stage = healthconnectmanager.stagetoenummap.getvalue( activitysleepstagesbinding.spinstage.selecteditem.tostring(), ), ) sleepstageslist.add(sleepstage) in health connect manager, create a sleep session record and include the sleep stage list: suspend fun insertsleepsessionrecord( sleepstarttime: instant, sleependtime: instant, timezoneoffset: zoneoffset, stages: arraylist<sleepsessionrecord.stage>, ): boolean { var wasinsertsuccessful = false try { val sleepsessionrecord = sleepsessionrecord( sleepstarttime, timezoneoffset, sleependtime, timezoneoffset, "sleep record sample", "this is a sleep record sample recorded by sleeprecorder app", stages, ) insert the sleep session record into health connect: var wasinsertsuccessful = false try { wasinsertsuccessful = healthconnectclient.insertrecords(listof(sleepsessionrecord)).recordidslist.isnotempty() } catch (e: exception) { log.i(app_tag, "error inserting record: " + e.message) } the sleep session is now in health connect and visible in samsung health after data synchronization. in samsung health, go to the “sleep” screen. the inserted sleep session can be reviewed there with visualizations and analysis just like any other sleep session, such as those tracked on a galaxy watch. below is a sleep session from the sample application: sleep session conclusion this blog has demonstrated how you can develop an application that retrieves data from and inserts data into health connect, making it visible in the samsung health application after data synchronization. </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2024-01-22T12:51:00.000Z"></span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/managing-sleep-data-with-samsung-health-and-health-connect</span> </div> </a> <a class="search-card" href="/health/blog/en-us/health/blog/accessing-samsung-health-data-through-health-connect"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Accessing Samsung Health Data through Health Connect</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> health connect is a platform that enables you to integrate samsung health data with your applications, creating new opportunities for health applications that enhance the user's journey towards better health. using the health connect apis, you can, for example, retrieve a user's samsung health data, such as their exercise, sleep, and heart rate information, and send data to the samsung health application. this is the first blog post in a series introducing you to the health connect api features and how you can use them in your applications. let's begin by looking at how health connect interacts with samsung health data and the basic workflow. understanding this is essential for creating applications that use data from samsung health and health connect. samsung health samsung health is an application that can be installed on android smartphones and tablets, and on galaxy watches. it can use the sensors on the device, including the galaxy watch's bioactive sensor, to measure the user's overall health data, including steps, exercises, heart rate, sleep, blood oxygen saturation and body composition. the samsung health application is installed on both the galaxy watch and a smartphone. the application synchronizes the measurements between both devices and manages the user's health data securely on them. figure 1: samsung health on galaxy watch and android smartphone health connect since the samsung health application supports various useful health data types and gathers data from all connected devices, developers have been interested in obtaining access to that data. consequently, samsung collaborated with google to build the health connect platform, which was released in may 2022. health connect enables applications to share health and fitness data across android devices with the user's consent. for more information about health connect, see health connect guide and health connect apis. samsung health has supported synchronizing data with health connect since application version 6.22.5, released in october 2022. the health connect apis support devices using android sdk 28 (pie) or higher. notesince android 14, health connect is a system application and is supported by the health connect api versions 1.1.0 and higher. make sure your samsung health application version is up to date, to enable support for the latest health connect features. for more information on health connect as a system application, see: migrate health connect. once the user has connected samsung health to health connect, new or updated data in samsung health is shared to health connect. this means that your applications can use the health connect apis to access samsung health data. samsung health synchronizes health data with health connect in both directions: when samsung health has new or updated data, it writes the data to health connect. when health connect has updated data, samsung health retrieves it. for example, a blood glucose meter connected to samsung health measures the user's blood glucose level. this data is saved in samsung health and then sent to health connect. similarly, whenever there is new blood glucose data in health connect, samsung health retrieves that data and saves it in samsung health. figure 2: accessing samsung health data through health connect to demonstrate how data synchronization works, let's walk through an example of adding nutrition information to samsung health. to start data synchronization between samsung health and health connect, you must enable it in the samsung health application on your android device. from the settings menu, select health connect. if health connect is not installed, you are prompted to install it. the first time you access the health connect menu item in samsung health, tap get started. figure 3: get started screen you are asked to grant permissions to share your samsung health data with health connect. select the data you consent to sharing and tap allow. note“read” and “write” permissions are granted separately. figure 4: data sharing consent samsung health and health connect are now linked and data is shared between them. to test the data synchronization, in samsung health, go to food tracker and create some nutrition data. figure 5: nutrition data input in samsung health, go to settings > health connect, and select data and access. if health connect has received nutrition data from samsung health, a nutrition item appears in the browse data list. figure 6: synchronized nutrition data to view the synchronized data, select nutrition. figure 7: nutrition data in health connect data synchronization timing data synchronization between samsung health and health connect occurs on the smartphone side. to take advantage of health data collected by a galaxy watch, you must understand at which times the galaxy watch sends its data to the samsung health smartphone application. figure 8: data synchronization between watch and smartphone new or updated health data on each connected device is generally synchronized with samsung health in the following situations: the galaxy watch reconnects with the smartphone the user opens the samsung health application home screen on the smartphone the user pulls down on the samsung health application home screen on the smartphone however, some types of health data are synchronized differently: for battery conservation reasons, continuous heart rate data from the galaxy watch is not sent to the samsung health application on the smartphone immediately. however, manual heart rate measurements on the watch are synchronized immediately. enabling settings in samsung health to synchronize health data between samsung health and health connect please consider: using the latest samsung health. if you're interested in galaxy watch's data, check its version too. allowing data permissions through the following path: samsung health > settings > health connect > app permissions > samsung health (note that you must enter from the samsung health settings) synchronizing samsung health data in: samsung health > settings > sync with samsung cloud > switch to 'on'. accessing health connect apis if the user has synchronized their samsung health data with health connect, you can use the health connect apis to interact with it in various ways. for example: read and write data: you can retrieve data that has been shared from samsung health to health connect and send data to health connect to be synchronized to samsung health. delete specific data records: you can remove a specific data point or data of a specific type within a time interval. aggregate and filter data: you can filter the retrieved data by type or tag and analyze it, such as determining the average, maximum, minimum or sum of the values. session data: you can group data into sessions by time interval, such as to generate a sleep or activity session report. notefor security reasons, health connect data can only be retrieved by applications running in the foreground. the following table lists the various health data that can be synchronized between samsung health and health connect. samsung health data corresponding health connect data type all steps stepsrecord blood glucose bloodglucoserecord blood oxygen oxygensaturationrecord blood pressure bloodpressurerecord exercise, session exercisesessionrecord exercise, calories totalcaloriesburnedrecord exercise, distance distancerecord exercise, heart rate heartraterecord exercise, power powerrecord exercise, speed speedrecord exercise, vo2max vo2maxrecord heart rate heartraterecord nutrition nutritionrecord sleep session sleep stage sleepsessionrecord weight weightrecord weight, body fat bodyfatrecord weight, basial metabolic rate basalmetabolicraterecord weight, height heightrecord notesynchronized data scope can be changed depending on the samsung health version. notethe exercise data in the table (total calories burned, distance, power, speed, vo2max) are samsung health exercise tracker's data. samsung health’s activity tracker data are not synchronized to health connect. to get started with implementing health connect api functionality in your application: add the latest version of the health connect api library dependencies to your application's "build.gradle" file, for example: implementation "androidx.health.connect:connect-client:1.1.0-alpha02" declare the health connect application package name in your "androidmanifest.xml" file. check that the user has the health connect application, then create the "healthconnectclient" instance. declare the permissions for the health data types you want to use. now your application is ready to use the health connect apis. other blog posts in this series explore various health connect api use cases in more detail. related blogs reading body composition data with galaxy watch via health connect api </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2024-06-04T01:58:00.000Z"></span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/health/blog/accessing-samsung-health-data-through-health-connect</span> </div> </a> <a class="search-card" href="/health/blog/en-us/health/blog/reading-body-composition-data-with-galaxy-watch-via-health-connect-api"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health, galaxy watch </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Reading Body Composition Data with Galaxy Watch via Health Connect API</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> the body composition measurement is one of the powerful features of samsung galaxy watch. it is an important metric of your overall health. the body composition measurement data is displayed in the samsung health application on the galaxy watch and a compatible smartphone. in this article, we show you how to read the galaxy watch’s body composition data using the android health connect api in a sample application named "bia viewer". you can download the code for this sample application from the link at the bottom of this blog. bia is an abbreviation for bioelectrical impedance analysis, and the bia data measures body composition data. notethe body composition measurement feature is available on galaxy watch4 series and later models. installing health connect api the android health connect api provides interfaces for reading and writing your health and fitness data. the samsung health application exchanges data with the health connect api. for more information, see accessing samsung health data through health connect. notesynchronization of data between the samsung health application and the health connect api is supported on samsung health v6.22.5 and later. measuring body composition with galaxy watch as the first step in developing your ultimate health application, you must collect the body composition data using the samsung health application in galaxy watch. steps to measure bia with galaxy watch: start the samsung health application. ensure that the galaxy watch is worn tightly on your wrist. raise your arms so your armpits are open. place your middle finger on the 2 o’clock key and ring finger on the 4 o’clock key on the watch. touch your watch only. don’t let your hand on the watch’s keys touch your arm or other hand on the watch. maintain the finger positions on the galaxy watch dial until the measurement is completed. example of a result obtained by measuring body composition with the samsung health application: after the bia measurement is completed on the galaxy watch, the data can be synchronized with the samsung health application. synchronizing data with the health connect application once you have data in the samsung health application, it is synchronized with the health connect application. synchronized body composition data can be found directly in the health connect application. basal metabolic rate body fat height weight bia viewer application overview bia viewer is an application that reads the body composition data collected by the samsung health application with the health connect apis. by default, this application loads the data during startup. however, you can manually reload the data using the “refresh” button. the bia viewer application reads the body composition data such as weight, height, body fat, basal metabolic rate. the user's height is not displayed and is only used to calculate bmi. the step-by-step construction of the most important elements of the application are described in the next sections. note fat mass is calculated using the formula: [fat mass] = [body fat] * [weight] / 100 bmi is calculated using the formula: [bmi] = [weight] / ([height]* [height]) adding health connect api to your project before you start writing your code, you need to import and add the health connect api library to the file application/build.gradle in the dependencies section. implementation 'androidx.health.connect:connect-client:1.1.0-alpha06' now you are ready to use the health connect api. checking health connect availability on your device at the beginning of your application, it's a good idea to ensure that the device running your application actually supports the health connect api library. the library is available only when the health connect application is installed on the device. notesince android 14 health connect is part of the system and is installed by default. however in earlier versions, it's necessary to check, if health connect is present on the device. private fun checkavailability(): boolean { when (healthconnectclient.getsdkstatus(this)) { healthconnectclient.sdk_unavailable -> { //error message – unable to install health connect } return false } healthconnectclient.sdk_unavailable_provider_update_required -> { //error message – health connect not present on device, but can be installed } return false } else -> { return true } } } get healthconnectclient before going to the next step, you need to get healthconnectclient. healthconnectclient is an entry point to the health connect api. healthconnectclient automatically manages its connection to the underlying storage layer and handles all ipc and serialization of the outgoing requests and the incoming responses. private val healthconnectclient by lazy { healthconnectclient.getorcreate(context) } ask for permissions in the first step, you need to modify the androidmanifest.xml file. add <intent-filter> in the <activity> section: <intent-filter> <action android:name="androidx.health.action_show_permissions_rationale" /> </intent-filter> add <activity-alias> element required in android 14: <activity-alias android:name="viewpermissionusageactivity" android:exported="true" android:targetactivity=".mainactivity" android:permission="android.permission.start_view_permission_usage"> <intent-filter> <action android:name="android.intent.action.view_permission_usage" /> <category android:name="android.intent.category.health_permissions" /> </intent-filter> </activity-alias> add <uses-permission> elements: <uses-permission android:name="android.permission.health.read_basal_metabolic_rate" /> <uses-permission android:name="android.permission.health.read_body_fat" /> <uses-permission android:name="android.permission.health.read_height" /> <uses-permission android:name="android.permission.health.read_weight" /> add <queries> elements: <queries> <package android:name="com.google.android.apps.healthdata" /> </queries> to start the request permissions from your application, first build a set of permissions for the required data types. make sure to only ask for permissions mentioned in the manifest file. val permissions = setof( healthpermission.getreadpermission(basalmetabolicraterecord::class), healthpermission.getreadpermission(bodyfatrecord::class), healthpermission.getreadpermission(heightrecord::class), healthpermission.getreadpermission(weightrecord::class), ) it is a good practice to ask for the required permissions whenever the application tries to use this data type. first, you should check whether the user has consented to use the particular functionality. suspend fun hasallpermissions(): boolean { return healthconnectclient.permissioncontroller.getgrantedpermissions() .containsall(permissions) } if not, you should ask for it before using the api. private fun checkpermissions() { lifecyclescope.launch { if (healthconnectmanager.hasallpermissions()) { readalldata() } else { requestpermissions.launch(healthconnectmanager.permissions) } } } to ask for permissions, you need to create a request permissions object. private fun createrequestpermissionsobject() { requestpermissions = registerforactivityresult(healthconnectmanager.requestpermissionactivitycontract) { granted -> lifecyclescope.launch { if (granted.isnotempty() && healthconnectmanager.hasallpermissions()) { toast.maketext( this@mainactivity, r.string.permission_granted, toast.length_short, ).show() } else { alertdialog.builder(this@mainactivity) .setmessage(r.string.permission_denied) .setpositivebutton(r.string.ok, null) .show() } } } } sample permission request window: creating a query to read body composition data to read data, build the readrecordsrequest object and in the parameters, specify the time range and the data type. then, read the data by passing the readrecordsrequest object as a parameter. after the request is finished, the result contains the list of returned data that you requested. then you go through the list and read individual records. in our example, we will read only the last value. readrecordsrequest example code for weightrecord data type: suspend fun readweight(start: instant, end: instant): double { val request = readrecordsrequest( recordtype = weightrecord::class, timerangefilter = timerangefilter.between(start, end) ) val response = healthconnectclient.readrecords(request) if (response.records.isnotempty()) { val weightrecord = response.records.last() return weightrecord.weight.inkilograms } return 0.0 } list of all the data types used in the application: basalmetabolicraterecord bodyfatrecord heightrecord weightrecord checking query results now you are ready to run the test application on your phone and compare the results of the application with the samsung health application. the application can be tested on the device by running it directly from android studio. the data in both pictures are identical. you were able to successfully recover the data from the samsung health application using the health connect api. resources this blog is based on the bia viewer application. the entire code in this blog comes from this application. the application can be downloaded from: bia viewer version 1.1 (84,0kb) dec 08, 2023 enjoy your adventure creating the ultimate health application now you are ready to start using the samsung health application with the health connect api to enhance the capabilities of your application. </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2024-01-02T00:30:00.000Z"></span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/health/blog/reading-body-composition-data-with-galaxy-watch-via-health-connect-api</span> </div> </a> <a class="search-card" href="/health/blog/en-us/2022/04/27/handling-fitness-goals-using-health-services"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health, galaxy watch </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Handling Fitness Goals Using Health Services</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> one of the methods for obtaining data from health services running on galaxy watch with wear os powered by samsung is to register notifications for fitness goals. galaxy watch collects physical activity data in real-time and allows the user to sign up for information about achieving their goals. this mechanism allows you to monitor the health services data in the background. a sample application named goalevent shows the above described mechanism. full source code of this application can be downloaded from goalevent. application overview goalevent is a sample application with only one task: it is designed to monitor health services data in the background. its interface allows the user to subscribe to a health event. two buttons make it possible to set the amount of steps to achieve and a third button makes it is possible to subscribe to an event. a toast with information about achieving the goal is shown when the step count is greater than or equal to the set amount of steps. the construction of the most important elements of this application is described in the next sections, step-by-step. the code below comes from the goalevent application. add health services the first step to start using health services is to add the implementation of the service client to application dependencies. there are also necessary changes in the manifest file. to interact with health services, there should be information about this package. more information about adding health services usage to a project is contained in this article: using health services on galaxy watch obtain permissions the second step of the application is to obtain permissions. to use necessary operating system elements, you should place all of the required permissions in the android manifest. there are two types of permissions needed for receiving steps information and for showing an ongoing notification. permissions required by the application: <!-- for receiving steps information. --> <uses-permission android:name="android.permission.activity_recognition" /> <!-- for showing an ongoing notification. --> <uses-permission android:name="android.permission.foreground_service" /> as a next step, these permissions should be requested in the main activity of the application. after receiving the results of the permissions request and making sure that all of them are granted, it is possible to go on and check capabilities. request permission example code: requestpermissions(new string[]{ manifest.permission.foreground_service, manifest.permission.activity_recognition}, 0); check capabilities the next step, after obtaining the permissions, that is necessary to use the health platform and making sure that all permissions have been obtained, is to check that the device can provide passive goals. this takes place in the passive monitoring client where there are data types corresponding to a chosen activity—for example, steps. check capabilities in goal event client: boolean supportsstepsevent = result .getsupporteddatatypesevents() .contains(datatype.steps); if(supportsstepsevent) { registergoal(context); } register a goal after getting information that step goals are supported, it is possible to register a goal. to do this, you need to create a passive goal and register the appropriate callback. the callback, which is received, must be served by a specially designed interface. this class should be appropriately marked in the android manifest as a goal receiver. register a goal in the goal event client: public class goaleventclient { //... public void registergoal(context context) { if(goalregistered) return; goalregistered = true; mpassivegoal = new passivegoal( new datatypecondition(datatype.steps, value.oflong(number_of_steps), comparisontype.greater_than_or_equal), passivegoal.triggertype.once); mpassivemonitoringclient.registerpassivegoalcallback(mpassivegoal, new componentname(context, eventreceiver.class)); } //... } add receiver information inside of the application tag in the android manifest: <application <!--....--> <receiver android:name="com.samsung.android.goalevent.eventreceiver" android:exported="true"> <intent-filter> <action android:name="hs.passivemonitoring.goal" /> </intent-filter> </receiver> <!--...--> </application> receive notification in the receiver code, first you need to check the intent action to ensure that it is a passive goal. then reconstruct the passive goal from the intent to determine that the incoming goal is the same as the goal created earlier. override the receive method in the event receiver: public final class eventreceiver extends broadcastreceiver { private static final string tag = "eventreceiver"; @override public void onreceive(context context, intent intent) { if(!intent.getaction().equals(passivegoal.action_goal)){ return; } passivegoal goal = passivegoal.fromintent(intent); if(goal != null && goal.equals(goaleventclient.getinstance(context).getpassivegoal())){ log.i(tag, "step goal achieved!"); toast.maketext(context, r.string.step_goal_achieved, toast.length_long) .show(); goaleventclient.getinstance(context).unregistergoal(); } } } unregister the goal it is a good practice to unregister the goal when the application is destroyed by the os. to do this, add an additional boolean parameter which holds information about the registration status. this parameter should be set to "true" at the time of registration and to "false" at the time of goal deregistration. add a function to unregister a goal which is triggered at the time of destroying the application: public class goaleventclient { //... public void unregistergoal() { if(!goalregistered) return; goalregistered = false; mpassivemonitoringclient.unregisterpassivegoalcallback(mpassivegoal); mpassivegoal = null; } //... } test the application on a device the application can be tested on the galaxy watch with wear os powered by samsung by running it directly from android studio. to test the application, follow these steps: set the number of steps you want to achieve. push the 'set goal' button. 3. put your watch on your wrist and walk the set number of steps. 4. after reaching the goal, you receive information on the screen about achieving the goal and the watch vibrates. enjoy your adventure creating the ultimate health application now you are ready to start handling fitness goals using health services data in the background in your application on galaxy watch with wear os powered by samsung. check out our next series of posts that cover ways to access exercises using the health services api! </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2022-04-27T04:45:00.000Z"></span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/2022/04/27/handling-fitness-goals-using-health-services</span> </div> </a> <a class="search-card" href="/health/blog/en-us/2022/01/14/using-health-services-on-galaxy-watch"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health, galaxy watch </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Using Health Services on Galaxy Watch</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> health services provides an advanced set of apis that allow your application to take full advantage of the powerful hardware available on galaxy watches running wear os powered by samsung. thanks to this careful combination of hardware and software, applications are able to reliably track information from sensors in the watch. this solution allows developers to specify what type of data they are using in their applications, as well as allowing users to decide what data can be processed and accessed. getting things ready to take advantage of health services health services works on devices such as galaxy watch4 and galaxy watch4 classic operating on wear os powered by samsung. health services requires android 11 (api level 30) or above. add required information to your app’s configuration files to start using health services in a new or existing android studio project, you just need to follow a series of steps described below: add the appropriate library dependency to your app’s build.gradle file. dependencies { implementation 'androidx.health:health-services-client:1.0.0-alpha03 // ... } in your app’s android manifest, add the necessary configuration to allow your app to connect with the health service. <queries> <package android:name="com.google.android.wearable.healthservices" /> </queries> add the permissions required by your app. <uses-permission android:name="android.permission.body_sensors" /> <uses-permission android:name="android.permission.activity_recognition" /> <uses-permission android:name="android.permission.foreground_service" /> <uses-permission android:name="android.permission.access_fine_location" /> in order to improve the security of your application and to ensure a good user experience, you should only add the permissions that are required by your application from the list above. additionally, if your application features passive monitoring, you have to add the lines below to your app’s manifest to register the health event broadcast receiver. <receiver android:name="com.samsung.android.eventsmonitor.eventbroadcastreceiver" android:exported="true"> <intent-filter> <action android:name="hs.passivemonitoring.health_event" /> </intent-filter> <receiver/> requesting permissions programmatically apart from being registered in the app’s manifest, permissions have to be requested programmatically to validate and get user consent at runtime. the code below shows how to request these permissions: requestpermissions(new string[] {manifest.permission.body_sensors, manifest.permission.foreground_service, manifest.permission.activity_recognition, manifest.permission.access_fine_location}, 0); at runtime, if your application has requested the permissions correctly, a popup similar to the one below appears after the execution of your application: to get the result of the permission request you have made previously, you should check the result as shown in the code below: @override public void onrequestpermissionsresult(int requestcode, @nonnull string[] permissions, @nonnull int[] grantresults) { if(requestcode == 0) { list<string> notgrantedpermissions= new linkedlist<>(); setpermissiongranted(true); for(int i=0; i<permissions.length; i++) { if(grantresults[i] == permission_denied) { setpermissiongranted(false); notgrantedpermissions.add(permissions[i]); } } if(!getpermissiongranted()) { // handle permission denied here. } } super.onrequestpermissionsresult(requestcode,permissions,grantresults); } checking the device capabilities there is nothing more annoying than an application that does not work as expected, causing a bad user experience or even worse, a crash. fortunately, health services provides a way to verify if the current setup you have configured supports the functionality required. it accomplishes this by using apis to get the capabilities and supported data types for the current configuration. this allows developers to handle errors and decide the best way to notify the users of the app about potential problems. the code below is an example of the usage of such apis for exerciseclient: // connection to the health services healthservicesclient healthclient = healthservices.getclient(this); exerciseclient exerciseclient = healthclient.getexerciseclient(); listenablefuture<exercisecapabilities> capabilitiesfuture = passiveclient.getcapabilities(); futures.addcallback(capabilitiesfuture, new futurecallback<exercisecapabilities>() { @override public void onsuccess(@nullable exercisecapabilities result) { runningcapabilities = result .supporteddatatypesexcercise() .contains(exercisetype.running) } @override public void onfailure(throwable t) { // display an error } }, contextcompat.getmainexecutor(this)); enjoy your adventure creating the ultimate health application now that you have finally set up health services in your app’s project, you are ready to start using the apis to enhance the capabilities of your application. we encourage you to check our next series of posts to discover even more from health services on galaxy watch! </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2022-01-14T23:56:00.000Z"></span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/2022/01/14/using-health-services-on-galaxy-watch</span> </div> </a> <a class="search-card" href="/wallet/blog/en-us/2024/04/23/get-started-with-add-to-samsung-wallet"> <div class="search-card-header"> <p> <span>tutorials</span> </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Get Started with "Add to Samsung Wallet"</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> introduction smartphones have become an essential part of our everyday lives. users are continually searching for more convenient ways to perform their tasks on their smartphones, driving them toward services with greater usability. as smartphones advance, our lives become simpler. galaxy users have completely embraced the convenience of paying with samsung pay, and no longer carry physical payment cards. this led to the evolution of samsung pay into samsung wallet, incorporating biometric-authentication-based security solutions and adding various features to replace conventional wallets. since june 2022, samsung wallet has been expanding its service area based on the existing samsung pay launching countries. this article aims to introduce samsung wallet and guide you through the integration process of the "add to samsung wallet" feature, which allows you to digitize various content and offer them as wallet cards. notice this article introduces non-payment service cards. if you want to learn more about the payment service of samsung wallet, visit the samsung pay page. you can get information on online payment services such as in-app payments, web checkout, and w3c payments. add to samsung wallet service let's delve deeper into the "add to samsung wallet" feature. digitized content registered in samsung wallet comes in the form of cards called wallet cards. registering a wallet card is effortless: simply click the "add to samsung wallet" button, and the card is stored securely on users’ galaxy smartphones. "add to samsung wallet" button and wallet card notice the benefits of using wallet cards can be found in the commercial video forgetting can be awesome. wallet cards the "add to samsung wallet" service is an open platform that supports offering various types of content such as wallet cards. we are streamlining service integration with content providers across different regions and adding useful features. boarding pass event ticket loyalty gift card coupon id card generic card pay as you go (in progress) reservation (in progress) digital key (in progress) notice generic card supports unstructured forms of cards. be a samsung wallet partner partner onboarding to begin offering content through samsung wallet, you must first register as a partner on the samsung wallet partner portal. the integration process is detailed on the samsung developer portal. to join the samsung wallet partner portal, create a samsung account that is used as the service administrator. wallet card management once enrolled, you can create service cards on the wallet cards menu. each card is assigned a card id representing the service, and you can set the card type and linking information. you can manage cards according to their status – test or live. configuring wallet card notice after completing all required forms for the wallet card, click the launch button to request card activation. before providing the service to actual users, remember to turn off the 'test mode.' how to safely secure user data key generation and certificate request the registration process includes certificate exchange to securely transmit service data. refer to the diagram and developer guide, security key & certificate creation guide, to complete the certificate registration and partner enrollment smoothly. certificates exchange process ensuring data security to prevent forgery and leakage of user card data, secure tokenization processing is required. json web token (jwt), which includes encryption and signature, has a validity time basis for verification, thus providing enhanced security. in particular, when generating this token, the key and certificate previously obtained through the certificate exchange process are used. process of generating and verifying security tokens notice depending on how partners provide content services to users, you can choose how to deliver data to the samsung wallet service. two ways to transfer wallet card data add to samsung wallet interface provides two methods for partners to deliver users digital content as wallet cards. data transmit link the general way to transfer wallet card data is to organize tokenized data in the link attached to the button, and the card data is transmitted to the samsung wallet service when the user clicks the button. as long as samsung wallet support is confirmed, you can generate a link containing the user's card data and configure the "add to samsung wallet" button to run the link when pressed, either on an application or web page. data transmit process data fetch link another method to transfer wallet card data is to include only the refid, which represents the user's content, in the "add to samsung wallet" link and transmit it to the samsung wallet service. when a user clicks the "add to samsung wallet" button, samsung servers refer to the get card data api information set on the wallet card and retrieve user content using the received refid to complete registration. data fetch process this method is suitable for providing user's data through email or mms messages where static links cannot be avoided. there is an option to secure these static links. data fetch process for static links setting up data synchronization on the partner portal, you can set up the wallet card information and configure the server interaction api that the content provider needs to prepare. this api is an interface for managing card registrations, deletions, information, and state changes to sync with those registered on samsung wallet. register wallet cards when a user card is added to samsung wallet, samsung wallet servers use the send card state api to communicate card registration and deletion status to the content provider, allowing them to manage content that needs to be synchronized with samsung wallet. when a wallet card is registered, added event is sent to the partner's server update wallet cards changes to the synchronization target content can be notified to the samsung wallet service through the update notification api. here, the value that distinguishes each piece of content is the refid that the partner must provide when registering the users’ wallet card. through the get card data api, samsung wallet servers can check the latest content information any time. if updates occur on the partner's side, updated event notifications should be sent to the samsung server in case users withdraw content from the partner's side in case users delete cards from samsung wallet notice both servers should verify requests using the authorization header of the api request. this authorization token is in jwt format, familiar from card data security. effortless wallet card registration with just one click this feature is primarily composed of a link-connected button and can be provided through the content provider's application, web page, email, or mms message. various service channels javascript library for web developers we provide a javascript library and a user guide, implement the button, to help integrate your web pages. creating buttons and links in your app for configuring buttons in applications, utilize the button image resources. providing services via mms, email, or qr codes to provide services through fixed links, check out the details of the data fetch link. these static links can also be used by scanning qr codes. experience the service and practice you can experience service integration development using the codelab and use the testing tool to preregister the wallet cards created on the partner portal, which could be helpful. conclusion we've looked at how to provide digital content through the "add to samsung wallet" feature. we continuously update the guides on the developer portal, so please refer to them when preparing for integration. summary the "add to samsung wallet" service welcomes participation from content service partners and developers. for inquiries or technical support, please contact us through the form provided on the developer portal. i hope this post has been helpful, and now i'll conclude my writing here. thank you. this post was written based on the sdc23 korea session. </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2024-04-23T02:05:00.000Z"></span> </p> <p> <i class="icon-user"></i> <span>Choi, Jonghwa</span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/wallet/blog/en-us/2024/04/23/get-started-with-add-to-samsung-wallet</span> </div> </a> <a class="search-card" href="/health/blog/en-us/transfer-heart-rate-from-galaxy-watch-to-a-phone"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health, galaxy watch, mobile </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Measure and Transfer Heart Rate Data from Galaxy Watch to a Paired Android Phone</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> the samsung privileged health 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 2 connected sample applications. a watch application uses the samsung privileged health 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 2 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(trackingtype) 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 on-demand heart rate tracking, the update listener is invoked every second and each data point list contains 1 element. 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. since samsung privileged health sdk version 1.2.0, 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 privileged health 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 </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2024-01-16T10:37:00.000Z"></span> </p> <p> <i class="icon-user"></i> <span>Samsung Developers</span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/transfer-heart-rate-from-galaxy-watch-to-a-phone</span> </div> </a> <a class="search-card" href="/health/blog/en-us/events-monitoring"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health, galaxy watch </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Events Monitoring</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> the galaxy watch running wear os powered by samsung can detect events like hard falls. to detect the hard falls, the watch uses a built-in accelerometer. using the health services api, you can receive a fall detection event in your watch application. in this blog, we create a wear os application to identify a fall detection event and demonstrate how to use the health services api to achieve this on the galaxy watch. the galaxy watch uses the fall detection event in its sos feature. for more information, see use your samsung smart watch in an emergency situation. it can be used to take care of elderly people or patients. how to trigger a fall detection event in your application on the galaxy watch if the functionality provided with the watch is not sufficient for your solution, you can use the health services api to detect this event in your own application. in this section, we describe all the important steps that you must follow when building an events tracking app. as an example, we use the eventsmonitor sample project. project settings before you start writing your code, you need to import the health services api library in the dependencies section of the app/build.gradle file. implementation androidx.health:health-services-client:1.0.0-beta01 now you are ready to use the health services api. get passivemonitoringclient passivemonitoringclient enables tracking of the data in the background (without requiring an ongoing workout) and the events that can occur. you need to get this client to make your application suscribe to the events. private var healthservicesclient: healthservicesclient private var passivemonitoringclient: passivemonitoringclient init { healthservicesclient = healthservices.getclient(context) passivemonitoringclient = healthservicesclient.passivemonitoringclient } ask for permissions in the first step, you need to modify the androidmanifest.xml file. add the <uses-permission> element in the global section: <uses-permission android:name="android.permission.activity_recognition" /> <uses-permission android:name="android.permission.receive_boot_completed" /> <uses-permission android:name="android.permission.foreground_service" /> add the <queries> element: <queries> <package android:name="com.google.android.wearable.healthservices" /> </queries> it is a good practice to ask for the required permissions whenever the application tries to use this data type. first, you should check whether the user has consented to use the particular functionality. permissiongranted = applicationcontext.checkselfpermission( manifest.permission.activity_recognition) == packagemanager.permission_granted if not, you must ask for it before using the api. private fun requestpermissions() { permissionlauncher.launch(android.manifest.permission.activity_recognition) } to ask about permissions, you need to create a request permissions object. permissionlauncher = registerforactivityresult(activityresultcontracts.requestpermission()) { result -> permissiongranted = result } this is an example of a permission request window: using health services api to get events to asynchronously receive information about a fall detection event, provide the class which inherits from the passivelistenerservice class and override the onhealtheventreceived method. class passivehealtheventservice : passivelistenerservice() { override fun onhealtheventreceived(event: healthevent) { runblocking { log.i(tag, "onhealtheventreceived received with type: ${event.type}") healthservicesmanager.getinstance(applicationcontext).recordhealthevent(event) super.onhealtheventreceived(event) } } } add information about this class with the permissions to the androidmanifest.xml file. <service android:name=".passivehealtheventservice" android:exported="true" android:permission="com.google.android.wearable.healthservices.permission.passive_data_binding" /> when you have the passivemonitoringclient and passivehealtheventservice classes, you can then subscribe to the events. private val healtheventtypes = setof(healthevent.type.fall_detected) suspend fun registerforhealtheventsdata() { log.i(tag, "registering listener") val passivelistenerconfig = passivelistenerconfig.builder() .sethealtheventtypes(healtheventtypes) .build() passivemonitoringclient.setpassivelistenerserviceasync( passivehealtheventservice::class.java, passivelistenerconfig ).await() registered = true } if you no longer want to receive information about the fall detection event, please unregister your application from the service. this can be done using the passivemonitoringclient api. suspend fun unregisterhealtheventsdata() { log.i(tag, "unregistering listeners") passivemonitoringclient.clearpassivelistenerserviceasync().await() registered = false } the healthevent class contains information about the event, such as: type - returns the type of the event (fall_detected, unknown). instant - returns the time of the health event. datapointcontainer - returns the metrics associated with the event. test application on the galaxy watch you can test this functionality in the following two ways: manual test you can simulate a fall by trying to fall on a mat. notebefore performing the manual test, ensure that you have taken all safety precautions for yourself. for example, use cushions to soften the fall impact, etc. use synthetic data testing is available on an emulator. use the command line to run and execute commands for synthetic data generation. for more details about this feature, see simulate sensor data with health services. with adb, you can send subsequent commands to the device. notethis blog is based on wear os 4. you can check your watch’s wear os version in galaxy watch > settings > about watch > software information> wear os version. for testing on wear os 3, see more information here. to start the synthetic data generation, run the following command: $ adb shell am broadcast \ -a "whs.use_synthetic_providers" \ com.google.android.wearable.healthservices to simulate a fall, run the following command: $ adb shell am broadcast \ -a "whs.fall_over" \ com.google.android.wearable.healthservices when the tests are finished, to switch back to using real sensors, run the following command: $ adb shell am broadcast \ -a "whs.use_sensor_providers" \ com.google.android.wearable.healthservices resources this blog is based on the eventsmonitor application. the whole presented code comes from this application. the entire application can be downloaded from: eventsmonitor version 1.0 (86,0kb) dec 12, 2022 enjoy your adventure creating the ultimate health application now you are ready to start the fall detection event in your application. we encourage you to try doing it by yourself and explore other features provided by the health services sdk. </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2024-01-18T08:53:00.000Z"></span> </p> <p> <i class="icon-user"></i> <span>Samsung Developers</span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/events-monitoring</span> </div> </a> <a class="search-card" href="/health/blog/en-us/2022/06/22/exercise-statistics-monitoring"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health, galaxy watch </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Exercise statistics monitoring</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> tracking exercise progress throughout its duration can be a problematic task requiring a lot of work from the developer. health services available on a samsung galaxy watch provide a precise and convenient way to gather statistics. in this blog post we cover different ways to gather exercise data. we created an example application called exercise monitor which gathers statistics about your heart rate and speed while running on a treadmill. in the application we use two ways to gather statistics: statisticaldatapoint for speed and manual heart rate tracking for comparison. you can download it here. we also include an example in this blog using cumulativedatapoint to gather statistics. the basics of connecting to health services are covered in the blog using health services on galaxy watch. let's start by setting up your exercise then continue by working with the exercise data. tracking data with statisticaldatapoint to obtain a statisticaldatapoint object, we need to read aggregated metrics in the exercise configuration builder: exercisecapabilitiesset = result.getexercisetypecapabilities(exercisetype).getsupporteddatatypes(); exerciseconfigbuilder = exerciseconfig.builder() .setexercisetype(exercisetype) .setdatatypes(exercisecapabilitiesset) .setaggregatedatatypes(exercisecapabilitiesset); after that we can read these metrics from exerciseupdate: map<datatype, aggregatedatapoint> aggregatemap = update.getlatestaggregatemetrics(); then we have to read the appropriate datatype from the map. in this case—speed: aggregatedatapoint aggregatespeed = aggregatemap.get(datatype.speed); the aggregatedatapoint object that is obtained can be an instance of two classes—either statisticaldatapoint or cumulativedatapoint (which we cover later): statisticaldatapoint sdpspeed = (statisticaldatapoint) aggregatespeed; from there we can easily read all important statistical data: double minspeed = sdpspeed.getmin().asdouble(); double maxspeed = sdpspeed.getmax().asdouble(); double avgspeed = sdpspeed.getaverage().asdouble(); and use them however we like in the application, for example updating text on labels: txtminspeed.settext(string.format("min speed: %.1f km/h", minspeed)); txtmaxspeed.settext(string.format("max speed: %.1f km/h", maxspeed)); txtavgspeed.settext(string.format("average speed: %.1f km/h", avgspeed)); that’s all we need to do—easy to read and fast to implement. in this case we have only read exercise data, but statistics can be obtained from other health services areas as well. tracking data manually now let's compare tracking data with statisticaldatapoint to tracking heart rate manually. first we need to create appropriate global variables required to track data—especially for the average heart rate that requires information about count samples we gather throughout exercising: double hrmin = 1000, hrmax = 0, hrsum = 0; int hrcount = 0; since our application assumes that we can exercise multiple times, we need to reset these global variables each time we stop and start an exercise. therefore, we need a separate function that resets the variables each time we start an exercise: void init() { hrcount = 0; hrmin = 1000; hrmax = 0; hrsum = 0; txtminhr = binding.txtminhr; txtminspeed = binding.txtminspeed; txtmaxhr = binding.txtmaxhr; txtmaxspeed = binding.txtmaxspeed; txtavghr = binding.txtavghr; txtavgspeed = binding.txtavgspeed; } we are ready to work on reading data from exerciseupdate. first we get the latest readings: map<datatype, list<datapoint>> datamap = update.getlatestmetrics(); then we read heartrate datatype from the map: list<datapoint> hrpoints = datamap.get(datatype.heart_rate_bpm); this returns a list of heart rates registered since the previous exerciseupdate callback. we have to iterate through every element and compare its values to our statistical points: for (int i = 0; i < hrpoints.size(); i++) { double curval = hrpoints.get(i).getvalue().asdouble(); if (curval == 0) continue; hrcount++; hrsum += curval; if (curval < hrmin) hrmin = curval; if (curval > hrmax) hrmax = curval; } this covers min and max values. as for the average, we have to remember that not every exerciseupdate may contain heart rate readings. if it doesn’t, we need to prevent division by 0: if (hrcount == 0) return; double avghr = hrsum / hrcount; now we are ready to update our text labels—with the exception of the minimum heart rate. if there were no readings, we leave it at 0 instead of updating it to the initialized value: txtavghr.settext(string.format("average hr: %.0f bpm", avghr)); if (hrmin < 1000) txtminhr.settext(string.format("min hr: %.0f bpm", hrmin)); txtmaxhr.settext(string.format("max hr: %.0f bpm", hrmax)); tracking data with cumulativedatapoint the third option to gather data statistics is using cumulativedatapoint. it is not used in the exercise monitor sample application, but we present an example application in this post. one example cumulativedatapoint can be used for is repetition statistics, like counting deadlift or dumbbell curl repetitions throughout sets. we start similarly to statisticaldatapoint by gathering the latest aggregate metrics. but, this time we read the repetition count and cast it to cumulativedatapoint: map<datatype, aggregatedatapoint> aggregatemap = update.getlatestaggregatemetrics(); cumulativedatapoint cdprepetitions = (cumulativedatapoint) aggregatereps; now we can measure total repetitions done throughout sets, as well as the workout start and end time: long totalreps = cdprepetitions.gettotal().aslong(); instant starttime = cdprepetitions.getstarttime(); instant endtime = cdprepetitions.getendtime(); enjoy your adventure creating an application that will track anything you want! we have shown you three ways of gathering exercise statistics. we encourage you to use statisticaldatapoint or cumulativedatapoint whenever possible, as they are well-designed to track exercise progress and might significantly simplify development of your fitness app. now you are ready to start gathering aggregated exercise statistics using health services data in the background in your application on galaxy watch with wear os powered by samsung. we encourage you to experiment on your own with data you wish to track and exercises you want to perform and see how easy and convenient it is! </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2022-06-22T11:04:00.000Z"></span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/2022/06/22/exercise-statistics-monitoring</span> </div> </a> <a class="search-card" href="/health/blog/en-us/2022/02/16/tracking-exercises-with-galaxy-watch"> <div class="search-card-header"> <p> <span>tutorials</span> <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none"> <path d="M9.23804 2.66699L5.06604 13.3337" stroke="#363636" stroke-width="1.5"/> </svg> health, galaxy watch </p> <span class="search-card-badge"> blog </span> </div> <div class="search-card-text-group"> <h2 class="search-card-title">Tracking Exercises with Galaxy Watch</h2> <p class="search-card-text" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;"> galaxy watch offers a convenient way of measuring exercise progress. modern sensors designed specifically for health services provide the most precise readings. after connecting to health services, you can measure certain exercises and track their values. this blog describes all the important steps to build an exercise tracking app using the health services api. we use example code introduced in health code lab for tracking exercise. you can download the source code from this code lab. health services defines a variety of exercise types. for a full exercise type list, take a look at exercisetype. on galaxy watch4 and galaxy watch4 classic, a repetition counter is available for the following exercises: back_extension barbell_shoulder_press bench_press bench_sit_up burpee crunch deadlift forward_twist dumbbell_curl_right_arm dumbbell_front_raise dumbbell_lateral_raise dumbbell_triceps_extension_left_arm dumbbell_triceps_extension_right_arm dumbbell_triceps_extension_two_arm dumbbell_curl_left_arm jump_rope jumping_jack lat_pull_down lunge squat upper_twist in this application, we are going to use deadlift. the example code used for deadlift can be easily adapted to track all repetition-based exercises. the basics of connecting to health services are covered in the blog using health services on galaxy watch. setting up an exercise once connected to the health services api, we are ready to set up the exercise. in this case we use deadlift as a sample exercise. first, we need to get the exercise client: exerciseclient exerciseclient = client.getexerciseclient(); after that, we need to set the exercise type in the configuration builder: exercisetype exercisetype = exercisetype.deadlift exerciseconfigbuilder exerciseconfigbuilder = exerciseconfig.builder() .setexercisetype(exercisetype); to see what can be tracked for our exercise, we need to check its capabilities. we do this by using a listenablefuture object and listening for a callback from health services. listenablefuture<exercisecapabilities> capabilitieslistenablefuture = exerciseclient.getcapabilities(); when we receive a callback, we can receive a set with capabilities: futurecallback<exercisecapabilities>() { @override public void onsuccess(@nullable exercisecapabilities result) { try { exercisetypecapabilities exercisetypecapabilities = result.getexercisetypecapabilities(exercisetype); set<datatype> exercisecapabilitiesset = exercisetypecapabilities.getexercisecapabilities(result); } if you do not want to track some of these values, at this point, you can remove them from a set. by default, all datatypes that a certain exercise can measure are being stored as a set. by removing them before setting up a configuration builder, you can exclude tracking unnecessary values. once we are ready, we can finish configuring an exercise: exerciseconfigbuilder = exerciseconfig.builder() .setexercisetype(exercisetype) .setdatatypes(exercisecapabilitiesset); setting up exercise listener an exercise listener is an object that allows us to get exercise updates from health services, whenever they are available. to set up the listener, we need to override three methods: exerciseupdatelistener exerciseupdatelistener = new exerciseupdatelistener() { @override public void onexerciseupdate(exerciseupdate update) { //processing your update } @override public void onavailabilitychanged(datatype datatype, availability availability) { //processing availability } @override public void onlapsummary(exerciselapsummary summary) { //processing lap summary } }; starting and stopping the exercise we are ready to start tracking our exercise. to do that, we use the listenablefuture object that gets callbacks from the healthservices api whenever an update is available. to build this object, we send our configuration to the exercise client while starting measurement: listenablefuture<void> startexerciselistenablefuture = exerciseclient.startexercise(exerciseconfigbuilder.build()); when we get a callback from the healthservices api, we start our listener: listenablefuture<void> updatelistenablefuture = exerciseclient.setupdatelistener(exerciseupdatelistener); we finish exercise in a similar way, by creating a listenablefuture object that asks the health services api to stop tracking exercise: listenablefuture<void> endexerciselistenablefuture = exerciseclient.endexercise() processing exercise update data exercise update data contains various information about the performed exercise. after setting up a listener, we retrieve it in a callback: public void onexerciseupdate(@nonnull exerciseupdate update) { try { updaterepcount(update); } catch (deadliftexception exception) { log.e(tag, "error getting exercise update: ", exception); } } in this example, we focus on one of most important readings—latest metrics. we store them in a map: map<datatype, list<datapoint>> map = update.getlatestmetrics(); now we can read particular values by looking for their key: list<datapoint> reppoints = map.get(datatype.rep_count); list<datapoint> caloriespoints = map.get(datatype.total_calories); the last value on the list is the latest reading in the current update. we can use it in our application, for example, when updating a label: string repvalue = string.format("%d", iterables.getlast(reppoints).getvalue().aslong()); txtreps.settext(string.format("reps count: %s", repvalue)); this is how exercise data can be accessed and processed using health services on galaxy watch. it’s a quick and convenient way to track its progress that everybody can implement into a watch application. </p> </div> <div class="search-card-info"> <p> <i class="icon-calendar"></i> <span attr-date-format="2022-02-16T13:01:00.000Z"></span> </p> </div> <div class="search-card-link"> <span>https://developer.samsung.com/health/blog/en-us/2022/02/16/tracking-exercises-with-galaxy-watch</span> </div> </a> </div> </div> <!-- Pagination --> <div class="base-pagination "> <ul class="pagination"> <li class="d-none"> <a class="d-none" href="/search?query=Samsung&type=all&category=all&page=0"> <i class="icon-chevron-left"></i> </a> </li> <li class=""> <a class="active" href="/search?query=Samsung&type=all&category=all&page=1"> 1 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=2"> 2 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=3"> 3 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=4"> 4 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=5"> 5 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=6"> 6 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=7"> 7 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=8"> 8 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=9"> 9 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=10"> 10 </a> </li> <li class=""> <a class="" href="/search?query=Samsung&type=all&category=all&page=2"> <i class="icon-chevron-right"></i> </a> </li> </ul> </div> <hr class="search-hr" /> <!-- Information --> <div class="contents-footer"> <h3 class="text-group-sub-title type02">Didn’t find what you were looking for?</h3> <div class="support-card-group"> <a href="/dev-support#FAQ" class="card-item hover"> <div class="card-item-icon"> <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M69 66H85V78.5741C85 79.8419 83.4681 80.4768 82.5722 79.5803L69 66Z" fill="#2088FD"/> <rect x="31" y="34" width="54" height="38" rx="3.99993" fill="#2088FD"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M65.0001 20C67.2092 20 69 21.7908 69 23.9999V58H25.0036L17.4278 65.5803C16.5319 66.4768 15 65.8419 15 64.5741V54.0001V52V23.9999C15 21.7908 16.7908 20 18.9999 20H65.0001Z" fill="#23C778"/> <path d="M31 37.9999C31 35.7908 32.7908 34 34.9999 34H78V59.0001C78 61.2092 76.2092 63 74.0001 63H31V37.9999Z" fill="#2088FD"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M75 49H41V45H75V49Z" fill="white"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M61 59H41V55H61V59Z" fill="white"/> </svg> </div> <h2 class="card-item-title" id="FAQ">FAQ</h2> <p class="card-item-text"> Search frequently asked<br /> questions<br /> by keywords. </p> </a> <a href="https://forum.developer.samsung.com" class="card-item hover"> <div class="card-item-icon"> <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M27.1406 51.9999C31.5589 51.9999 35.1406 48.4182 35.1406 43.9999C35.1406 39.5816 31.5589 35.9999 27.1406 35.9999C22.7223 35.9999 19.1406 39.5816 19.1406 43.9999C19.1406 48.4182 22.7223 51.9999 27.1406 51.9999Z" fill="#23C778"/> <path d="M27.5 54.9999C19.1875 54.9999 12.2229 60.8869 10.3736 68.8039C10.1029 69.9624 11.0383 70.9999 12.2281 70.9999H42.7719C43.9617 70.9999 44.897 69.9624 44.6264 68.8039C42.777 60.8869 35.8123 54.9999 27.5 54.9999Z" fill="#23C778"/> <path d="M72.8594 52C68.4411 52 64.8594 48.4183 64.8594 44C64.8594 39.5817 68.4411 36 72.8594 36C77.2777 36 80.8594 39.5817 80.8594 44C80.8594 48.4183 77.2777 52 72.8594 52Z" fill="#0F42CF"/> <path d="M72.5 55C64.1875 55 57.2229 60.887 55.3736 68.804C55.1029 69.9626 56.0383 71 57.2281 71H87.7719C88.9617 71 89.897 69.9625 89.6264 68.804C87.777 60.887 80.8123 55 72.5 55Z" fill="#0F42CF"/> <path d="M50 50.9999C39.3597 50.9999 30.4761 58.6292 28.349 68.7983C28.1053 69.9632 29.0392 70.9999 30.2294 70.9999H69.7706C70.9608 70.9999 71.8947 69.9632 71.651 68.7982C69.5238 58.6292 60.6402 50.9999 50 50.9999Z" fill="#2088FD"/> <path d="M50 46.9999C55.5228 46.9999 60 42.5227 60 36.9999C60 31.477 55.5228 26.9999 50 26.9999C44.4772 26.9999 40 31.477 40 36.9999C40 42.5227 44.4772 46.9999 50 46.9999Z" fill="#2088FD"/> </svg> </div> <h2 class="card-item-title" id="Forums">Join the Forum</h2> <p class="card-item-text"> Visit the Forum to ask<br /> questions and exchange<br /> ideas with other developers. </p> </a> <a href="/dashboard/support" class="card-item hover"> <div class="card-item-icon"> <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M32 72.0004C44.1503 72.0004 54 62.1506 54 50.0002C54 37.8498 44.1503 28 32 28C19.8497 28 10 37.8498 10 50.0002C10 62.1506 19.8497 72.0004 32 72.0004ZM29.148 54.9467V55.3097H33.141V54.9467C33.141 51.9721 34.6143 50.7864 36.1015 49.5896C37.617 48.3699 39.147 47.1387 39.147 43.9907C39.147 39.8657 36.012 37.0938 31.524 37.0938C27.267 37.0938 24.792 39.2388 24 42.4067L28.158 43.8257C28.554 42.2087 29.709 40.9877 31.458 40.9877C33.405 40.9877 34.626 42.2417 34.626 43.9247C34.626 45.5591 33.6929 46.3559 32.597 47.2918C31.0374 48.6237 29.148 50.2372 29.148 54.9467ZM31.128 57.5308C29.445 57.5308 28.422 58.6197 28.422 60.2367C28.422 61.8208 29.412 62.9098 31.095 62.9098C32.778 62.9098 33.801 61.8208 33.801 60.2367C33.801 58.6197 32.811 57.5308 31.128 57.5308Z" fill="#2088FD"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M68 72.0004C80.1503 72.0004 90 62.1506 90 50.0002C90 37.8498 80.1503 28 68 28C55.8497 28 46 37.8498 46 50.0002C46 62.1506 55.8497 72.0004 68 72.0004ZM66.8305 54.8138H69.2395C69.8665 50.8538 70.2295 45.5408 70.2295 41.1188V37.2578H65.8075V41.1188C65.8075 45.5408 66.2035 50.8538 66.8305 54.8138ZM68.0185 57.3648C66.3355 57.3648 65.3125 58.4538 65.3125 60.0708C65.3125 61.6548 66.3025 62.7438 67.9855 62.7438C69.6685 62.7438 70.6915 61.6548 70.6915 60.0708C70.6915 58.4538 69.7015 57.3648 68.0185 57.3648Z" fill="#0F42CF"/> </svg> </div> <h2 class="card-item-title" id="1:1-Support">Get Support</h2> <p class="card-item-text"> Submit a 1:1 Support request<br /> and receive a response<br /> within 2 business days. </p> </a> </div> </div> </section> </div> </div> </div> </section> <footer class="sdp-footer" translate="no" data-component="true"> <div class="sdp-ft-wrap web-d-none"> <a class="navbar-brand" href="/">Samsung Developer</a> </div> <div class="inner-wrap"> <div class="sdp-sitemap"> <div class="sdp-ft-wrap doc-d-none"> <a class="navbar-brand" href="/">Samsung Developer</a> </div> <div class="sdp-ft-wrap"> <div class="ft-header"> <span>Quick Link</span> <button class="toggle-submenu"></button> </div> <div class="ft-depth2-wrap"> <div class="ft-depth2-inner"> <ul class="nav ft-menu-list"> <li class="menu-item"> <a class="item-link" href="/android-usb-driver"><span>Android USB Driver</span></a> </li> <li class="menu-item"> <a class="item-link" href="/codelab"><span>Code Lab</span></a> </li> <li class="menu-item"> <a class="item-link" href="/galaxy-emulator-skin"><span>Galaxy Emulator Skin</span></a> </li> <li class="menu-item"> <a class="item-link" href="/foldables-and-largescreens"><span>Foldables and Large Screens</span></a> </li> </ul> <ul class="nav ft-menu-list"> <li class="menu-item"> <a class="item-link" href="/remote-test-lab"><span>Remote Test Lab</span></a> </li> <li class="menu-item"> <a class="item-link" href="/dev-support"><span>Dev Support</span></a> </li> </ul> </div> </div> </div> <div class="sdp-ft-wrap"> <div class="ft-header"> <span>Family Site</span> <button class="toggle-submenu"></button> </div> <div class="ft-depth2-wrap"> <div class="ft-depth2-inner"> <ul class="nav ft-menu-list"> <li class="menu-item"> <a class="item-link" target="_blank" href="https://bixbydevelopers.com"><span>Bixby</span></a> </li> <li class="menu-item"> <a class="item-link" target="_blank" href="https://developer.samsungknox.com"><span>Knox</span></a> </li> <li class="menu-item"> <a class="item-link" target="_blank" href="https://developer.smartthings.com"><span>SmartThings</span></a> </li> <li class="menu-item"> <a class="item-link" target="_blank" href="https://docs.tizen.org"><span>Tizen</span></a> </li> </ul> <ul class="nav ft-menu-list"> <li class="menu-item"> <a class="item-link" target="_blank" href="https://research.samsung.com"><span>Samsung Research</span></a> </li> <li class="menu-item"> <a class="item-link" target="_blank" href="https://opensource.samsung.com/main"><span>Samsung Open Source</span></a> </li> <li class="menu-item"> <a class="item-link" target="_blank" href="https://www.europe-samsung.com/smsdev/Home/Index"><span>Samsung Dev Spain</span></a> </li> </ul> </div> </div> </div> <div class="sdp-ft-wrap sdp-ft-wrap-w-half"> <div class="ft-header"> <span>Legal</span> <button class="toggle-submenu"></button> </div> <div class="ft-depth2-wrap"> <div class="ft-depth2-inner"> <ul class="nav ft-menu-list"> <li class="menu-item ft-depth3-inner"> <div class="menu-item-button"> <span class="item-link"><span>Terms</span></span> <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"> <path d="M1.71484 3.85547L6.00056 8.14118L10.2863 3.85547" stroke="currentColor" stroke-width="1.02857"></path> </svg> </div> <ul class="footer-dropdown-list"> <li><a href="/terms">Samsung Developer Terms</a></li> <li><a href="/wallet/terms?type=tos">Samsung Wallet Partner Terms</a></li> <li><a href="/pay/terms?type=tos">Samsung Pay Partner Terms</a></li> </ul> </li> <li class="menu-item ft-depth3-inner"> <div class="menu-item-button"> <span class="item-link"><span>Privacy</span></span> <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"> <path d="M1.71484 3.85547L6.00056 8.14118L10.2863 3.85547" stroke="currentColor" stroke-width="1.02857"></path> </svg> </div> <ul class="footer-dropdown-list"> <li><a href="/privacy">Samsung Developer Privacy Policy</a></li> <li><a href="/wallet/terms?type=privacy">Samsung Wallet Partner Privacy Policy</a></li> <li><a href="/pay/terms?type=privacy">Samsung Pay Partner Privacy Policy</a></li> </ul> </li> <li class="menu-item ft-depth3-inner"> <div class="menu-item-button"> <a class="item-link" href="/open-source"><span>Open Source License</span></a> </div> </li> <li class="menu-item ft-depth3-inner"> <div class="menu-item-button"> <span class="item-link"><span>Cookie</span></span> <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"> <path d="M1.71484 3.85547L6.00056 8.14118L10.2863 3.85547" stroke="currentColor" stroke-width="1.02857"></path> </svg> </div> <ul class="footer-dropdown-list"> <li><a href="/cookie-policy">Samsung Developer Cookie Policy</a></li> <li><a href="/wallet/terms?type=cookie">Samsung Wallet Partner Cookie Policy</a></li> <li><a href="/pay/terms?type=cookie">Samsung Pay Partner Cookie Policy</a></li> </ul> </li> </ul> </div> </div> </div> <!-- Social link ment for mobile --> <div class="sdp-ft-wrap li-mobile"> <div class="ft-header"> <span>Social Communications</span> <button class="toggle-submenu"></button> </div> <div class="ft-depth2-wrap"> <div class="ft-depth2-inner"> <ul class="nav ft-menu-list ft-sns-list"> <li class="menu-item"> <a class="item-link" href="https://www.facebook.com/samsungdev"><span>Facebook</span></a> </li> <li class="menu-item"> <a class="item-link" href="https://instagram.com/samsung_dev"><span>Instagram</span></a> </li> <li class="menu-item"> <a class="item-link" href="https://twitter.com/samsung_dev"><span>Twitter</span></a> </li> <li class="menu-item"> <a class="item-link" href="https://www.youtube.com/samsungdevelopers"><span>YouTube</span></a> </li> <li class="menu-item"> <a class="item-link" href="/feed"><span>Rss</span></a> </li> <li class="menu-item"> <a class="item-link" href="https://www.linkedin.com/company/samsungdevelopers"><span>Linkedin</span></a> </li> </ul> </div> </div> </div> <div class="sdp-ft-wrap sdp-ft-wrap-w-half"> <div class="ft-header"> <span></span> <button class="toggle-submenu"></button> </div> <div class="ft-depth2-wrap"> <div class="ft-depth2-inner"> <ul class="nav ft-menu-list system-list"> <li class="menu-item"> <a class="item-link" href="/system-status"><span>System Status</span></a> </li> <li class="menu-item"> <a class="item-link" href="/sitemap"><span>Site Map</span></a> </li> </ul> </div> </div> </div> </div> <div class="content"> <ul class="nav ft-menu-list system-list"> <li class="menu-item"> <a class="item-link" href="/system-status"><span>System Status</span></a> </li> <li class="menu-item"> <a class="item-link" href="/sitemap"><span>Site Map</span></a> </li> </ul> <ul class="nav ft-sns-list"> <li class="menu-item"><a class="item-link" href="https://www.facebook.com/samsungdev" target="_blank"><i class="s-ico s-ico-facebook"></i><span class="sr-only">facebook</span></a></li> <li class="menu-item"><a class="item-link" href="https://instagram.com/samsung_dev" target="_blank"><i class="s-ico s-ico-instagram"></i><span class="sr-only">instagram</span></a></li> <li class="menu-item"><a class="item-link" href="https://twitter.com/samsung_dev" target="_blank"><i class="s-ico s-ico-twitter"></i><span class="sr-only">twitter</span></a></li> <li class="menu-item"><a class="item-link" href="https://www.youtube.com/samsungdevelopers" target="_blank"><i class="s-ico s-ico-youtube"></i><span class="sr-only">youtube</span></a></li> <li class="menu-item"><a class="item-link" href="/feed" target="_blank"><i class="s-ico s-ico-rss"></i><span class="sr-only">rss</span></a></li> <li class="menu-item"><a class="item-link" href="https://www.linkedin.com/company/samsungdevelopers" target="_blank"><i class="s-ico s-ico-linkedin"></i><span class="sr-only">linkedin</span></a> </li> </ul> <p class="copyright">Copyright © 2024 SAMSUNG. All rights reserved.</p> </div> </div> </footer> </div> <div id="el-sdp-popup-cookies-wrapper" attr-page-id="cookie-policy-popup"> <!-- Cookie Management Tool Popup --> <article id="el-sdp-popup-cookie" class="base-modal cookie-manager-modal page-modal" data-target="cookieManagerModal"> <section id="modal-main-menu" class="base-modal-dialog"> <div class="base-modal-frame"> <i class="base-modal-close close-button" role="button" data-close="cookieManagerModal"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"> <path d="M1 1L15 15" stroke="black" stroke-width="1.6"/> <path d="M15 1L1 15" stroke="black" stroke-width="1.6"/> </svg> </i> <div class="base-modal-body"> <div class="base-text-group"> <h1 class="text-group-title"> Manage Your Cookies </h1> <p class="text-group-text"> We use cookies to improve your experience on our website and to show you relevant advertising. Manage you settings for our cookies below.</p> </div> <div class="base-section"> <div class="base-section-body"> <div class="base-section-panel"> <h2 class="base-section-title">Essential Cookies</h2> <p class="base-section-text"> These cookies are essential as they enable you to move around the website. This category cannot be disabled.</p> <div class="cookie-manager-cta"> <button type="button" class="cookie-manager-text-button" data-target="cookieButton"> <span>View Cookies</span> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"> <path d="M2 4.5L7 9.5L12 4.5" stroke="#363636" stroke-width="1.2"/> </svg> </button> </div> <div class="cookie-manager-table" data-target="cookieTable"> <dl> <dt>Company</dt> <dt>Domain</dt> <dd>Samsung Electronics</dd> <dd>.samsungdeveloperconference.com</dd> </dl> </div> </div> </div> </div> <div class="base-section"> <div class="base-section-body"> <div class="base-section-panel"> <h2 class="base-section-title">Analytical/Performance Cookies</h2> <p class="base-section-text"> 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.</p> <div class="cookie-manager-cta"> <button type="button" class="cookie-manager-text-button" data-target="cookieButton"> <span>View Cookies</span> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"> <path d="M2 4.5L7 9.5L12 4.5" stroke="#363636" stroke-width="1.2"/> </svg> </button> <div class="base-sort" id="performance-select" value="performance"> <label> <input type="radio" name="sort1" hidden checked /> <span class="base-sort-label">NO</span> </label> <label> <input type="radio" name="sort1" hidden /> <span class="base-sort-label">YES</span> </label> </div> </div> <div class="cookie-manager-table" data-target="cookieTable"> <dl> <dt>Company</dt> <dt>Domain</dt> <dd>LinkedIn</dd> <dd>.linkedin.com</dd> <dd>Meta (formerly Facebook)</dd> <dd>.samsungdeveloperconference.com</dd> <dd>Google Inc.</dd> <dd>.samsungdeveloperconference.com</dd> </dl> </div> </div> </div> </div> <div class="base-section"> <div class="base-section-body"> <div class="base-section-panel"> <h2 class="base-section-title">Functionality Cookies</h2> <p class="base-section-text"> 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.</p> <div class="cookie-manager-cta"> <button type="button" class="cookie-manager-text-button" data-target="cookieButton"> <span>View Cookies</span> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"> <path d="M2 4.5L7 9.5L12 4.5" stroke="#363636" stroke-width="1.2"/> </svg> </button> <div class="base-sort" id="functionality-select" value="functionality"> <label> <input type="radio" name="sort2" hidden checked /> <span class="base-sort-label">NO</span> </label> <label> <input type="radio" name="sort2" hidden /> <span class="base-sort-label">YES</span> </label> </div> </div> <div class="cookie-manager-table" data-target="cookieTable"> <dl> <dt>Company</dt> <dt>Domain</dt> <dd>LinkedIn</dd> <dd>.ads.linkedin.com, .linkedin.com</dd> </dl> </div> </div> </div> </div> <div class="base-section"> <div class="base-section-body"> <div class="base-section-panel"> <h2 class="base-section-title">Advertising Cookies</h2> <p class="base-section-text"> These cookies gather information about your browser habits. They remember that you've visited our website and share this information with other organizations such as advertisers.</p> <div class="cookie-manager-cta"> <button type="button" class="cookie-manager-text-button" data-target="cookieButton"> <span>View Cookies</span> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"> <path d="M2 4.5L7 9.5L12 4.5" stroke="#363636" stroke-width="1.2"/> </svg> </button> <div class="base-sort" id="advert-select" value="advert"> <label> <input type="radio" name="sort3" hidden checked /> <span class="base-sort-label">NO</span> </label> <label> <input type="radio" name="sort3" hidden /> <span class="base-sort-label">YES</span> </label> </div> </div> <div class="cookie-manager-table" data-target="cookieTable"> <dl> <dt>Company</dt> <dt>Domain</dt> <dd>LinkedIn</dd> <dd>.linkedin.com</dd> <dd>Meta (formerly Facebook)</dd> <dd>.samsungdeveloperconference.com</dd> <dd>Google Inc.</dd> <dd>.samsungdeveloperconference.com</dd> </dl> </div> </div> </div> </div> </div> <footer class="base-modal-footer"> <button type="button" class="base-button submit-button"> <span>Save Preference</span> </button> </footer> </div> </section> </article> <!-- Preferences Submitted Popup --> <article id="el-sdp-popup-submitted" class="base-modal alert" data-target="cookie-submit-popup"> <section class="base-modal-dialog"> <div class="base-modal-frame"> <i class="base-modal-close" role="button" data-close="cookie-submit-popup"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"> <path d="M1 1L15 15" stroke="black" stroke-width="1.6"/> <path d="M15 1L1 15" stroke="black" stroke-width="1.6"/> </svg> </i> <div class="base-modal-body"> <div class="base-text-group"> <h1 class="text-group-title"> Preferences Submitted </h1> <p class="text-group-text"> You have successfully updated your cookie preferences. </p> </div> </div> <footer class="base-modal-footer"> <button type="button" class="base-button" data-close="cookie-submit-popup"> <span>Close</span> </button> </footer> </div> </section> </article> </div> </div> <script type="text/javascript" src="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/js/sdp.common.min.js"></script> <script type="text/javascript" src="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/js/sdp.ui.min.js"></script> <script type="text/javascript" src="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/js/sdp.utils.min.js"></script> <script type="text/javascript" src="https://d3unf4s5rp9dfh.cloudfront.net/public/d5df079/js/sdp.helpers.min.js"></script> <!-- START CUSTOM SCRIPTS --> <!-- END CUSTOM SCRIPTS --> <!-- Start Admin Preview / Review Part --> <!-- End Admin Preview / Review Part --> </body> </html>