如何在数据库中存储加速度计数据(sqlit) [英] How to store accelerometer data in the database(sqlit)

查看:160
本文介绍了如何在数据库中存储加速度计数据(sqlit)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1.如何将加速度计数据存储在数据库中.

2.加速度计数据的最大范围是多少?例如

x,y和z的范围是什么,使得"x" + event.values [0]

显示最大范围是9.
3.以下是代码

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) {
    // TODO Auto-generated method stub

    }

   @Override
   public void onSensorChanged(SensorEvent event) {
    // TODO Auto-generated method stub

       acceleration.setText("x:"+event.values[0]+"\n"+"y:"+event.values[1]+"\n"+"z:"+event.values[2]);

  }

 }


4.要在数据库中存储数据,需要多少张表.
5.是否需要3个表.例如x的一个表,y的一个表,z的一个表.
6.i要存储数据,然后比较存储的数据,如果最大值,则表明其正在运行.
7.如果介质中等,则显示其行走.
8.如果它的睡眠不足,则表明它处于睡眠状态.


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.

推荐答案

这看上去很像是一项家庭作业,我们不这样做.最好的学习方法是尝试自己弄清楚事情.通过让其他人为您思考,您就不会学习.因此,花时间和尝试是对自己的一项投资,稍后您将感谢.

如果您已经做过某件事,并且陷入了特定的问题,那么人们会帮助您获得答案.但是,要实现这一目标,您需要展示您所做的事情以及遇到的困难.
This looks awfully like a homework and we do not do those. The best way to learn is to try to figure things out by yourself. By letting other people do the thinking for you, you don''t learn. So taking the time and trying is an investment to yourself that you will thank later.

If you have already done something and you''re stuck in a specific question, people will help you to get the answer. But in order to achieve that, you need show what you have done and where you''re stuck at.


这篇关于如何在数据库中存储加速度计数据(sqlit)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