Quantcast
Jump to content


Recommended Posts

Posted

Health monitoring is a very popular feature in smart watches, and Tizen provides various APIs for this purpose. One API is HumanActivityMonitor, which allows users to monitor health by providing metrics such as heart rate, step count, and stress level.

This blog describes how to measure heart rate using this API. A sample web app combined with a widget is attached. This sample app measures heart rate and stores data by timestamp, and the widget shows the last measured heart rate. This blog focuses on how to measure heart rate using the device sensor, stored data, and communication between an app and a widget.

Create and run a Tizen project

1. Create a project in Tizen Studio. Because our target is an app that is combined with a widget, select the Widget template to create this project.

1.png

2. Add the Tizen Advanced UI (TAU) framework library to your project. You can create and manage various UI functionalities using the TAU library as an alternative to designing a UI with HTML and CSS components.

3. Link the tau.circle.min.css and tau.min.js in the app’s index.html file.

<link rel="stylesheet"
href="lib/tau/wearable/theme/default/tau.min.css"> 
<link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)"
href="lib/tau/wearable/theme/default/tau.circle.min.css">
<script src="lib/tau/wearable/js/tau.min.js"> </script>

Measure heart rate and manage data

To measure heart rate using the HumanActivityMonitor API, add the following feature and privilege to the config.xml file:

<feature name="http://tizen.org/feature/humanactivitymonitor"/>
<tizen:privilege name="http://tizen.org/privilege/healthinfo"/>

Applications must request a user’s permission for privacy-related features. The tizen.ppm.requestPermission() method invokes the permission pop-up. When users give permission through the pop-up, they can then use the app features related to that privilege.

To measure heart rate, users must give permission to access the sensor using the following code snippet:

function onSuccess() {

    function onchangedCB(hrmInfo) {
        console.log(‘heart rate:’ + hrmInfo.heartRate);
        tizen.humanactivitymonitor.stop('HRM');
    }
    tizen.humanactivitymonitor.start('HRM', onchangedCB);
}

function onError(e) {
    console.log("error " + JSON.stringify(e));
}
tizen.ppm.requestPermission("http://tizen.org/privilege/healthinfo",onSuccess, onError);

Note that the HumanActivityMonitor API provides heart rate data directly in BPM (beats per minute). If you need the raw data of the sensor, you can use SensorHRMRawData.

The following screenshots show how to measure heart rate using the sample app:

2.png

The Web Storage API stores data in key-value format. This API offers two types of storage – Local and Session. In the sample, we use local storage, along with Date as key and heartRate as value. The Date key retrieves data according to date, week, and month. If you do not want to retrieve history according to date, you can use a different key, such as an integer value; just make sure there is no repetition in key value.

Create a Date object to get the current time stamp. localStorage.setItem() puts the key (Date)-value (heartRate) pair in local storage.

var date_key = new Date();
localStorage.setItem(date_key, hrmInfo.heartRate);

To retrieve data, filter according to the key. Date and month are retrieved from the Date object and filter data using localStorage.getItem(localStorage.key(i)).

