title: Tizen Service Application not running normally in background without being connected to Tizen Studio
body: <p>I am trying to build a native tizen app which will detect activity and collect sensor data periodically to upload to a remote http server.  </p>
  
  <p>For this I have developed two things.<br>
   1. A Native UI Application to Start/Stop the<br>
   2. A Service application  </p>
  
  <p>I am developing the project in tizen studio with a <strong>samsung gear fit 2 pro</strong> connected via remote device manager over wifi.</p>
  
  <p>When I run my app it works fine while my device is connected to sdb.
  But when I disconnect the device it starts doing non-deterministic behavior.
  For example, while it's connected to tizen studio, App records data for first 15s of every 60s and on the 16th second it uploads that file to server. It also starts on callback of activity change.<br>
  But as soon as the device is disconnected, that interval is not maintained properly i.e. sensors read data after 30 minutes(that also varies) and even frequency of data collection for every second is reduced dramatically. But if the UI app is in foreground then again everything is okay.</p>
  
  <p>So, my app works normally if it's foreground or it's in foreground/background and device is connected to sdb on pc.</p>
  
  <p>How can I make my service to run always in background irrespective of device's connection to tizen sdb on PC?</p>
  
  <p>N.B. Data Upload is done using libcurl and that uses a timeout of 5s for connection and on failure it skips uploading. Ecore Timer is used but timer should not be a problem as I have tested by running sensor always but frequency decrease issue still persists.
  Sensor starting options in service app are as follows</p>
  
  <pre><code>sensor_get_default_sensor(sensor_type, &amp;sensor);
  sensor_create_listener(sensor, &amp;listener[sensor_type]);
  sensor_listener_set_event_cb(listener[sensor_type], 1000 / SENSOR_FREQ, example_sensor_callback, vc);
  sensor_listener_set_option(listener[sensor_type], SENSOR_OPTION_ALWAYS_ON);
  sensor_listener_start(listener[sensor_type]);
  </code></pre>