I am trying to develop a application in android that consists a service to read the sensor value for multiple hours. When i start the service my device get hang and all the othe
you can try using AsyncTask, please read this documentation.
AsyncTask
http://developer.android.com/reference/android/os/AsyncTask.html