var date = new Date();
var lastdate = new Date(localStorage.key(i));
if (lastdate.getDate() == date.getDate() 
&& lastdate.getMonth() == date.getMonth()) {
              console.log(localStorage.key(i)+ " :" + localStorage.getItem(localStorage.key(i)));

The following screenshots show how the history is categorized by day, week, and month:

31.png

Communication between the app and a widget

The sample widget shows the last measured heart rate value, and heart rate history is stored in the local storage of the web app. To establish communication between the app and widget, we’ll use the Preference API. The Preference API stores key-pair values, allowing web widgets to communicate with their parent apps.
In the app, data is stored with ‘KEY’:

tizen.preference.setValue('KEY', hrmInfo.heartRate);

In the widget, data is retrieved using the same ‘KEY’:

if (tizen.preference.exists('KEY')) {
    console.log(‘Last Measured: ‘ + tizen.preference.getValue('KEY'));
} 

The following screenshot of the sample widget shows the last measured heart rate:

4.png

Launch the app from a widget

To launch an app from widget, add the following privilege to config.xml:

<tizen:privilege 
name="http://tizen.org/privilege/application.launch"/>

To launch an app, provide your app ID in tizen.application.launch().

tizen.application.launch(YourAppID);

In the sample widget, the user taps Measure to launch the heart-rate measuring page or History to launch the heart-rate history page, and Preference can be used to determine which one is clicked. To implement, a different key-value pair is set for each page in the widget, and in the web app, key values are checked to detect which page is clicked.

5.png

For example, in the widget, the open_measure key is set to 1 to link to the Measure Page. The app then launches.

tizen.preference.setValue(‘open_measure’, 1);
tizen.application.launch(YourAppID);

The app checks for the open_measure key. If the key exists, the user is redirected to the Measure Page with tau.changePage().

window.onload = function() {
    if (tizen.preference.exists(' open_measure ')) {
        tau.changePage(YourPageID);
    }
}

You can also use the HumanActivityMonitor API to implement a step counter, stress level reading, GPS, and other features in your wearable device. Because enabling other features is similar to implementing the heart rate monitor, you can use this blog as a guide and the attached sampleHeartRateMonitor to enable a full range of health monitoring metrics to your Galaxy Watch.

View the full blog at its source



  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Similar Topics

    • By Samsung Newsroom
      Samsung Research Poland (SRPOL) is thrilled to announce a transformative collaboration with the Polish National Institute of Cardiology (IKARD). This partnership focuses on enhancing cardiac health research through the use of Samsung Health Research Stack. By integrating advanced technology with medical expertise, this initiative aims to revolutionize the continuous monitoring of patients' health and vital signs, ultimately contributing to more effective prevention strategies.
      A key aspect of this collaboration is the tailored adaptation of Samsung Health Research Stack by SRPOL. By providing necessary adjustments to meet specific business criteria, the solution now offers enhanced capabilities for examining critical health metrics such as heart rate and bioelectrical impedance analysis (BIA). This integration allows researchers to continuously monitor patient data, enabling proactive and personalized healthcare interventions. The focus on continuous monitoring ensures that potential health issues can be addressed promptly, reducing the risk of complications and improving overall patient well-being.
      This partnership highlights the shared commitment of Samsung Research Poland and IKARD to advancing medical research and technology. By leveraging the customized implementation of Samsung Health Research Stack, this collaboration is poised to make significant contributions to the field of cardiac care. Watch our exclusive video to learn more about this groundbreaking initiative and witness the fusion of technology and healthcare innovation in action.
      Join us as we explore the future of cardiac research and care, where continuous monitoring and prevention are at the forefront of improving patient outcomes.
      View the full blog at its source
    • By Samsung Newsroom
      Samsung introduced an innovative Electrodermal Activity (EDA) sensor in the Galaxy Watch8, offering detailed insights into stress and sleep patterns. This technology enables users to better understand their well-being by analyzing physiological responses.
      The EDA sensor provides precise monitoring of electrodermal activity, which is crucial for assessing stress and sleep quality. With Samsung Health Sensor SDK, developers can create innovative solutions that leverage Galaxy Watch8 raw data, supporting users in health monitoring and sleep improvement.
      EDA measurement is available with the Galaxy Watch8 series.
      At the World Sleep Congress 2025 in Singapore, the potential of EDA technology was demonstrated, showcasing its role in advancing digital health.
      Explore our code lab for hands-on guidance on implementing EDA data in your applications. To find more information, see Measure Electrodermal Activity on Galaxy Watch.
      View the full blog at its source
    • By Samsung Newsroom
      May 2025 New Application Promotion Feature to Highlight Your Application in Galaxy Store
      Introducing a new opportunity to increase your application’s visibility on the Galaxy Store! The Seller Portal has launched a new application promotion feature to highlight your application on the Galaxy Store. Developers can now request that their game, application, or theme is showcased in an editorial created for the Galaxy Store’s "Discover" tab. Available to users in the US and South Korea, the "Discover" tab is where discovery meets inspiration, highlighting the best content and original stories on mobile and tablet. The tab’s editorials provide users with curated recommendations on the latest trends, benefits and features exclusive to Galaxy, seasonal events, editors’ tips, and more, combining storytelling and visuals to enrich the user experience and showcase innovation. Check out our Seller Portal to learn more about having your application appear in an editorial and what you need to apply.

      Learn More Integrate Your Devices Easily with Device Profile Builder
      SmartThings continues to invest in the Developer Center by creating new tools for partners and has recently added the Device Profile Builder, a web-based tool that helps developers create a profile to define a device and its features on the SmartThings platform. The tool makes designing your device for SmartThings easier than ever. There are templates for different smart home device types, making it easy to get started, along with opportunities for customization.

      To learn more about the Device Profile Builder, see our blog article on the new tool. Meet the Samsung Galaxy S25 Edge: an Engineering Marvel of New Slim Hardware Innovation
      On May 13, Samsung unveiled their latest ultra-slim smartphone at the "Galaxy S25 Edge: Beyond Slim" event. At just 5.8 mm thin and weighing only 163 g, the Galaxy S25 Edge is the slimmest device in the Galaxy S series to date, combining sleek style with portability. The device features a titanium frame as well as Corning® Gorilla® Glass Ceramic 2 on the front display, a next-generation material designed to boost durability. Equipped with a 200-megapixel camera and enhanced AI capabilities, the Galaxy S25 Edge delivers an even more intelligent and powerful experience. Learn more about the Galaxy S25 Edge and its spectacular performance at the Samsung Electronics Newsroom.

      Learn More Tutorial: Reading and Converting Galaxy Watch Accelerometer Data
      Accessing accelerometer data from your Galaxy Watch opens up endless opportunities to build motion-aware applications—from fitness tools to gesture-controlled interfaces. With the proper setup and data handling, an application running on Galaxy Watch powered by Wear OS can deliver accurate, real-time motion insights to users. This tutorial walks you through everything you need to know, from setting up your Wear OS project to reading and converting sensor data. Explore the sample application included with the guide to test motion features yourself!

      Learn More Exploring a Simple Siamese Network for High-Resolution Video Quality Assessment
      Video Quality Assessment (VQA) is becoming increasingly important as popular smart devices make producing high-quality video and high-resolution user-generated content (UGC) part of everyday life. However, the computational burden for high-resolution video and the diversity of content present new challenges for efficient and effective VQA.

      To address these challenges, Samsung R&D Institute China-Nanjing presents SiamVQA, a Siamese network that considers both technical and aesthetic quality perspectives. Sharing a common feature extractor (Swin-T), SiamVQA employs a simple network design based on dual cross-attention to enhance the semantic perception ability for more accurate quality prediction. As a result, SiamVQA has achieved state-of-the-art accuracy on high-resolution benchmarks, proving to be both efficient and effective. Learn more about the next-generation VQA model that opens up the possibilities for Siamese networks on the Samsung Research blog.

      Learn More On-Device Hand Model for Robust Gesture Detection
      Hand gesture recognition technology enables more natural and intuitive ways to communicate. Unlike traditional input methods like keyboards or touchscreens, users can express intentions and commands through everyday movements and postures. Gesture-based interaction is also inclusive, offering greater accessibility for people with physical disabilities who may have difficulty using conventional input methods. Thanks to these advantages, hand gesture recognition is becoming an increasingly important area of research in different fields such as human-computer interaction systems, sign language translation, VR/AR, and remote-control applications. 

      In this blog article, we introduce an on-device AI model that delivers fast and accurate performance across a range of environments. Explore this key solution from Samsung R&D Institute Ukraine, from a neural network architecture to resolve multimodal tasks to a novel multi-cascade structure for handling simultaneous tasks at once.

      Learn More Single-Channel Distance-Based Source Separation for Mobile GPU in Outdoor and Indoor Environments
      Distance-based source separation (DSS) separates audio sources into "near" or "far" groups based on their distance from a microphone. Unlike traditional source separation approaches, DSS uses spatial cues—such as the inverse square law of sound intensity, direct-to-reverberation ratio (DRR), and other distance-based acoustic effects—to separate a mixed audio signal into components by distance. However, most previous DSS research has focused on indoor scenarios. This makes it difficult to address the challenges of ambient noise and unclear reverberant boundaries in outdoor environments, and of real-time processing speed and accuracy on mobile devices.

      To tackle this difficulty, AI Solution Team at Samsung Research proposes a new single-channel DSS model for on-device mobile environments. This model performs robustly in both indoor and outdoor scenarios. Key innovations of the model include a two-stage Conformer architecture for capturing complex audio dependencies, a linear relation-aware self-attention (RSA) mechanism for efficiency, and mobile GPU acceleration optimization using the TensorFlow Lite (TFLite) GPU delegate, which enables real-time running on mobile devices. Learn about how this new model achieves accurate and effective far/near voice and sound separation even in noisy outdoor environments and its on-device performance on the Samsung Research blog.

      Learn More View the full blog at its source
    • By Samsung Newsroom
      April 2025 New & Updated Features of Samsung Health Accessory SDK
      Introducing the newly updated Samsung Health Accessory SDK. 
      The innovative bridge for integrating Samsung Health with partner device data, the Accessory SDK has been enhanced with new features such as Cycling Power Sensor, Cycling Speed & Cadence Sensor, and Thermometer. Existing features have also been improved.
      The SDK consolidates scattered user health data from various devices into Samsung Health, enabling more precise, data-driven health management and ultimately delivering greater value to our users. Enrich user health journey with the new and improved Accessory SDK.

      Learn More Samsung IAP Unity Plugin v6.3.0
      Samsung In-App Purchase (IAP) supports not only the Android SDK, but also the Unity Plugin for applications built with Unity.
      On March 19, the Unity Plugin with the latest version of Samsung IAP 6.3.0 was released, and the programming guide was also partially updated for developer convenience.
      This update has added new APIs for checking subscription promotion eligibility and changing subscription plans. It is also possible to check price changes for active subscriptions, enabling more flexible and precise subscription management. Learn more on the Samsung Developer Portal.

      Learn More Your First Step Towards Becoming a Samsung Wallet Partner
      Are you considering a partnership with Samsung Wallet? Check out the onboarding video and blog content created by the Samsung Wallet team that provide clear and easy guidance for the partner onboarding process. The Samsung Wallet team is always committed to communicating with and growing alongside more partners. Get familiar with the onboarding process on the blog today and register as a Samsung Wallet partner!

      Learn More Samsung Electronics Unveils Latest SmartThings Update
      SmartThings strives to make the platform more valuable for our end users, partners, and developers, with our goal to empower users to create exceptional experiences. In Q1 2025, Samsung SmartThings launched key updates to enhance home AI. The highlight of this quarter is the integration of SmartThings with Samsung Health, which is designed to improve users' sleep environments while enabling more personalized automation experiences. The update also expands Calm Onboarding to support a wider range of devices and adds compatibility with the Matter 1.4 standard.

      Learn more about all the updates here. Tutorial: How to Apply LUT Profiles to Samsung Log Videos in Premiere Pro
      Did you know that you can create cinematic videos like a pro with just a Galaxy device, without professional equipment? Samsung Log is a new camera application feature introduced with the Galaxy S25 series. It brings the power of log filming, once exclusive to professional cameras, to your smartphone. Log is a flat, desaturated color profile that preserves more image data, optimizing it for color correction and post-production. Filming in Log profiling is favored by professional videographers for its flexibility in color grading, allowing them to bring out more cinematic and visually appealing videos.

      Check out the tutorial video to learn how you can easily color grade your Samsung Log video clips in Adobe Premiere Pro using LUT profiles created by Samsung. Get professional-looking results with just a few clicks! Configuring Instant Server Notifications for Samsung IAP
      Samsung IAP's Instant Server Notification (ISN) service ensures developers stay informed about user actions. When users trigger events such as completing in-app purchases or modifying subscriptions, the developer receives notifications with the details of the event, enabling them to track and manage user transactions more effectively. It's a seamless way to ensure developers stay up to date.

      Check out our blog post to find out how to configure a server to manage the supported events sent by the Samsung IAP ISN service.

      Learn More Evaluation of Wearable Head BCG for PTT Measurement in Blood Pressure Intervention
      Managing hypertension and cardiovascular risk demands frequent and accurate blood pressure monitoring. Traditional cuff-based methods, however, have limitations in their portability and real-time measuring aspect.

      Samsung Research America has proposed a new system that enables continuous blood pressure tracking using an over-the-ear wireless wearable device. The system uses sensors to capture both ballistocardiography (BCG) and photoplethysmography (PPG) signals, and calculate the pulse transit time (PTT) by combining these two bio-signals. Learn about the potential of a future healthcare solution that lets you track blood pressure with everyday wireless earphones on the Samsung Research blog.

      Learn More CheapNVS: Real-Time On-Device Novel View Synthesis for Mobile Applications
      Novel View Synthesis (NVS) is an innovative technology as it lets you reconstruct a scene from various perspectives. However, as NVS requires a lot of computation, it relies heavily on high-performance GPUs or cloud servers. Accordingly, it has limitations related to the cost, and is difficult to apply in real time on mobile devices.

      In order to tackle these issues, Samsung R&D Institute United Kingdom presents CheapNVS, a lightweight NVS system based on neural networks that you can run even on your smartphone. This model takes in a single input image and a new camera pose, and then leverages hardware-friendly network design to both perform image warping and then inpainting to fill in the occluded areas. With its novel parallelizable NVS formulation, it manages to speed-up execution while avoiding the use of costly structures such as multi-plane images. CheapNVS, implementable without complex 3D modeling or expensive computations, is a next-generation technology that can be used for a variety of mobile applications including video calls and 3D image conversion. It is more lightweight than conventional methods by a factor of 20 or more, running quickly and efficiently even on mobile SoC environments. Learn more about this innovative technology on the Samsung Research blog.

      Learn More View the full blog at its source
    • Government UFO Files
    • By Samsung Newsroom
      ▲ Vincent van Gogh’s “The Starry Night” (detail) (1889) shown on The Frame by Samsung. Photo: Samsung
       
      Twenty-seven well-known artworks from MoMA’s collection, including those by artists Frida Kahlo, Henri Matisse and Georgia O’Keeffe, are available on the Samsung Art Store today, exclusively to The Frame by Samsung, a best-selling Lifestyle TV that doubles as a piece of art. When it’s on, use The Frame to watch your favorite movies and shows in brilliant 4K resolution. When it’s off, explore the Samsung Art Store to transform any space in your home with a vast catalog of artworks that are handpicked and curated from hundreds of institutions, artists and collectors around the world.
       
      MoMA was founded in 1929 by three progressive women who championed modern and contemporary art and wanted to establish a museum that could be a catalyst for experimentation, learning and creativity. In collaboration with MoMA, the Samsung Art Store includes highlights from MoMA’s collection that were selected by Daria Greene, Global Curator of the Samsung Art Store, to honor the institution’s history and vision, and includes Frida Kahlo’s “Fulang Chang and I” (1937), which is the first artwork by the legendary Mexican artist to arrive on the platform.
       
      ▲ Piet Mondrian’s “Trafalgar Square” (1939-43) shown on The Frame by Samsung. Photo: Samsung
       
      “MoMA is a place that fuels creativity, ignites minds and provides inspiration. Through our relationship with Samsung, we are broadening access to MoMA’s collection in a truly innovative way to millions of people,” said Robin Sayetta, Head of Business Development at The Museum of Modern Art. “We were purposeful in building this new digital collection and hope to enrich the lives of art enthusiasts with culture and history at an extraordinary scale.”
       
      ▲ A view of the fifth-floor collection galleries. Shown: Claude Monet. “Water Lilies.” 1914–26. Oil on canvas, three panels. Mrs. Simon Guggenheim Fund. © 2024 The Museum of Modern Art, New York. Photo: Noah Kalina
       
       
      Expanding Access to Art Through Innovation
      Included in the more than two dozen artworks from MoMA are celebrated works such as Vincent van Gogh’s “The Starry Night” (1889), Henri Rousseau’s “The Dream” (1910) and Georgia O’Keeffe’s “Evening Star III” (1917). This selection represents a diverse range of styles and points in time, offering something for every art lover and Samsung Art Store subscriber.
       
      ▲ A view of the fifth-floor collection galleries. Shown: Vincent van Gogh. “The Starry Night.” 1889. Oil on canvas. Acquired through the Lillie P. Bliss Bequest. © 2024 The Museum of Modern Art, New York. Photo: Noah Kalina
       
      “At Samsung, we strive to redefine the home entertainment experience through continual innovation. Our collaboration with MoMA allows us to bring culturally significant works into millions of homes, allowing people to engage with renowned art in a truly remarkable way,” said Sang Yoon Kim, EVP and General Manager of the North America Service Business at Samsung Electronics. “This endeavor exemplifies Samsung’s mission to use technology to deliver exceptional experiences into the everyday lives of consumers.”
       
      “For nearly 100 years, MoMA has been instrumental in expanding the reach and impact of Modern and Contemporary art, cementing its position as one of the most dynamic and diverse institutions globally. Through this collaboration, we are able to share works by incredible artists, including 20th century female trailblazers, on the Samsung Art Store,” adds Daria Greene, Global Curator of Samsung Art Store.
       
      ▲ Hannah Höch’s “Untitled (Dada)” (detail) (1922) shown on The Frame by Samsung. Photo: Samsung
       
      The Samsung Art Store is available only on The Frame, which has been refreshed in 2024 to deliver an even more complete artistic and aesthetic experience. That includes ArtfulColor validation from Pantone,1 the industry leading color experts. As the world’s first and only art TV to achieve this validation, The Frame delivers natural and realistic visuals that wouldn’t look out of place in a gallery. It hangs just like a picture flush against the wall and is available in class sizes ranging from 32 to 85 inches. The bezels2 can also be swapped out with various colors and designs, giving you more ways than ever to customize The Frame for your unique style and décor.
       
      The Frame also delivers value-add features that you can only find from Samsung — the #1 global TV brand for 18 years and counting.3 Samsung AI technology makes everything you watch look clearer and crisper, while you enjoy access to 2,700+ free channels, including 400+ Samsung TV Plus4 premium channels. You can also use your TV as your smart home hub and ensure your personal data is protected by Samsung Knox security.
       
      The Frame is available for purchase at MoMA Design Store at store.moma.org, Samsung.com and other select retailers.
       
      The Introduction of Highlights from MoMA’s Collection follows the Samsung Art Store’s relationships with world-class museums including The Metropolitan Museum of Art and Musée d’Orsay, and the release of several collections this year featuring René Magritte, Jean-Michel Basquiat and over 40 Marimekko artworks. Samsung remains committed to being the premier destination for experiencing a wide breadth of high-quality digital art.
       
       
      1 Pantone company provides a universal language of color, called Pantone Matching System, that enables color-critical decisions through every stage of the workflow for brands and manufacturers.
      2 Bezels sold separately.
      3 Source: Omdia, Jan 2024. Results are not an endorsement of Samsung. Any reliance on these results is at the third party’s own risk.
      4 Available for free on Samsung Smart TVs released after 2016, Galaxy devices, Smart Monitors, Family Hub refrigerators and the web.
      View the full article





×
×
  • Create New...