1.how to store the accelerometer data in the database.
2.what is the maximum rang of the accelerometer data.for example
what will be the rang of x,y and z such that "x"+event.values[0]
show the maximum rang is 9.
3.the following is the code
public class MainActivity extends Activity implements SensorEventListener {
TextView acceleration;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SensorManager sm=(SensorManager)getSystemService(SENSOR_SERVICE);
Sensor accelerometer=sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
sm.registerListener(this,accelerometer,SensorManager.SENSOR_DELAY_NORMAL);
TextView acceleration=(TextView)findViewById(R.id.acceleration);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public void onAccuracyChanged(Sensor arg0, int arg1) {
}
@Override
public void onSensorChanged(SensorEvent event) {
acceleration.setText("x:"+event.values[0]+"\n"+"y:"+event.values[1]+"\n"+"z:"+event.values[2]);
}
}
4.For storing the data in the database how many tables are require.
5.is it require 3 tables.for example one table for x,one table for y,one table for z.
6.i want to store the data then compare the stored data and if its maximum so then show that its runing.
7.if its medium then show its walking.
8.if its low than show its sleeping.