<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Geoff Thomas on Medium]]></title>
        <description><![CDATA[Stories by Geoff Thomas on Medium]]></description>
        <link>https://medium.com/@thomasgeoff?source=rss-129355057283------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Gc1-EawhfqLYXVqUG0vG9A.jpeg</url>
            <title>Stories by Geoff Thomas on Medium</title>
            <link>https://medium.com/@thomasgeoff?source=rss-129355057283------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 15:13:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thomasgeoff/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SensorLab: Sensor Libraries Explained]]></title>
            <link>https://medium.com/@thomasgeoff/sensorlab-sensor-libraries-explained-cbd75a1c0fa8?source=rss-129355057283------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbd75a1c0fa8</guid>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[tizen]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[samsung-smartwatch]]></category>
            <category><![CDATA[gear-s3]]></category>
            <dc:creator><![CDATA[Geoff Thomas]]></dc:creator>
            <pubDate>Mon, 20 Apr 2020 16:39:27 GMT</pubDate>
            <atom:updated>2020-04-21T03:05:23.770Z</atom:updated>
            <content:encoded><![CDATA[<p>In my previous <a href="https://medium.com/@thomasgeoff/how-to-easily-create-a-samsung-gear-s3-smartwatch-sensor-applications-b756f5a71f6d">article</a>, I introduced SensorLab and explained how to create a Samsung Smartwatch application in a mere 6 minutes. But I didn’t explain each sensor library files in detail to control the length of the article, which will be taken care of in this article.</p><h4><strong>Sensor Library</strong></h4><p>The sensor library is created using web <a href="https://en.wikipedia.org/wiki/Application_programming_interface">APIs</a>. It includes JavaScript files for all sensors with at most three functions, value variables, HTML variable for each sensor. They are described as:</p><ul><li>The <strong>functions</strong> are used to start/stop and get sensor hardware information.</li><li>The <strong>value variable</strong> stores the values fetched from the sensor.</li><li>The <strong>Html variable</strong> holds the value variable to display on the front-end/watch screen.</li></ul><p>Functions and variables associated with each sensor/actuator are described in the following sections.</p><ol><li><strong>Light Sensor</strong></li></ol><p>It is a photodetector which senses the ambient light falling on the smartwatch screen.</p><ul><li><strong>getLight()</strong> function starts the light sensor and the fetched light value is assigned to the value variable <strong>‘light’</strong>.</li><li><strong>getLightInfo()</strong> function displays the light sensor hardware information in the Tizen output console only during the emulator mode(refers to running the app on the Tizen watch emulator).</li><li><strong>stopLight() </strong>function stops the light sensor.</li><li><strong>‘light’</strong> is the value variable which gets initialized with values ranging from 0–100% when <strong>getLight()</strong> function is called.</li><li><strong>‘lightRateEl’ </strong>is the HTML variable which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p>2. <strong>Pressure Sensor/ Barometer</strong></p><p>It is a sensor used to measure atmospheric pressure.</p><ul><li><strong>getPressure()</strong> function starts the pressure sensor and the fetched pressure value is assigned to the value variable <strong>‘pressure’</strong>.</li><li><strong>getPressureInfo()</strong> function displays the pressure sensor hardware information in the Tizen output console only during the emulator mode(refers to running the app on the Tizen watch emulator).</li><li><strong>stopPressure() </strong>function stops the pressure sensor.</li><li><strong>‘pressure’</strong> is the value variable which gets initialized with values ranging from 260–1260hPa when <strong>getPressure()</strong> function is called.</li><li><strong>‘pressureRateEl’ </strong>is the HTML variable which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p>3. <strong>Acceleration Sensor/Accelerometer</strong></p><p>It is a sensor which measures the rate of change of velocity of a body</p><ul><li><strong>getAccelerometer()</strong> function starts the Accelerometer sensor and the fetched Accelerometer values is assigned to the value variables <strong>‘ax’, ‘ay’, ‘az’</strong>.</li><li><strong>getAccelerometerInfo()</strong> function displays the Accelerometer sensor hardware information in the Tizen output console only during the emulator mode(refers to running the app on the Tizen watch emulator).</li><li><strong>stopAccelerometer() </strong>function stops the Accelerometer sensor.</li><li><strong>‘ax’, ‘ay’, ‘az’</strong> are the value variables along the x-axis, y-axis, z-axis which gets initialized with values ranging from -19.6–19.6, when <strong>getAccelerometer()</strong> function is called.</li><li><strong>‘accelerometerRateEl’ </strong>is the HTML variable which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p>4. <strong>Gravity Sensor</strong></p><p>An accelerometer at rest measures rate of change of velocity due to Earth’s gravity.</p><ul><li><strong>getGravity()</strong> function starts the gravity sensor and the fetched gravity values are assigned to the value variable <strong>‘grx’, ‘gry’, ‘grz’</strong>.</li><li><strong>getGravityInfo()</strong> function displays the gravity sensor hardware information in the Tizen output console only during the emulator mode(refers to running the app on the Tizen watch emulator).</li><li><strong>stopGravity() </strong>function stops the gravity sensor.</li><li><strong>‘grx’, ‘gry’, ‘grz’ </strong>are the value variables along the x-axis, y-axis, z-axis which gets initialized with values ranging from -19.6–19.6, when <strong>getGravity()</strong> function is called.</li><li><strong>‘garvityRateEl’ </strong>is the HTML variable which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p>5. <strong>Gyroscope Sensor</strong></p><p>It is a sensor which determines the object orientation to Earth’s gravity.</p><ul><li><strong>getGyroscope()</strong> function starts the gyroscope sensor and the fetched gyroscope values are assigned to the value variable <strong>‘grx’, ‘gry’, ‘grz’</strong>.</li><li><strong>getGyroscopeInfo()</strong> function displays the gyroscope sensor hardware information in the Tizen output console only during the emulator mode(refers to running the app on the Tizen watch emulator).</li><li><strong>stopGyroscope() </strong>function stops the gyroscope sensor.</li><li><strong>‘gx’, ‘gy’, ‘gz’ </strong>are the value variables along the x-axis, y-axis, z-axis which gets initialized with values ranging from -32768–32768, when <strong>getGyroscope()</strong> function is called.</li><li><strong>‘GyroscopeRateEl’ </strong>is the HTML variable which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p>6. <strong>GPS Sensor</strong></p><p>It is a sensor which gets the device position, velocity information from satellites.</p><ul><li><strong>getGps()</strong> function starts the GPS sensor and the fetched GPS values is assigned to the value variables <strong>‘Latitude’, ‘Longitude’, ‘Altitude’, ‘Speed’.</strong></li><li><strong>stopGps() </strong>function stops the GPS sensor.</li><li><strong>‘Latitude’, ‘Longitude’</strong> is the value variables which gets initialized with latitude and longitude when <strong>getGps()</strong> function is called.</li><li><strong>‘Altitude</strong> is the value variable which gets initialized with altitude when <strong>getGps()</strong> function is called.</li><li><strong>‘speed’</strong> is the value variable which gets initialized with speed, when <strong>getGps()</strong> function is called.</li><li><strong>‘gpsRateEl’ </strong>is the HTML variable containing latitude and longitude values, which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li><li><strong>‘altitudeRateEl’ </strong>is the HTML variable containing the altitude value, which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li><li><strong>‘speedRateEl’ </strong>is the HTML variable containing the speed value, which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p>7. <strong>Heart Rate Sensor</strong></p><p>It is a sensor which measures the heart rate in real-time.</p><ul><li><strong>getHeartrate()</strong> function starts the heart rate sensor and the fetched light value is assigned to the value variable <strong>‘light’</strong>.</li><li><strong>stopHeartrate() </strong>function stops the heart rate sensor.</li><li><strong>‘heart_rate’</strong> is the value variable which gets initialized with values ranging from 0–250Bpm when <strong>getHeartrate()</strong> function is called.</li><li><strong>‘heartRateEl’ </strong>is the HTML variable which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p>8. <strong>Pedometer</strong></p><p>It is a sensor which measures the steps based on hand and hip movement.</p><ul><li><strong>getPedometer()</strong> function starts the pedometer sensor and the fetched pedometer values are assigned to the value variables <strong>‘step’ and ‘step_status’</strong>.</li><li><strong>stopPedometer() </strong>function stops the light sensor.</li><li><strong>‘step’</strong> is the value variable which gets initialized with step count when <strong>getPedometer()</strong> function is called.</li><li><strong>‘step_status’</strong> is the value variable which gets initialized with step status when <strong>getPedometer()</strong> function is called.</li><li><strong>‘pedometerRateEl’ </strong>is the HTML variable which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p>9. <strong>Vibrator</strong></p><p>It is an actuator to give vibration feedback.</p><ul><li><strong>vibrate(milliseconds)</strong> function starts the vibrator for the given time milli-seconds. It is used as a feedback mechanism.</li></ul><p>10. <strong>Back Button</strong></p><p>It is a button which performs the “go back” function.</p><ul><li><strong>backButton()</strong> function initializes the back button of the smartwatch to close the application when pressed.</li><li><strong>backButtonCheck()</strong> function checks if the back button is pressed and return a Boolean.</li></ul><p>11. <strong>RequestToWebapp</strong></p><p>It is an extra set of the function used to communicate with SensorLab web application to visualize and store at most three sensor readings. The SensorLab web application is described in the next section.</p><ul><li><strong>postWebapp(value 1, value 2, value 3)</strong> function can take three sensor readings and makes a POST HTTP request to the SensorLab web application for graphical visualization.</li><li><strong>getWebapp( ) </strong>function makes a GET HTTP request to the SensorLab web application to return all the sensor readings stored in the Web app database.</li><li><strong>putWebapp(color-code) </strong>function can take a hexadecimal colour code ranging from 0-FFFFFF and makes a PUT HTTP request to the SensorLab web application to change the colour picker colour.</li></ul><h4><strong>Sensor Library Table</strong></h4><p>After understanding how to use the library to manipulate one sensor, then all you need is the table given below which has a summary of all the functions and sensors available. Don’t get overwhelmed by the table length, trust me all the information in each row is very similar. If you can manipulate one sensor that means that you can manipulate all the sensors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*FUHIs-2QyX-fDBELSdNaPg.jpeg" /><figcaption>Sensor Library Table</figcaption></figure><blockquote>Please let me know in the comments, whether you wish me to write a continuation article with more focus on <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">RESTful</a> App development.</blockquote><p>Thank you for your patient reading. If you enjoyed this article, feel free to hit that clap button 👏 to help others find it. (Did you know? You can clap more than once. Try it and see for yourself!).Don’t hesitate to drop a comment, if you are stuck or have doubts. Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbd75a1c0fa8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SensorLab: How to create a Samsung Smartwatch Sensor Applications in 6mins.]]></title>
            <link>https://medium.com/@thomasgeoff/how-to-easily-create-a-samsung-gear-s3-smartwatch-sensor-applications-b756f5a71f6d?source=rss-129355057283------2</link>
            <guid isPermaLink="false">https://medium.com/p/b756f5a71f6d</guid>
            <category><![CDATA[tizen]]></category>
            <category><![CDATA[samsung-gear-s3]]></category>
            <category><![CDATA[smartwatch]]></category>
            <category><![CDATA[galaxy]]></category>
            <category><![CDATA[sensors]]></category>
            <dc:creator><![CDATA[Geoff Thomas]]></dc:creator>
            <pubDate>Thu, 24 Oct 2019 00:13:14 GMT</pubDate>
            <atom:updated>2020-04-21T02:55:46.918Z</atom:updated>
            <content:encoded><![CDATA[<h3>SensorLab: How to create a Samsung smartwatch App in 6mins</h3><p>In this article, I’m going to show you how you can create a <strong>Samsung smartwatch sensor application</strong> <strong>by</strong> <strong>writing less than 5 lines of code 😍</strong>, using the sensor libraries I have created called <strong>SensorLab</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*77UiQkKl_soqdkwbgV-jwA.jpeg" /><figcaption>Figure 1: 4-Step Smartwatch Application Development Process</figcaption></figure><blockquote><strong><em>Kindly bear with me friends. This article is lengthy as I tried to explain everything in detail so that even a non-technical person can make use of this.</em></strong></blockquote><p>Firstly, I want to introduce my sensor library, SensorLab.</p><h4><strong>Sensor Library</strong></h4><p>The sensor library is created using web API’s provided by Samsung for the Gear S3 Smartwatch. It includes JavaScript files for all sensors with at most three functions, value variables, HTML variable for each sensor. They are described as:</p><ul><li>The <strong>functions</strong> are used to start/stop and get sensor hardware information.</li><li>The <strong>value variable</strong> stores the values fetched from the sensor.</li><li>The <strong>Html variable</strong> holds the value variable to display on the front-end/watch screen.</li></ul><p>For example for <strong>Light Sensor</strong>:</p><ul><li><strong>getLight()</strong> function starts the light sensor and the fetched light value is assigned to the value variable <strong>‘light’</strong>.</li><li><strong>getLightInfo()</strong> function displays the light sensor hardware information in the Tizen output console only during the emulator mode(refers to running the app on the Tizen watch emulator).</li><li><strong>stopLight() </strong>function stops the light sensor.</li><li><strong>‘light’</strong> is the value variable which gets initialized with values ranging from 0–100% when <strong>getLight()</strong> function is called.</li><li><strong>‘lightRateEl’ </strong>is the HTML variable which is connected to the HTML element in the index.html file or front-end (What the user sees.)</li></ul><p><strong>Note: Each sensor libraries are explained in this </strong><a href="https://medium.com/@thomasgeoff/sensorlab-sensor-libraries-explained-cbd75a1c0fa8"><strong>article</strong></a><strong>. This is done to control the length of this article.</strong></p><h4><strong>Sensor Library Table</strong></h4><p>After understanding how to use the library to manipulate one sensor, then all you need is the table which has a summary of all the functions and sensors available. Don’t get overwhelmed by the table length, trust me all the information in each row is very similar. If you can manipulate one sensor that means that you can manipulate all the 10sensors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*FUHIs-2QyX-fDBELSdNaPg.jpeg" /><figcaption>Sensor Library Table</figcaption></figure><p>Now let’s get into the application development part.</p><h4><strong>How to make a Samsung smartwatch Application:</strong></h4><p>Developing a sensor application for Samsung smartwatch involves four steps (as shown in Figure 1) as follows :</p><ol><li><strong>Prepare the Integrated Development Environment (IDE):</strong> This step verifies whether the hardware and software requirements are met and installs Tizen Studio IDE in the PC.</li><li><strong>Creating the Wearable Web Application: </strong>In this step, a Samsung smartwatch sensor application is built in Tizen Studio using Html, CSS and JavaScript.</li><li><strong>Run the application in Tizen Emulator: </strong>After building the sensor application, it is simulated using Tizen emulator to make sure everything works fine. This allows debugging the application before deployment to the real target device, if necessary.</li><li><strong>Deploy the application to the Samsung smartwatch: </strong>After successfully building the sensor application without bugs, deploy it to the Samsung smartwatch to see the real sensors reading.</li></ol><p>The above steps are described in detail in the following sections:</p><h4><strong>1. Prepare the Integrated Development Environment (IDE)</strong></h4><p>Software requirements for Tizen studio are shown in the below Figures 2 &amp; 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*CrlssjOfEthHK1nB_7XjjA.png" /><figcaption>Figure 2: OS and System Requirements</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*Rzi7DiwJVPWK7Nx8Zg5vqA.png" /><figcaption>Figure 3: Emulator Requirements</figcaption></figure><p>Follow the steps below to prepare the Integrated development environment:</p><p><strong>A.</strong> Download and Install prerequisites from this <a href="https://developer.tizen.org/ko/development/tizen-studio/download/installing-tizen-studio/prerequisites">link</a> for your respective operating system:</p><p><strong>For Window:</strong></p><ul><li>Click on official Oracle Web Site (A as shown in Figure 4) -&gt; Install Java SE Development Kit 8u2318 (Windows x64)</li></ul><p><strong>For Mac OS:</strong></p><ul><li>Click on official Oracle Web Site (B as shown in Figure 4) -&gt; install Java SE Development Kit 8u231 (Mac OS X x64)</li><li>Click on link C(as shown in Figure 4) -&gt; Download and install Java for OS X 2017–0018</li></ul><p><strong>For Ubuntu/Linux:</strong></p><ul><li>Click on link D(as shown in Figure 4) and install Java SE Development Kit 8u231 (Linux x64)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*_SlQ8u6SeGHEHWWTazNWhw.png" /><figcaption>Figure 4</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*GHbICzqlBRsSqx9X6rqYvQ.png" /></figure><p><strong>B.</strong> After installing Java SE Development Kit(<strong>OpenJDK)</strong>, add JAVA_HOME variable<strong> </strong>for your operating system as shown below:</p><p><strong>In Windows:</strong></p><p><strong>i.</strong> Go to<strong> Start</strong> -&gt; <strong>Control Panel</strong> -&gt; <strong>System and Security</strong> -&gt; <strong>System</strong>.</p><p><strong>ii.</strong> Click <strong>Advanced system settings</strong>. The System Properties window appears.</p><p><strong>iii.</strong> Click <strong>Environment Variables</strong>. The Environment Variables window appears.</p><p><strong>iv. </strong>Click <strong>New</strong> in the System variables for <em>&lt;username&gt;</em> section.</p><p><strong>v.</strong> Enter <strong>JAVA_HOME</strong> in the variable name field and the JDK directory path, for example, <em>C:\Program Files\Java\jdk1.8.0_221</em>, in the Variable value field. Click <strong>OK</strong>. The Environment Variables window appears like the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*sF9-8uf5vYQ4adoKpHYiig.png" /></figure><p><strong>vi.</strong> Select the <strong>path</strong> variable in the system variables -&gt; Click <strong>Edit</strong> to edit the <strong>path</strong> environment variable. <strong>Edit environment window</strong> opens.</p><p><strong>vii.</strong> Click <strong>New</strong> -&gt; Type the command <strong>%JAVA_HOME%\bin</strong>and click <strong>OK</strong>.</p><p><strong>viii.</strong> Click<strong> OK </strong>to close the Environment Variables window.</p><p><strong>ix.</strong> Launch <strong>Command Prompt</strong> from <strong>Start menu.</strong></p><p><strong>x. </strong>Run the following command to verify whether the <strong>OpenJDK</strong> is installed:</p><pre><strong>java -version</strong></pre><p><strong>For Ubuntu:</strong></p><p><strong>i.</strong> Launch the <strong>Terminal application</strong>.</p><p><strong>ii.</strong> Run the following command in the terminal to set the <strong>JAVA_HOME</strong> as <strong>OpenJDK</strong> directory path, for example:</p><pre><strong>JAVA_HOME=/home/&lt;username&gt;/Desktop/openJDK/jdk-12.0.2/</strong></pre><p><strong>iii. </strong>Run the following commands in the terminal:</p><pre><strong>sudo update-alternatives — install/usr/bin/java java ${JAVA_HOME}/bin/java 20000</strong></pre><pre><strong>sudo update-alternatives — install /usr/bin/javac javac ${JAVA_HOME}/bin/javac 20000</strong></pre><p><strong>iv.</strong> Run the following command to get a list of JDK versions installed:</p><pre><strong>sudo update-alternatives — config java</strong></pre><p><strong>Note:</strong> If there are multiple JDK installed, select the required java version by entering the selection number.</p><p>v. Run the following command:</p><pre><strong>sudo update-alternatives — config javac</strong></pre><p><strong>Note: javac</strong> is for compilation.</p><p>vi. Select the required <strong>javac version</strong> as mentioned above.</p><p>vii. Run the following command to verify whether the <strong>OpenJDK version 8</strong> is installed:</p><p><strong>javac -version</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*vy4Ig_GTJljVEciDJnSKUw.png" /></figure><p><strong>For macOS:</strong></p><p><strong>i.</strong> <strong>Copy</strong> the downloaded <strong>JDK</strong> folder to the <em>Library/Java/JavaVirtualMachines</em> location. This is the default location where all the JDKs are available.</p><p><strong>— — — — — — — — — — — — — — -OR — — — — — — — — — — —</strong></p><p>Use the following command to copy the JDK directory.</p><pre><strong>cp -aR &lt;downloaded_jdk_path&gt; /Library/Java/JavaVirtualMachines/</strong></pre><p><strong>ii.</strong> Launch <strong>Terminal application</strong>.</p><p><strong>iii.</strong> Run the following command to verify whether the <strong>OpenJDK version 8</strong> is installed:</p><pre><strong>java -version</strong></pre><p><strong>Note:</strong> If the <strong>OpenJDK version 8</strong> is not installed, add the following command in the .profile or .bash_profile file:</p><pre><strong>export JAVA_HOME = /Library/Java/JavaVirtualMachines/jdk-12.jdk/Contents/Home</strong></pre><p><strong>C.</strong> Download and Install Tizen Studio from this <a href="https://developer.tizen.org/ko/development/tizen-studio/download">link</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*KW2HbjfOyAGRY9ZKlq8QPA.png" /></figure><p><strong>D.</strong> Launch Tizen Studio and open Package Manager from Tools-&gt;Package Manger.</p><p><strong>i.</strong> Under <strong>Main SDK</strong> <strong>(A)</strong> tab, install your wearable version. To know your watch version, go to Smartwatch <strong>Settings </strong>&lt; <strong>About Gear </strong>&lt; <strong>Software information </strong>&lt; <strong>Tizen version</strong>. For example, Tizen version: <strong>3.0.0.2. </strong>Then install<strong> 3.0 Wearable </strong>as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*7vm618WBkIF3a01yS_aPpg.png" /></figure><p><strong>ii.</strong> Under <strong>Extension SDK(B) </strong>tab, install <strong>Samsung Certificate Extension</strong> and <strong>Samsung Wearable Extension </strong>as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*ntoU9jowjLupTEooZKVhig.png" /><figcaption>Package Manager</figcaption></figure><p><strong>Note:-</strong> In case if you want to uninstall <strong>Tizen Studio</strong>, run the <strong>Uninstaller</strong> app in your PC.</p><h4><strong>2. Creating the Wearable Web Application</strong></h4><p><strong>A.</strong> Follow the steps to create a <strong>Basic UI </strong>(a simple watch application with basic template) application project:</p><p><strong>i.</strong> Launch <strong>Tizen Studio</strong>. A window to select folder/workspace opens.</p><p><strong>ii.</strong> Press <strong>OK</strong> to select the default workspace: <strong>tizen-workspace.</strong></p><p><strong>iii.</strong> Select <strong>File</strong> from menu bar-&gt;<strong>New-</strong>&gt;<strong>Tizen Project</strong>.</p><p><strong>iv.</strong> Select <strong>Template </strong>under project type and click <strong>Next.</strong></p><p><strong>v.</strong> Select <strong>Wearable </strong>and <strong>Wearable version</strong> under profile &amp; version. To know your watch version, go to Watch <strong>Settings-&gt;About Gear-&gt;Software information-&gt;Tizen version</strong>. For example, <strong>Tizen version: 3.0.0.2</strong>. In this case, select <strong>Wearable 3.0. </strong>Click<strong> Next.</strong></p><p><strong>vi.</strong> Select <strong>Web Application</strong> under application type</p><p><strong>vii.</strong> Select <strong>Basic Ui</strong> under application template</p><p><strong>viii.</strong> Name the project <strong>MyFirstApp</strong> and press <strong>Finish</strong>.</p><p><strong>ix.</strong> Then you will see a Tizen project named <strong>MyFirstApp</strong> created under the Project Explorer on the left of <strong>Tizen Studio</strong> as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/156/1*GcMhbzH3onI6AdkHRwrpmA.png" /></figure><p><strong>B.</strong> Go to this <strong>GitHub</strong> <a href="https://github.com/thomasgeoff/sensorlab">link</a> and Click on the green button <strong>Clone or download</strong> -&gt; Click <strong>Download ZIP</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*3oB7iCg49SDtQaTv9Wj7Og.png" /></figure><p><strong>C.</strong> Unzip the zip file and move the unzipped sensorlab-master folder to the JS folder of the Tizen project as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/102/1*o17McEHfc73wKoVUOwbBhA.png" /></figure><p><strong>Note:</strong> There will be warning mention all the functions and files in sensorlab-master folder is not defined. <strong>Ignore these warnings.</strong></p><p>Add the following code line right after <strong>&lt;body&gt;</strong> tag or before <strong>&lt;/body&gt;</strong> tag in the <strong>index.html</strong> file to include all the sensor libraries:</p><p><strong>D.</strong> In the <strong>main.js</strong> file, remove all the code inside the <a href="https://www.w3schools.com/tags/ev_onload.asp"><strong>onload function</strong></a> (a function which loads when the application is launched) and change the function as shown below:</p><pre>//Function invoked on onload event</pre><pre>window.onload = <strong>function</strong> ( ) {</pre><pre>lightRateEl = document.getElementById(‘textbox’); //Line 1</pre><pre>getLight( ); //Line 2 };</pre><p><strong>E.</strong> In the above step, <strong>‘textbox’</strong> in Line 1 is the <strong>id</strong> of an <strong>Html element</strong> in the <strong>index.html</strong> file. We want to display the light value in the <strong>span Html</strong> <strong>element</strong> with the respective <strong>id</strong> as shown below:</p><pre>&lt;div class=<em>contents</em>&gt;1</pre><pre>&lt;div style=’margin:<em>auto</em>;’&gt;</pre><pre>&lt;span class=<em>content_text</em> id=<em>textbox</em>&gt;Basic&lt;/span&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/div&gt;</pre><p><strong>F.</strong> Open <strong>config.xml</strong> file in the Project folder. Under <strong>Privileges</strong> tab, click <strong>‘+’</strong> button to add <strong>privileges</strong>. Search and add <strong>location </strong>&amp; <strong>healthinfo</strong> privilege as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*57fEou_uWnZxPOP5g4Pn0Q.png" /></figure><p><strong>G.</strong> Click <strong>File</strong>&gt; <strong>Save all</strong> in the menu bar. Right-click the <strong>MyFirstApp</strong> project folder and click <strong>Build Project</strong> from the drop-down menu to build the application. Successful build means that the application is ready to run.</p><h4><strong>3. Run the application in Tizen Emulator</strong></h4><p>Follow the steps below to run the application in the <strong>Tizen emulator</strong>:</p><p><strong>A.</strong> After building the <strong>MyFirstApp</strong> project, <strong>Right-click</strong> the <strong>MyFirstApp</strong> project folder again and click <strong>Run-as -&gt;</strong> <strong>Tizen Web Application</strong> in the drop-down menu, to run the project in the Tizen emulator.</p><p><strong>B.</strong> Once the <strong>emulator</strong> loads up, you will see the working <strong>Light Sensor Application </strong>as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/147/1*nrGwYw0z99ax7oemnBMD9A.png" /></figure><h4><strong>4. Deploy the application to the Samsung smartwatch</strong></h4><p>Follow the steps in the below to run the application on a real target device:</p><p><strong>A.</strong> In the Samsung Gear S3:</p><p><strong>i.</strong> Go to <strong>Settings</strong> -&gt; <strong>Connections</strong>, and switch on Wi-Fi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*wWgUWuAKCL61MupuXZMrxA.png" /></figure><p><strong>ii. </strong>Under <strong>Wi-Fi networks</strong>, select the same Wi-Fi to which your PC is connected.</p><p><strong>iii.</strong> Click on the <strong>connected</strong> the <strong>Wi-Fi network</strong>, scroll down and note <strong>the IP address</strong>.</p><p><strong>iv.</strong> For smartwatches launched before 2017: Go to <strong>Settings</strong> -&gt; <strong>About</strong> <strong>Gear</strong>, scroll down to <strong>debugging</strong> and switch it <strong>On</strong>.</p><p><strong>v.</strong> For smartwatches launched from 2017: Go to <strong>Settings</strong> -&gt; <strong>About Gear</strong> -&gt; <strong>Software</strong> -&gt; <strong>Tap 5 times on “Software version” to activate the developer mode. </strong>The restart the watch. Go to <strong>Settings</strong> -&gt; <strong>About Gear</strong> -&gt; Turn on <strong>Debugging mode</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*a-6LsQ8WTBFJ1Gi00ss-XA.png" /></figure><p><strong>B.</strong> In Tizen studio click <strong>Tools</strong>&gt;<strong>Device Manager</strong> to connect the wearable device:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*SiJYLT1sFJwlE0O8p2dv6Q.png" /></figure><p><strong>C.</strong> In the <strong>Device Manager(A)</strong>, click the <strong>Remote Device Manager (B)</strong> button on the top right-hand corner of the above diagram.</p><p><strong>i.</strong> In the <strong>Remote Device Manager (C )</strong>window, click <strong>“+”(D).</strong></p><p><strong>ii.</strong> In the <strong>Add Device</strong> <strong>(E)</strong> window, enter the device and network details (use the <strong>IP address</strong> you noted before), and click <strong>Add</strong>.</p><p><strong>iii.</strong> Available devices will be shown in the <strong>Remote Device Manager</strong> window, switch the new device on by clicking the switch under <strong>Connection(F)</strong>.</p><p><strong>iv. </strong>The wearable device will ask for user confirmation. Click the accept(✔️) mark to give your PC permission to communicate with the <strong>Samsung smartwatch</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/137/1*UmGIzCTazKK9XGNEpyO4CQ.png" /></figure><p><strong>D.</strong> Before you run the application, you must generate an author certificate and sign in using your Samsung account:</p><p><strong>i.</strong> Click <strong>Tools-</strong>&gt; <strong>Certificate Manage</strong> and a <strong>Migration for Certificate Profile</strong> window will open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*wEL5ewVOS058FT8EIDIxfA.png" /></figure><p><strong>ii.</strong> Click <strong>Cancel</strong>, as you don’t have any existing certificate profile. Then <strong>Tizen Certificate Manager</strong> window will open. Under App Signing tab click the <strong>‘+’</strong> button on the right-top corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*4BLnX4fv5MnCAO92V0TYsA.png" /></figure><p><strong>iii.</strong> In the next window, click <strong>Samsung</strong> for Certificate profile type.</p><p><strong>iv.</strong> In the next window, click <strong>Mobile/Wearable</strong> for Device type and Click <strong>Next</strong>.</p><p><strong>v.</strong> Check the <strong>Create a new profile</strong> radio button and name your profile as <strong>test</strong>, Click <strong>Next</strong>.</p><p><strong>vi.</strong> Check the <strong>Create a new author certificate</strong> radio button and click <strong>Next</strong>. Provide author name and password as per your preference and check the checkbox for <strong>Apply the same password for distributor certificate</strong>.</p><p><strong>vii.</strong> Sign in to your <strong>Samsung account</strong> in the window that pops up.</p><p><strong>viii.</strong> Click <strong>Next</strong></p><p><strong>ix. </strong>Check the <strong>Create a new distributor certificate</strong> radio button -&gt;click<strong> Next</strong></p><p><strong>x.</strong> Copy and paste the DUID from <strong>Device manager</strong> &gt; right-click on the connected <strong>Samsung Smartwatch (SM-R760)</strong> &gt; <strong>DUID</strong>. Click <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*C6LoVTYhPp4IwCzU2S4faA.png" /></figure><p><strong>xi. </strong>Certificate profile is successfully created. Set it as active</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*-99N9hHtd7CN7hw3z6Ykag.png" /></figure><p><strong>E.</strong> Right-click the <strong>MyFirstApp</strong> project folder again and click <strong>Run-as -</strong>&gt; <strong>Tizen Web Application</strong> in the drop-down menu, to run the project in <strong>Samsung smartwatch</strong>. Now you will be able to see the app running in your Samsung smartwatch as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/114/1*Mlyoe9fiYLFJoKAjiR4V1g.png" /></figure><blockquote>Please let me know in the comments, whether you wish me to write a continuation article with more focus on <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">RESTful</a> Sensor Application development.</blockquote><p>Thank you for your patient reading. If you enjoyed this article, feel free to hit that clap button 👏 to help others find it. (Did you know? You can clap more than once. Try it and see for yourself!).Don’t hesitate to drop a comment, if you are stuck or have doubts. Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b756f5a71f6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>