fix crash when resume the activity
add sqlite for logging the sensor data
todo:
1. delete old data 
2. add metric name/unit metadata in DbHelper.java