[3.0][geofence-manager] add new sub-part about proximity
authorjongmun.woo <jongmun.woo@samsung.com>
Thu, 26 May 2016 07:39:39 +0000 (16:39 +0900)
committerjongmun.woo <jongmun.woo@samsung.com>
Thu, 26 May 2016 07:40:05 +0000 (16:40 +0900)
Signed-off-by: jongmun.woo <jongmun.woo@samsung.com>
Change-Id: I27225e69c49625f0abe57dda1ff388a634d44e4f

org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm

index 48080b4..08f0969 100644 (file)
@@ -26,7 +26,8 @@
                        <li><a href="#status">Getting the Geofence Event State</a></li>
                        <li><a href="#track">Tracking the User for Geofence Alerts</a></li>
                        <li><a href="#info">Retrieving Geofence Information</a></li>
-               </ul>        
+                       <li><a href="#proximity">Tracking the User for Proximity Alerts</a></li>
+               </ul>
         <p class="toc-title">Related Info</p>
         <ul class="toc">
             <li><a href="../../../../org.tizen.guides/html/native/location/geofence_n.htm">Geofence Manager Guide</a></li>
@@ -41,7 +42,7 @@
 <p>This tutorial demonstrates how you can implement geofence-related information and services.</p>
 
 <p>This feature is supported in mobile applications only.</p>
-  
+
 <h2>Warm-up</h2>
 <p>Become familiar with Geofence Manager API basics by learning about:</p>
 <ul>
 <li><a href="#track">Tracking the User for Geofence Alerts</a>
        <p>Track the user location and update the geofence state.</p></li>
 <li><a href="#info">Retrieving Geofence Information</a>
-       <p>Get information on geofences.</p></li></ul>
+       <p>Get information on geofences.</p></li>
+<li><a href="#proximity">Tracking the User for Proximity Alerts</a>
+       <p>Track the user location and update the proximity state.</p></li>
+</ul>
 
        <h2 id="prerequisites">Prerequisites</h2>
-       
+
 <p>To use the functions and data types of the <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__GEOFENCE__MANAGER__MODULE.html">Geofence Manager</a> API, include the <span style="font-family: Courier New,Courier,monospace">&lt;geofence_manager.h&gt;</span> header file in your application:</p>
 <pre class="prettyprint">
 #include &lt;geofence_manager.h&gt;
 </pre>
 
 <h2 id="start" name="start">Starting the Geofence Service</h2>
-                       
-<p>To start the geofence service:</p>          
+
+<p>To start the geofence service:</p>
 <ol>
 <li><p>Create a geofence manager handle using the <span style="font-family: Courier New,Courier,monospace">geofence_manager_create()</span> function:</p>
 <pre class="prettyprint">
@@ -138,14 +142,14 @@ manager = NULL;
 <p>If you destroy the handle, there is no need to call the <span style="font-family: Courier New,Courier,monospace">geofence_manager_stop()</span> function to stop the service as the service is automatically stopped. Also, you do not have to unset the previously set callbacks.</p></li></ol>
 
                                <h2 id="status" name="status">Getting the Geofence Event State</h2>
-                               
+
 <p>To get the state of all geofence events, use the geofence event callback. The geofence event callback is invoked whenever there is a request from the user, for example, to add a geofence or to start a geofence service.</p>
 
 <ol>
 <li><p>Register the callback using the <span style="font-family: Courier New,Courier,monospace">geofence_manager_set_geofence_event_cb()</span> function:</p>
 <pre class="prettyprint">
 geofence_manager_set_geofence_event_cb(manager, geofence_event, NULL);
-</pre> 
+</pre>
 </li>
 <li><p>Get the success or failure state of the event in the callback:</p>
 <pre class="prettyprint">
@@ -174,10 +178,10 @@ geofence_event(int place_id, int geofence_id, geofence_manager_error_e error,
 
 </li></ol>
 
-                       
+
                                <h2 id="track" name="track">Tracking the User for Geofence Alerts</h2>
-                               
-                               
+
+
 <p>To get information about the in or out state for the geofence:</p>
 <ol>
 <li>Receive event-based notifications:
@@ -219,7 +223,7 @@ geofence_status_destroy(status_h);
 </ol>
 
 
-                       
+
                                <h2 id="info" name="info">Retrieving Geofence Information</h2>
                                  <p>To get information about the geofence:</p>
 
@@ -258,6 +262,24 @@ free(ssid);
 </pre></li></ul>
 
 
+
+<h2 id="proximity" name="proximity">Tracking the User for Proximity Alerts</h2>
+
+<p>To get information about the proximity state:</p>
+<ol>
+<li><p> You can get notifications about the proximity state updates using the state update callback. The callback is invoked on an event, receiving the current state of the user with respect to proximity with each call.</p>
+<p>Register the proximity state update callback using the <span style="font-family: Courier New,Courier,monospace;">geofence_manager_set_geofence_proximity_state_changed_cb()</span> function.</p>
+<pre class="prettyprint">
+geofence_manager_set_geofence_proximity_state_changed_cb(manager, proximity_state_changed, NULL);
+</pre></li>
+<li><p>Define the callback function:</p>
+<pre class="prettyprint">
+void
+proximity_state_changed(int geofence_id, geofence_proximity_state_e state, geofence_proximity_provider_e provider, void *user_data) {}
+</pre></li></ol>
+
+
+
 <script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../../scripts/showhide.js"></script>
 
@@ -267,4 +289,4 @@ free(ssid);
 <p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
 </div>
 </body>
-</html>                        
+</html>