Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop Health
docoverview samsung health stack is an open-source technology stack offering end-to-end solutions for collecting and analyzing data from wearable devices in android and wear os environments with applications ranging from medical research to clinician services and beyond, this tech stack provides the tools and infrastructure necessary to expedite the development and deployment of health-based studies the framework includes samsung health stack app sdk a software development kit for building android and wear os apps capable of collecting data from wearable devices web portal a customizable interface for creating surveys, managing team members, tracking participants, and analyzing data backend services api endpoints to access and interact with a robust data engine the galaxy watch 5 has been extensively tested for compatibility with this tech stack other devices may work but have not been officially tested you can start by installing the components of the tech stack here are the links to the installation guides installing the backend system installing the app sdk installing the web portal samsung health stack app sdk the app sdk simplifies the creation of mobile apps that collect data from participants it provides building blocks for participant onboarding and consent, survey presentation, participant task creation, visual reporting, and data management for further details, please check sdk documentation web portal the web portal is a dashboard for interactive data visualization and study management it offers a platform for managing research team members, creating and deploying app content such as participant surveys, tracking study participant activity, and analyzing participant data please note, as of now, chrome is the only browser supported for accessing the web portal backend services the backend services provide a set of api endpoints for data storage, retrieval, and analysis this allows your application to interact with the data engine, performing operations as needed for more details, visit the rest api documentation how does it all fit all together? contributing as an open-source project, samsung health stack welcomes contributions from the developer community if you'd like to contribute, check out contributing to the open source project samsung health stack strives to make the process of creating and managing health studies more efficient and accessible through its comprehensive suite of tools and services, it serves as a robust foundation for health-based projects
Develop Health
docoverview samsung health research stack is an open-source technology stack offering end-to-end solutions for collecting and analyzing data from wearable devices in android and wear os environments with applications ranging from medical research to clinician services and beyond, this tech stack provides the tools and infrastructure necessary to expedite the development and deployment of health-based studies the framework includes samsung health research stack app sdk a software development kit for building android and wear os apps capable of collecting data from wearable devices web portal a customizable interface for creating surveys, managing team members, tracking participants, and analyzing data backend services api endpoints to access and interact with a robust data engine the galaxy watch 5 has been extensively tested for compatibility with this tech stack other devices may work but have not been officially tested you can start by installing the components of the tech stack here are the links to the installation guides installing the backend system installing the app sdk installing the web portal samsung health stack app sdk the app sdk simplifies the creation of mobile apps that collect data from participants it provides building blocks for participant onboarding and consent, survey presentation, participant task creation, visual reporting, and data management for further details, please check sdk documentation web portal the web portal is a dashboard for interactive data visualization and study management it offers a platform for managing research team members, creating and deploying app content such as participant surveys, tracking study participant activity, and analyzing participant data please note, as of now, chrome is the only browser supported for accessing the web portal backend services the backend services provide a set of api endpoints for data storage, retrieval, and analysis this allows your application to interact with the data engine, performing operations as needed for more details, visit the rest api documentation how does it all fit all together? contributing as an open-source project, samsung health research stack welcomes contributions from the developer community if you'd like to contribute, check out contributing to the open source project samsung health research stack strives to make the process of creating and managing health studies more efficient and accessible through its comprehensive suite of tools and services, it serves as a robust foundation for health-based projects
Develop Health
docmissing google-services json file in the source code for firebase integration the app uses firebase to provide a 3rd party login to users the google-services json file must be included in the source code a reference to integrate it can be found here need guidance on backend installation for the app the app fetches project information such as surveys and activity tasks from the backend for testing, it's recommended to follow the backend installation guide instead of integrating your own backend system detailed instructions can be found here error encountered while trying to build the modules related to healthstack sample the error seems to arise from a missing client for the package name 'healthstack sample' ensure that the correct configurations are available and that the associated files for this client are not missing possibility of using the graphics and ui from the samsung health app in the new build no specific answer provided in the email chain, would need further follow-up how to capture and export accelerometry continuously, not just during the activity task? the app regularly sends over health data logged by health connect at intervals that can be set by the user for sensor data related to each activity task, it's collected & synced when the activity is conducted specific activity tasks and their associated sensor types were provided which data types from health connect can be utilized? the app can utilize all data types supported by health connect by modifying the list of healthdatarequired, you can adjust the app to collect additional data types recorded by health connect however, to have data input, that data needs to exist in health connect resolution to /gradlew clean failing for app-sdk? this appears to be an issue with the system failing to communicate with the gradle plugin repository ensure that your system is online, and if you're using a proxy environment, check proxy settings if a proxy is in use, the issue might be an ssl handshake failure check ssl settings and proxy configurations
Develop Health
docfaq what are the benefits of the samsung health research stack? samsung health research stack provides end-to-end solutions for collecting and analyzing data from wearable devices in android and wear os environments and allows developers to design advanced health and wellness applications developers can also build research study portal which acts as a centralized hub for managing every facet of research studies, from enrollment to compliance how do i get access to the samsung health research stack? you can learn about accessing samsung health research stack here here what devices are compatible with samsung health research stack? the galaxy watch 5 and later has been tested for compatibility with this tech stack is it possible to contribute to samsung health research stack? yes, as an open-source project, samsung health research stack welcomes contributions from the developer community if you'd like to contribute, check out contributing to the open source project here how can i modify the ui on the starter-app? you can customize the ui by modifying the presentation package classes in starter mobile/wearable app specifically, you can edit the files in starter-mobile-app/src/main/kotlin/researchstack/presentation/ for theme or color changes, update the theme/appcolors kt file are the screens and flows for the mobile app available in android studio? yes, the screens and flows for the mobile app are available in android studio, and they are not configured in the container and backend how does data synchronization work in the app? the app uses android workmanager for periodic data sync once the user permits the use of their health data and finishes logging in, workmanager is initialized and periodically syncs health data from healthconnect to the backend, even when the app is not open what is the minimum interval for data sync, and can it be manually triggered? the least interval that can be set for data sync is 15 minutes workmanager cannot be manually triggered; it operates based on the configuration is it expected for data to only be pushed when the app is engaged? no, once workmanager is initialized, it syncs data periodically even when the app is not engaged various sequences of opening and closing the researchsample app and samsung health may trigger data transfer, but workmanager operates independently based on the configuration how do i modify the ui of the web portal? you might need to change ui materials before building the container please, contact our support to get a more precise answer how can i capture more types of health data from samsung health? there are two steps specify the app’s permissions for health connect in the health_permissions xml file, and add healthdatasyncspecs to mainactivity kt the healthconnectadapter currently supports 11 types of health data alternatively, you could utilize samsung health sdks what should i do if the account verification email is not sent when creating a web portal account? ensure that smtp access is activated on the account and that outbound calls on the corresponding smtp port are allowed from your server if using 2-factor authentication 2fa , try signing in with an app password if not, you might need to allow less secure apps to access your account what could cause authentication issues when sending emails from the account service? if you are using 2-factor authentication 2fa , try signing in with an app password if it does not work, you might need to allow less secure apps to access your account where can i find logs or monitor the workmanager for debugging? you can briefly monitor the workmanager in the "app inspection" tab in android studio how can i monitor and troubleshoot workmanager for data synchronization? you can monitor workmanager in the "app inspection" tab in android studio this can help you check if data sync is happening as expected and identify any issues how can i change the configuration for data synchronization? the data synchronization process is handled by workmanager, and the interval for data sync is set in the configuration you can modify this configuration according to your needs, but the minimum interval that can be set is 15 minutes missing google-services json file in the source code if you want to use firebase to provide a 3rd party login to users the google-services json file must be included in the source code a reference to integrate it can be found here need guidance on backend installation for the app the app fetches project information such as surveys and activity tasks from the backend for testing, it's recommended to follow the backend installation guide instead of integrating your own backend system detailed instructions can be found here how to capture and export accelerometry continuously, not just during the activity task? the app regularly sends health data logged by health connect at intervals that can be set by the user for sensor data related to each activity task, it's collected & synced when the activity is conducted specific activity tasks and their associated sensor types are provided what data types from health connect can be utilized? the app can utilize all data types supported by health connect by modifying the list of healthdatarequired, you can adjust the app to collect additional data types recorded by health connect however, to have data input, that data needs to exist in health connect resolution to /gradlew clean failing for app-sdk? this appears to be an issue with the system failing to communicate with the gradle plugin repository ensure that your system is online, and if you're using a proxy environment, check proxy settings if a proxy is in use, the issue might be an ssl handshake failure check ssl settings and proxy configurations
Learn Code Lab
codelabestablish a health research system using samsung health research stack objective learn how to create a health research system that collects data from mobile and wearable devices and visualizes the collected data in a web portal using samsung health research stack overview samsung health research stack is an open-source toolset that helps collect and analyze data from devices in android and wear os environments it provides tools and infrastructure for developing and deploying health studies, ranging from medical research to clinician services and more the framework consists of four components backend services - offers api endpoints to access and interact with a robust data engine web portal - a customizable interface for creating surveys, managing team members, tracking subjects, and analyzing data app sdk - an sdk for building android and wear os apps capable of collecting data from wearable devices starter app - a health research app with mobile and wearable versions created using basic features provided by the app sdk for detailed information, see samsung health research stack set up your environment you will need the following android studio latest version recommended samsung galaxy mobile device with updated health connect app and samsung health app installed samsung galaxy watch synced to the mobile device docker desktop sample code to start your learning experience, download the project files of the samsung health research stack starter mobile and wearable app notedepending on your preferred development style, you can either download or clone the repository of the project files to your local computer feel free to edit and customize this project for your own purposes, including this code lab activity set up your galaxy mobile and watch device connect your galaxy mobile device to your pc and enable adb debugging next, connect your galaxy watch to android studio over wi-fi lastly, enable the developer mode of the health platform app on your watch by following these steps a go to settings b tap on apps c select health platform d quickly tap on health platform several times until [dev mode] appears notethe samsung health developer mode is only intended for testing or debugging your application it is not for application users deploy the backend and web portal locally download the backend-config-files zip file and unzip it the folder contains the docker-compose yaml file open the terminal window of docker desktop in the terminal, go to the directory where your docker-compose yaml file is located, and run the following command $ docker compose up –d the script deploys the backend and the web portal to your local computer, and it includes 6 services redis - redis watcher for the backend casbin service mongo - for saving data from the backend postgres - for supertokens database and the backend casbin database supertokens - for username and password authentication backend - backend for the samsung health research stack portal - web portal for the samsung health research stack you can change the port number, username, and password for each database with the default setting, you can access the web portal in your browser at localhost 80 the script file has simple settings for easy deployment to add more features, you can change the environment in the docker-compose yaml file's services > backend > environment part set the aws environment variables optional you can enable uploading and downloading features by setting the following aws environment variables aws_bucket_name aws_region aws_access_key_id aws_secret_access_key aws_session_token you can follow the instructions in using the default credential provider chain for setting up aws credentials set google openid connect optional to enable google openid connect oidc login, you can set the following environment variables oidc_google_oauth2_url default "https //oauth2 googleapis com" oidc_google_client_id oidc_google_client_secret oidc_google_redirect_uri you can refer to openid connect for more information about setting google oidc create a new study the health research system has two user groups investigators - conduct research studies and use the web portal for managing studies and analyzing data subjects - participate in studies by answering surveys and performing tasks through the mobile app, as well as collecting health data from wearable apps to start your research study, as an investigator, follow the steps below create an account and sign in to the web portal page you deployed fill out the form with your information on the study collection page, click the create study button noteall enrolled investigators can create a study the creator becomes the study admin in the basic info tab, input the details of the study 5 for the study scope, choose public noteyou can set the study scope as either public or private if you choose private, you need to input a participation code that subjects must enter into the mobile app to join however, for the ease of testing in this code lab, it is recommended to set the scope as public for the study requirements field, you can input any text and click next go to participation requirements tab and select the data types to collect in wear category for this code lab, choose wear accelerometer wear ecg wear heart rate the logo and title of the created study show on the study collection page connect the mobile app to backend system to connect the starter mobile app to the backend system, follow these steps noteto ensure that the galaxy mobile device can connect to the machine where the backend system is deployed, it is recommended to connect both the machine and the mobile device to the same network open the downloaded project file in android studio and go to samples > starter-mobile-app in the local properties file, set the server_address to the ip address of the machine where the backend system is deployed server_address ="input ip address here" tipyou can check your ip address using the command line windows in command prompt, type ipconfig and find the ip address under ipv4 address mac in terminal, type ifconfig and look for the ip address under inet next to en0 next, set the server_port to 50001 if you used the default values in the provided docker-compose yaml file for deployment if not, use the port number you set server_port=50001 set authentication method the app sdk supports three types of authentication methods for registration samsung utilizes samsung account cognito incorporates amazon cognito authentication super-tokens enables anonymous login to allow research participants to register and log in using their personal emails, set the sign_in_mode as super-tokens in the local properties file sign_in_mode="super-tokens" upload wearable data via grpc when synchronizing wearable device data, the app sdk offers two approaches utilizing grpc for high-performance remote procedure calls or synchronization through files each approach has advantages and disadvantages regarding factors such as battery life and server workload however, it is advisable to utilize grpc during local development to configure the mobile application to upload wearable data via grpc rather than files, add the following code in the local properties file enable_upload_wearble_data_by_file=false show the sync button in starter wearable app after configuring the mobile app, modify the wearable app to meet the requirements of your study go to samples > starter-wearable-app and open the local properties file the wearable app features a sync button, which can be displayed or hidden when this button is pressed, it synchronizes the collected data with the backend system instantly to show the sync button, set the value of enable_instant_sync_button as below enable_instant_sync_button=true notethis instant sync feature can negatively affect the battery consumption of both apps, so it is recommended to remove the sync button when you publish your app the samsung health research stack has an optimized data synchronization process that minimizes battery consumption set data measurement parameters you can customize the data collection and storage process of the wearable app by setting the values of the following data measurement parameters passive_data_insert_interval_in_seconds sets the data measurement buffer the buffer saves data in an in-memory database before the interval expires then, at regular intervals, the data from the buffer is stored in persistent memory data_split_interval_in_millis specifies the size of segmented data in persistent memory if these values are not specified, the wearable app uses its default values to verify that the data is being measured and synchronized instantly, you can set the values as follows passive_data_insert_interval_in_seconds=12 data_split_interval_in_millis=30000 run the starter mobile and wearable app after configuring the local properties of both starter apps, build and run your app in android studio by following these steps run the starter mobile app select your mobile app starter-mobile-app from the run configurations menu in the toolbar choose a connected galaxy mobile device as the target device for running the app click run to install the app after installation, clear the app's data run the starter mobile app follow the same steps as for the starter mobile app but select starter-wearable-app instead choose a connected galaxy watch device for running the app allow the app to access physical activity, sensor data, and send notifications when prompted ensure that the galaxy watch is connected with the galaxy mobile device register and join a study since you have set super-tokens as the authentication method, you can now register and log into the app at once open the starter mobile app and sign up with an unregistered email address after logging in and accepting permissions, the app displays the study you created from the web portal tap on the study card to view its details and click join study noteif a study is set to private and you wish to join it, press enter the study code located at the top of the screen and input the assigned participation code in the study code field agree to data collection and terms of research you can see that the sensor data to be collected are dependent upon the selection made in the web portal while creating the study sign and click next to complete the study onboarding process measure and collect health data in the starter wearable app, you can see a list of on-demand measurements that you can contribute to health research for this code lab, choose ecg and click measure follow the onscreen measurement instruction after measuring successfully, scroll to the bottom of the wearable app and press the sync button to synchronize the data with the mobile app in the mobile app, go to data tab, click the more button, and click sync to transfer the collected data to the web portal visualize the collected data in web portal you can display the collected data as a graph in any way you choose for further analysis of the study from the overview page of the study in the web portal, navigate to the dashboard page click on the add chart button provide a title for the chart and select the desired chart type then, edit the chart source choose the database where the data is stored for this code lab, enter the following query to display only the first ten heart rate data from wearheartrate table select * from wearheartrate limit 10 click run query and save select value and timestamp for the value and category columns respectively check the preview of the graph finally, click save to display the graph into the dashboard you're done! congratulations! you have successfully achieved the goal of this code lab now, you can create your own health research system by yourself! to learn more, see samsung health research stack
Develop Health
docresearch study portal overview the research study portal is a cutting-edge digital platform meticulously crafted to meet the diverse needs of contemporary researchers it acts as a centralized hub for managing every facet of research studies, from inception to culmination here is a comprehensive overview of its salient features and the associated guidance provided to optimize user experience key features team management the portal allows for the effortless management of team members by enabling the assignment of roles and the provision of role-based access control this ensures that each member has the right level of access and capabilities to perform their tasks efficiently content deployment users can create, preview, group, schedule, and publish surveys with ease the portal offers a variety of configurable question types, skip logic functionalities, and the option to incorporate educational content, providing a versatile tool for data collection participant interaction the platform facilitates smooth onboarding of participants and enables tracking of their consent, survey responses, and both in-lab and online activity this ensures comprehensive monitoring and interaction with the participants for the success of the study data analysis the portal offers a suite of analysis tools, allowing users to view analytics, graphs, charts, and individual results additionally, it supports running data queries and exporting data for external examination, ensuring thorough analysis of the collected information available documentation account settings guidance is available for resetting passwords, ensuring that users can maintain the security of their accounts activity types comprehensive documentation provides an overview of different activity types and guides users through the process of creating an activity, allowing for the customization of the study as per the research needs content creation detailed instructions are available for creating and grouping surveys, previewing, scheduling, publishing, and configuring question types additionally, guidance on employing skip logic survey branching is provided to facilitate complex survey designs educational content users are guided on how to add educational content to their studies, enhancing the learning experience for the participants in-lab visits instructions for adding and editing in-lab visits, as well as an overview of in-lab visits, are available to assist researchers in managing lab-based components of their studies results analysis the portal provides extensive guidance on exporting data for external analysis, running data queries, viewing graphs, charts, and individual results, enabling researchers to derive meaningful insights from their data study execution comprehensive documentation is available on collecting survey and sensor data, onboarding participants, tracking survey responses, and viewing survey analytics, ensuring smooth execution of the study study management detailed guides on creating a study, managing members, and understanding team roles and role-based access control are available to facilitate effective study management in summary, the research study portal is a holistic solution, meticulously designed to simplify and streamline the multifaceted processes integral to research studies whether administering surveys, analyzing results, or managing a team, the portal provides an extensive suite of tools and guidance to support researchers in their endeavors
Develop Mobile Samsung Automation
docopen source samsung automation studio is one way to integrate samsung services with open source or 3rd-part services we are actively using open source and trying to contribute to the open source ecosystem check out the following article samsung electronics migrates iot developer tools to cloud foundry based on node-red samsung automation studio was forked from node-red version 0 17 5 and developed to support the easy development of smartthings automation webhook in early 2016 low-code programming for event-driven applications node-red is a programming tool for wiring together hardware devices, apis and online services in new and interesting ways it provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click flow-based programming invented by j paul morrison in the 1970s, flow-based programming is a way of describing an application’s behavior as a network of black-boxes, or “nodes” as they are called in node-red each node has a well-defined purpose; it is given some data, it does something with that data and then it passes that data on the network is responsible for the flow of data between the nodes it is a model that lends itself very well to a visual representation and makes it more accessible to a wider range of users if someone can break down a problem into discrete steps they can look at a flow and get a sense of what it is doing; without having to understand the individual lines of code within each node more details are available at nodered org contributes samsung automation studio team published custom nodes on the node-red site we are improving it through open source see the following github https //github com/samsung/samsungautomationstudio and we continue to engage the nodered community running on cloud foundry automation studio deploys flows in secured and isolated containers whose healths and lifecycles are managed automatically by the reliable container platform cf cloud platform cloud platforms let anyone deploy network apps or services and make them available to the world in a few minutes when an app becomes popular, the cloud scales it to handle more traffic, replacing build-out and migration efforts that once took months with a few keystrokes cloud platforms enable you to focus exclusively on your apps and data without worrying about underlying infrastructure the following diagram shows the layers of a typical technology stack, and compares the traditional it model to the cloud platform model about the cloud foundry platform this section describes why cloud foundry is an industry-standard cloud platform not all cloud platforms are created equal some have limited language and framework support, lack key app services, or restrict deployment to a single cloud as an industry-standard cloud platform, cloud foundry offers the following open source code the platform’s openness and extensibility prevent its users from being locked into a single framework, set of app services, or cloud deployment automation developers can deploy their apps to cloud foundry using their existing tools and with zero modification to their code flexible infrastructure you can deploy cloud foundry to run your apps on your own computing infrastructure, or deploy on an iaas like vsphere, aws, azure, gcp, or openstack commercial options you can also use a paas deployed by a commercial cloud foundry cloud provider community support a broad community contributes to and supports cloud foundry cloud foundry is ideal for anyone interested in removing the cost and complexity of configuring infrastructure for their apps more details are available at cloudfoundry org get started - samsung automation studio beta
Learn Code Lab
codelabbuild a health app with steps from samsung health and its connected wearables objective create a step counter application for android devices, utilizing the samsung health data sdk to read steps data collected by the samsung health app overview samsung health offers various features to monitor user health data such as their daily step activity with the samsung health data sdk, android applications can easily access collected data, including steps recorded over a specific period or from a certain device you can retrieve steps data collected by samsung health, obtain the total number of steps taken within the day, and the total number of steps per hour, and apply local time filters to refine your queries effectively set up your environment you will need the following android studio latest version recommended java se development kit jdk 17 or later android mobile device compatible with the latest samsung health version sample code here is a sample code for you to start coding in this code lab download it and start your learning experience! health data steps sample code 573 9 kb set up your android device click on the following links to set up your android device enable developer options run apps on a hardware device activate samsung health's developer mode to enable the developer mode in the samsung health app, follow these steps go to settings > about samsung health then, tap the version number quickly 10 times or more if you are successful, the developer mode new button is shown tap developer mode new and choose on now, you can test your app with samsung health notethe samsung health developer mode is only intended for testing or debugging your application it is not for application users start your project in android studio click open to open existing project locate the downloaded android project mysteps from the directory and click ok check gradle settings before using the samsung health data sdk library, certain configurations are necessary these steps are already applied in the sample code provided the samsung-health-data-api-1 0 0b1 aar library is added to the app\libs folder, and included as a dependency in the module-level build gradle file in the same file, the gson library is also added as a dependency dependencies { implementation filetree mapof "dir" to "libs", "include" to listof "* aar" implementation libs gson } next, the kotlin-parcelize plugin is applied plugins { id "kotlin-parcelize" } lastly, the following entries are also added in the gradle > libs version toml file [versions] gson = "2 10 1" parcelize = “1 9 0” [libraries] gson = { module = "com google code gson gson", version ref = "gson" } [plugins] parcelize = { id = “org jetbrains kotlin plugin parcelize”, version ref = ”parcelize” } request steps data permissions noteyou can access data from samsung health by obtaining a healthdatastore object using the healthdataservice getstore appcontext method to read data from samsung health, you need to acquire proper permissions from the app user each health data type has its own permission additionally, separate permissions are required for reading and writing operations the user must grant the following permissions in the app steps for read operation steps_goal for read operation when launching the application, it is important to verify if the necessary permissions have already been granted this can be achieved through the library function healthdatastore getgrantedpermissions permissions set<permission> set<permission> go to app > kotlin+java > com samsung health mysteps domain in the arepermissionsgrantedusecase kt file, navigate to the permissions object and create the permissions needed to read the steps and steps goal data from samsung health /**************************************************************************** * [practice 1] create permission set to receive step data * * make permissions set down below contain two permission * com samsung android sdk health data permission permission objects of types * - 'datatypes steps' of 'accesstype read' * - 'datatypes steps_goal of 'accesstype read' ****************************************************************************/ object permissions { //todo 1 val permissions = emptyset<permission> } if the permissions are not granted, invoke an ask-for-permissions view the special function provided by the library is called from mainactivity, where the context is an activity's context val result = healthdatastore requestpermissions permissions, context after invoking the function, the app user sees the following pop-up upon starting the application if the user does not consent to read their steps data, the application displays a message explaining why this authorization is vital for the app to function properly notepermissions can be granted or revoked at any time by tapping the more button on the toolbar and selecting the connect to samsung health tab once the user grants the necessary permissions, you can proceed with retrieving the step data from the healthdatastore retrieve steps data from samsung health understand how to retrieve step goal a step goal is a target number of steps set by an individual to achieve within a day this can be set in the samsung health app by navigating to steps > settings > set target check the readlaststepgoal function in readstepgoalfromtodayusecase kt to know how to retrieve the most recent step goal from samsung health @throws healthdataexception class private suspend fun readlaststepgoal int { val startdate = localdate now val enddate = localdate now plusdays 1 log i tag, "startdate $startdate; enddate $enddate" val readrequest = datatype stepsgoaltype last requestbuilder setlocaldatefilter localdatefilter of startdate, enddate build val result = healthdatastore aggregatedata readrequest var stepgoal = 0 result datalist foreach { data -> log i tag, "step goal ${data value}" log i tag, "data starttime ${data starttime}" log i tag, "data endtime ${data endtime}" data value? let { stepgoal = it } } return stepgoal } the function readlaststepgoal retrieves the most recent step goal from samsung health first, it filters the data by setting the startdate and enddate to the current date and the next day respectively using a localdatefilter next, the function builds a request using the datatype stepsgoaltype last constant to retrieve the most recent value and specifies the date range using the setlocaldatefilter method the request is then executed by calling the aggregatedata function of the healthdatastore once the data is fetched, the function loops through each entry and extracts the step goal value finally, it returns the step goal value as the result collect today's total number of steps to verify if the user reached their daily step goal, get the number of steps taken from midnight until the current time perform this calculation by creating a generic function that calculates the total number of steps within a specified time frame then, set the start time as the beginning of today and the end time as the current timestamp total is an aggregate operation that obtains the sum of steps to achieve this task, use the following healthdatastore getgrantedpermissions permissions set<permission> set containsall elements collection<@unsafevariance e> aggregaterequest it represents a request for an aggregation query over time it is used to run aggregate operations like total and last for healthdatapoint localtimefilter filter with a localdatetime type time interval as a condition the time interval is represented as local date time companion function of starttime localdatetime?, endtime localdatetime? creates a localtimefilter with starttime and endtime aggregaterequest localtimebuilder<t> provides a convenient and safe way to set the fields and create an aggregaterequest setlocaltimefilter localtimefilter localtimefilter sets the local time filter of the request in readstepsfromatimerangeusecase kt, navigate to the function getaggregaterequestbuilder and filter today's steps /*************************************************************************** * [practice 2] - create a read request builder to obtain steps from given * time range * collecting steps from a period of time is an aggregate operation which * sums up all the steps from that period * in this exercise you need to * - create a localtimefilter with starttime and endtime for the * aggregaterequest * - apply the filter to the aggregaterequest * ------------------------------------------------------------------------- * - hint * use localtimefilter of to create a time filter for the request **************************************************************************/ fun getaggregaterequestbuilder starttime localdatetime, endtime localdatetime aggregaterequest<long> { val aggregaterequest = datatype stepstype total requestbuilder build // todo 2 return aggregaterequest } a list of aggregated data is received as a result of the request in this example, it's a single-item list containing the total number of steps taken from the beginning of the day to the present moment with the given code, you can iterate over the list and check if the value of the analyzed aggregateddata element is not null if so, assign it to the stepcount variable however, if the value is empty, the code returns a value of 0, indicating that no steps were recorded val result = healthdatastore aggregatedata aggregaterequest var stepcount = 0l result datalist foreach { aggregateddata -> aggregateddata value? let { stepcount = it } } obtain the number of steps for each hour after setting up the functions to fetch steps data from samsung health and aggregating the data to calculate the total step count, you need to obtain the total number of steps for each hour and visualize the steps the user took during every hour of the day to achieve this, utilize the aggregate operation sum of steps , but this time incorporate additional filtering grouping by hour aggregaterequest it represents a request for an aggregation query over time it is used to run aggregate operations like total and last on healthdatapoint localtimefilter filter with a localdatetime type time interval as a condition the time interval is represented as local date time companion function of starttime localdatetime?, endtime localdatetime? creates a localtimefilter with starttime and endtime localtimegroup grouped time interval with a pair of localtimegroupunit and multiplier this means that the grouping is applied to intervals as much as multiplier in local date and time companion function of timegroupunit localtimegroupunit, multiplier int creates a localtimegroup with the given timegroupunit and multiplier localtimebuilder<t> provides a convenient and safe way to set the fields and create an aggregaterequest setlocaltimefilterwithgroup localtimefilter localtimefilter?, localtimegroup localtimegroup? sets the local time filter with the local time group of the request in readgroupedstepsbytimerangeusecase kt, navigate to the getaggregaterequestbuilder function obtain the total number of steps from every hour by creating two variables one to specify the time range using localtimefilter of and another to define the grouping using localtimegroup of by combining these variables, you can set an aggregate request that retrieves the desired data /************************************************************************ * [practice 3] - create an aggregate request for steps from given period * of time * for this, datatype steps grouped by hour is needed * in this exercise you need to * - create an aggregate request, with grouping and time filters, * for filters' parameters use the method's arguments * - return the request * ---------------------------------------------------------------------- * - hint * use setlocaltimefilterwithgroup function to apply time and grouping * filters to the request builder ***********************************************************************/ fun getaggregaterequestbuilder startdatetime localdatetime, enddatetime localdatetime, localtimegroupunit localtimegroupunit, multiplier int aggregaterequest<long> { val aggregaterequest = datatype stepstype total requestbuilder build // todo 3 return aggregaterequest } to apply local time filtering with the given group, use the localtimefilter and localtimegroup classes the localtimegroup consists of a localtimegroupunit, which in this case is hourly, and a multiplier you can also group by other time periods such as daily, weekly, monthly, minutely, and yearly since you want data from every hour period, use a multiplier value of 1 the returned data from the request is a list, where each item represents a grouped value healthdatastore only returns values for periods when the step count is greater than zero the code below shows that by iterating over the returned datalist and adding non-null groupeddata to the output steplist, you can obtain the aggregated value of steps for each hour of the day val result = healthdatastore aggregatedata aggregaterequest val steplist arraylist<groupeddata> = arraylist result datalist foreach { aggregateddata -> var stepcount = 0l aggregateddata value? let { stepcount = it } val starttime = aggregateddata starttime atzone zoneid systemdefault val groupeddata = groupeddata stepcount, starttime tolocaldatetime steplist add groupeddata } noteevery usage of samsung health data sdk might throw a healthdataexception such exceptions are thrown from every backend function up the call stack and handled in viewmodel the healthdataexception has four possible subclasses an example is resolvableplatformexception, which means it can be automatically resolved by invoking resolvableplatformexception resolve activitycontext the reason for such an exception is, for instance, when samsung health app is not installed on the device resolving it results in opening samsung health page in the app store run unit tests for your convenience, an additional unit tests package is provided this package lets you verify your code changes even without using a physical device right-click on com samsung health mysteps test and select run 'tests in 'com samsung health mysteps' if you completed all the tasks correctly, you can see that all the unit tests passed successfully run the app after building the apk, you can run the app on a connected device to read your steps data once the app starts, allow all permissions to read steps data from samsung health and tap done afterwards, the app's main screen appears, displaying the daily summary of steps taken, target, and steps by hour swipe down to sync the latest data from samsung health you can scroll down to steps by hour to see the hourly breakdown you're done! congratulations! you have successfully achieved the goal of this code lab now, you can create a mobile health app that reads samsung health steps count data by yourself! if you are having trouble, you may download this file health data steps complete code 573 4 kb to learn more about samsung health, visit developer samsung com/health
Develop Smart Signage
docapplication security this topic describe the security of applications which run on samsung devices related info web security testing guide owasp secure software development lifecycle microsoft security development lifecycle sdl cwe list version 4 6 overview security is becoming an important issue with the increase of various smart devices in order to protect data from users and businesses, samsung devices are enhancing security in several layers, from hardware to software as samsung device applications are also software driven by samsung, the security needs to be taken into account samsung device applications can store important information such as code and key values and personal information of the user, which is an important resource that must be protected these resources can be leaked due to a variety of reasons, such as a simple mistake by a developer or hacking by an attacker in order to safeguard this, samsung device applications need to be developed according to secure by design in particular, the personal information of the user should comply with the policy related to the personal information for each country secure by design all software within the devices developed by samsung are based on the secure development lifecycle sdl model, and development step is divided into analysis, design, implementation, and testing, so vulnerability should be removed by performing a security review at each step from the same point of view, applications operating on samsung device should maintain the same security level for this, we recommend that you consider security in the application development phase by referring to the following step-by-step security review security in the analysis/design phase you should identify important information that is stored and transferred and ensure that the information is handled safely if you receive user input, you should review that you do not require more information than you need, and there is no issue with the input format you must identify the important information to be used and ensure that the information is displayed on vulnerable areas in the flow of the program in particular, when transmitting important information outside the device, you need to ensure that it communicates with the specified server through a secured channel at the time of designing, you must first define important information that needs to be protected and design it in a proper manner to protect it security in the implementation phase it must be implemented in compliance with security rules to prevent information in the software from being leaked through known vulnerabilities important information obtained in the design phase should be stored by applying security techniques such as encryption and make sure that it does not exist in plain text within the program establish secure coding rules for each language and proceed with development accordingly you must use only the minimum permissions required and notify the user of the permissions you use you should make sure that the security channel is properly set on the network, and the latest version of the technology is applied if you use encryption algorithms, you must use them securely using verified standard algorithms where vulnerabilities are not reported security in test phase security checks must be performed before deployment to prevent security issues and maintain security through maintenance after deployment before deployment, it is necessary to verify that there is no issue with analysis, design, and implementation when actually operated through simulated hacking, packet checking, etc after deployment, if a new vulnerability is found or a modification occurs in the security check, it must be patched and applied to all users as soon as possible security review process in order to maintain the security of the application ecosystem, samsung is performing security checks on the submitted applications samsung checks the risk or misuse cases that may occur due to the submitted applications, and if there is an issue, the deployment process can be stopped and the application submitter can be advised to fix it application security guide this section provides basic security guidelines to consider in the development of applications for a safe and reliable application running environment, we recommend that you proceed with the following points in the development phase data protection three key factors for data protection are confidentiality, integrity, and availability if an application sends or stores sensitive information, the application must encrypt data stored on these devices and protect it from attackers it is very important to protect sensitive data such as user credentials or personal information in application security if the mechanism of the operating system is not used correctly, sensitive data can be unintentionally exposed definition of sensitive data personally identifiable information that can be exploited for identity theft for example, resident registration number, social security number, credit card number, bank account number, health information, etc sensitive data that can lead to loss of honor and loss of money if leaked all data that must be protected for legal or compliance reasons security item description data protection sensitive data, such as passwords or pin data, should not be exposed through the user interface the key values used by the application must be hardcoded or not stored in plain text sensitive data should not be stored in an application container or external storage sensitive data should not be recorded in the application log sensitive data should not be shared with third parties unless it is necessary in the architecture sensitive data should not be shared with third parties unless it is necessary in the architecture keyboard cache must be disabled from the text input that processes sensitive data sensitive data should not be exposed even during internal communication you should ensure that the data stored in the client-side storage ex html5 local storage, session store, indexeddb, regular cookie, or flash cookie does not contain sensitive data make sure that you have provided clear t&c for the collection and use of the provided personal information and that you have provided selective consent to the use of that data before you use it reference links european union general data protection regulation gdpr overvieweuropean union data protection supervisor - internet privacy engineering networkapplication development privacy guide table 1 data protection security description and reference links authentication if there is a feature to log-in to the remote service by the user, it must be configured through security design even when most of the logic is operating on a remote service, the device must also meet security requirements on how to manage user accounts and sessions security item description authentication if the application provides remote services to the user, user name and password authentication must be performed from the remote service if you use status storage session management, the remote service must authenticate the client request using the randomly generated session identifier without sending the user's credentials if using stateless token-based authentication, the remote services must provide signed tokens using security algorithms when a user logs out, the remote service must end the existing session table 2 authentication security description access control an application can access a resource only if it has access to it security item description access control application must require only the minimum access required application must use the privilege that match the permissions and specify the privileges used when accessing user data, make sure that the principle of minimum access privilege requirement is followed applications must have access to apis, data files, urls, controllers, directories, services, and other resources with minimal access required you should verify and process all input from external resources and users this should include data received through the ui, a user-defined url, inter-process communication ipc , etc if an application uses a completely unprotected custom url, you should not export sensitive information important data or apis must be protected from user access other than data owners reference links owasp cheat sheet access control table 3 access control security description and reference links communications when the network is used, the application should not display the transmitted/received content using a secured channel security item description communications data must be encrypted on the network using tls transport layer security security channels must be used consistently throughout the application the setting of the security channel must be configured to protect information safely the data being transmitted must be protected from being snatched/taken over in the middle ex defence against man in the middle attack reference links owasp – tls cheat sheet table 4 communications security description and reference links input validation you must defend the command insertion attack through validating the validity of input value input value validation should be considered at all stages of development security item description input validation input values must process the data based on type and content, applicable laws, regulations and other policy compliance, and define how to handle it you must ensure that input validation is performed on a trusted service layer you need to check whether it protects against parameter attacks such as mass parameter allocation attacks or unsafe parameter allocation all possible input values e g html form fields, rest requests, url parameters, http headers, cookies, batch files, rss feeds, etc must be checked using validation ex whitelist you should check whether the values entered are in the correct form in well-defined schemas, including allowed characters, lengths, and patterns the url redirection and forward should display a warning that only whitelist targets are allowed or that you are connecting with potentially untrusted content make sure you use memory safety strings, secure memory copy, and pointer calculation to detect or prevent stacks, buffers, or heap overflows in order to prevent integer overflow, you need to make sure that sign, range, and input validation techniques are used reference links xml external entity xxe prevention cheat sheetreducing xss by way of automatic context-aware escaping in template systems table 5 input validation security description and reference links password management in case of application with different user password, security settings are required for them security item description password management you must ensure that the password does not contain spaces and cut/copy is not performed in the password change feature, you should check that the user's current password and new password are required it is recommended to provide a password strength meter so that users can set a stronger password it is also recommended to provide rules that limit allowed character types uppercase letter, numeric, special characters you should check that it is recommended to change your user password within the right due date do not store the user password in the application's properties or settings file in plain text or recoverable form passwords must be stored, transferred, and compared in a hashed state using a standard hash function to prevent random attacks, you should use the login limit number of login or captcha default password should not be generated make sure you do not show the key information, like passwords in the log reference links cwe-804 guessable captchacwe-836 use of password hash instead of password for authenticationcwe-257 storing passwords in a recoverable formatcwe-261 weak encoding for passwordcwe-263 password aging with long expiration table 6 password management security description and reference links session manager a session is a technique for controlling and maintaining the status of a user or device interacting with one user in a web application a session has a unique value for each user and cannot guess or share that value security item description session manager you should check that the session token is not exposed/displayed in the application's url parameter or error message make sure the application generates a new session token from user authentication you should check that the session token is stored using properly secured cookies or security methods you should check that a session token is generated using a standard encryption algorithm make sure the session is not reused by verifying that the session token is invalid when logout and session expires reference links owasp session management cheat sheetalgorithms, key size and parameters report 2014 table 7 session manager security description and reference links error handling the purpose of error handling is to allow applications to provide security events related to monitoring, status check, and increase in permission, and not just creating logs security item description error handling you must ensure that common error handling formats and access method are used you must make sure exception handling is used on the code base to explain expected and unexpected error conditions you must ensure that other error handlers that can prepare all unprocessed exceptions are defined in case of an error, you must make sure that the message shown to the user does not contain application-related technical or sensitive information we recommend using separate error codes for error support table 8 error handling security description release check the following before releasing the application security item description release application must be signed and distributed with a valid certificate, and the private key must be properly protected debugging code and developer support code test code, back door, hidden settings, etc must be removed deployed applications should not output or record detailed errors or debugging messages libraries and frameworks etc used by applications should be checked for known vulnerabilities the equipment used for release must be able to respond to external threats viruses, hacking, etc it should be built in release mode a separate debug message should not be left from the application if you include binary, debug information should be removed if a vulnerability occurs after release, you should update the application as soon as possible and always keep the latest version table 9 release security description
Develop Smart TV
docapplication security this topic describe the security of applications which run on samsung devices related info web security testing guide owasp secure software development lifecycle microsoft security development lifecycle sdl cwe list version 4 6 overview security is becoming an important issue with the increase of various smart devices in order to protect data from users and businesses, samsung devices are enhancing security in several layers, from hardware to software as samsung device applications are also software driven by samsung, the security needs to be taken into account samsung device applications can store important information such as code and key values and personal information of the user, which is an important resource that must be protected these resources can be leaked due to a variety of reasons, such as a simple mistake by a developer or hacking by an attacker in order to safeguard this, samsung device applications need to be developed according to secure by design in particular, the personal information of the user should comply with the policy related to the personal information for each country secure by design all software within the devices developed by samsung are based on the secure development lifecycle sdl model, and development step is divided into analysis, design, implementation, and testing, so vulnerability should be removed by performing a security review at each step from the same point of view, applications operating on samsung device should maintain the same security level for this, we recommend that you consider security in the application development phase by referring to the following step-by-step security review security in the analysis/design phase you should identify important information that is stored and transferred and ensure that the information is handled safely if you receive user input, you should review that you do not require more information than you need, and there is no issue with the input format you must identify the important information to be used and ensure that the information is displayed on vulnerable areas in the flow of the program in particular, when transmitting important information outside the device, you need to ensure that it communicates with the specified server through a secured channel at the time of designing, you must first define important information that needs to be protected and design it in a proper manner to protect it security in the implementation phase it must be implemented in compliance with security rules to prevent information in the software from being leaked through known vulnerabilities important information obtained in the design phase should be stored by applying security techniques such as encryption and make sure that it does not exist in plain text within the program establish secure coding rules for each language and proceed with development accordingly you must use only the minimum permissions required and notify the user of the permissions you use you should make sure that the security channel is properly set on the network, and the latest version of the technology is applied if you use encryption algorithms, you must use them securely using verified standard algorithms where vulnerabilities are not reported security in test phase security checks must be performed before deployment to prevent security issues and maintain security through maintenance after deployment before deployment, it is necessary to verify that there is no issue with analysis, design, and implementation when actually operated through simulated hacking, packet checking, etc after deployment, if a new vulnerability is found or a modification occurs in the security check, it must be patched and applied to all users as soon as possible security review process in order to maintain the security of the application ecosystem, samsung is performing security checks on the submitted applications samsung checks the risk or misuse cases that may occur due to the submitted applications, and if there is an issue, the deployment process can be stopped and the application submitter can be advised to fix it application security guide this section provides basic security guidelines to consider in the development of applications for a safe and reliable application running environment, we recommend that you proceed with the following points in the development phase data protection three key factors for data protection are confidentiality, integrity, and availability if an application sends or stores sensitive information, the application must encrypt data stored on these devices and protect it from attackers it is very important to protect sensitive data such as user credentials or personal information in application security if the mechanism of the operating system is not used correctly, sensitive data can be unintentionally exposed definition of sensitive data personally identifiable information that can be exploited for identity theft for example, resident registration number, social security number, credit card number, bank account number, health information, etc sensitive data that can lead to loss of honor and loss of money if leaked all data that must be protected for legal or compliance reasons security item description data protection sensitive data, such as passwords or pin data, should not be exposed through the user interface the key values used by the application must be hardcoded or not stored in plain text sensitive data should not be stored in an application container or external storage sensitive data should not be recorded in the application log sensitive data should not be shared with third parties unless it is necessary in the architecture sensitive data should not be shared with third parties unless it is necessary in the architecture keyboard cache must be disabled from the text input that processes sensitive data sensitive data should not be exposed even during internal communication you should ensure that the data stored in the client-side storage ex html5 local storage, session store, indexeddb, regular cookie, or flash cookie does not contain sensitive data make sure that you have provided clear t&c for the collection and use of the provided personal information and that you have provided selective consent to the use of that data before you use it reference links european union general data protection regulation gdpr overvieweuropean union data protection supervisor - internet privacy engineering networkapplication development privacy guide table 1 data protection security description and reference links authentication if there is a feature to log-in to the remote service by the user, it must be configured through security design even when most of the logic is operating on a remote service, the device must also meet security requirements on how to manage user accounts and sessions security item description authentication if the application provides remote services to the user, user name and password authentication must be performed from the remote service if you use status storage session management, the remote service must authenticate the client request using the randomly generated session identifier without sending the user's credentials if using stateless token-based authentication, the remote services must provide signed tokens using security algorithms when a user logs out, the remote service must end the existing session table 2 authentication security description access control an application can access a resource only if it has access to it security item description access control application must require only the minimum access required application must use the privilege that match the permissions and specify the privileges used when accessing user data, make sure that the principle of minimum access privilege requirement is followed applications must have access to apis, data files, urls, controllers, directories, services, and other resources with minimal access required you should verify and process all input from external resources and users this should include data received through the ui, a user-defined url, inter-process communication ipc , etc if an application uses a completely unprotected custom url, you should not export sensitive information important data or apis must be protected from user access other than data owners reference links owasp cheat sheet access control table 3 access control security description and reference links communications when the network is used, the application should not display the transmitted/received content using a secured channel security item description communications data must be encrypted on the network using tls transport layer security security channels must be used consistently throughout the application the setting of the security channel must be configured to protect information safely the data being transmitted must be protected from being snatched/taken over in the middle ex defence against man in the middle attack reference links owasp – tls cheat sheet table 4 communications security description and reference links input validation you must defend the command insertion attack through validating the validity of input value input value validation should be considered at all stages of development security item description input validation input values must process the data based on type and content, applicable laws, regulations and other policy compliance, and define how to handle it you must ensure that input validation is performed on a trusted service layer you need to check whether it protects against parameter attacks such as mass parameter allocation attacks or unsafe parameter allocation all possible input values e g html form fields, rest requests, url parameters, http headers, cookies, batch files, rss feeds, etc must be checked using validation ex whitelist you should check whether the values entered are in the correct form in well-defined schemas, including allowed characters, lengths, and patterns the url redirection and forward should display a warning that only whitelist targets are allowed or that you are connecting with potentially untrusted content make sure you use memory safety strings, secure memory copy, and pointer calculation to detect or prevent stacks, buffers, or heap overflows in order to prevent integer overflow, you need to make sure that sign, range, and input validation techniques are used reference links xml external entity xxe prevention cheat sheetreducing xss by way of automatic context-aware escaping in template systems table 5 input validation security description and reference links password management in case of application with different user password, security settings are required for them security item description password management you must ensure that the password does not contain spaces and cut/copy is not performed in the password change feature, you should check that the user's current password and new password are required it is recommended to provide a password strength meter so that users can set a stronger password it is also recommended to provide rules that limit allowed character types uppercase letter, numeric, special characters you should check that it is recommended to change your user password within the right due date do not store the user password in the application's properties or settings file in plain text or recoverable form passwords must be stored, transferred, and compared in a hashed state using a standard hash function to prevent random attacks, you should use the login limit number of login or captcha default password should not be generated make sure you do not show the key information, like passwords in the log reference links cwe-804 guessable captchacwe-836 use of password hash instead of password for authenticationcwe-257 storing passwords in a recoverable formatcwe-261 weak encoding for passwordcwe-263 password aging with long expiration table 6 password management security description and reference links session manager a session is a technique for controlling and maintaining the status of a user or device interacting with one user in a web application a session has a unique value for each user and cannot guess or share that value security item description session manager you should check that the session token is not exposed/displayed in the application's url parameter or error message make sure the application generates a new session token from user authentication you should check that the session token is stored using properly secured cookies or security methods you should check that a session token is generated using a standard encryption algorithm make sure the session is not reused by verifying that the session token is invalid when logout and session expires reference links owasp session management cheat sheetalgorithms, key size and parameters report 2014 table 7 session manager security description and reference links error handling the purpose of error handling is to allow applications to provide security events related to monitoring, status check, and increase in permission, and not just creating logs security item description error handling you must ensure that common error handling formats and access method are used you must make sure exception handling is used on the code base to explain expected and unexpected error conditions you must ensure that other error handlers that can prepare all unprocessed exceptions are defined in case of an error, you must make sure that the message shown to the user does not contain application-related technical or sensitive information we recommend using separate error codes for error support table 8 error handling security description release check the following before releasing the application security item description release application must be signed and distributed with a valid certificate, and the private key must be properly protected debugging code and developer support code test code, back door, hidden settings, etc must be removed deployed applications should not output or record detailed errors or debugging messages libraries and frameworks etc used by applications should be checked for known vulnerabilities the equipment used for release must be able to respond to external threats viruses, hacking, etc it should be built in release mode a separate debug message should not be left from the application if you include binary, debug information should be removed if a vulnerability occurs after release, you should update the application as soon as possible and always keep the latest version table 9 release security description
We use cookies to improve your experience on our website and to show you relevant advertising. Manage you settings for our cookies below.
These cookies are essential as they enable you to move around the website. This category cannot be disabled.
These cookies collect information about how you use our website. for example which pages you visit most often. All information these cookies collect is used to improve how the website works.
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and tailor the website to provide enhanced features and content for you.
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.
You have successfully updated your cookie preferences.