随笔-6  评论-0  文章-0  trackbacks-0
  2011年7月20日

1.传感器事件概念
2.为应用程序注册传感器
3.获取传感器的值和精度
public boolean registerListener (SensorEventListener listener,Sensor sensor,int rate)
样例
package org.marsdroid.sensor()2;
import android.app.Activitity;

public class MainActivity extends Activity{
  //声明一个SensorManager对象
  private SensorManager sensorManager;
  @Override
  public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    //获取SensorManager对象
    sensorManager=(SensorManager)getSystemService(Context.SESOR_SERVICE);
    //获取光线传感器对象
    Sensor lightSensor=sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
    //注册传感器
    sensorManager.registerListener(new SensorEventListener(){
      public void onSensorChanged(SensorEvent event){
        float acc=event.accuracy;
        float lux=event.values[0];
        System.out.println("acc---->"+acc);
        System.out.println("lux---->"+lux);
      }
      public void onAccuracyChanged(Sensor sensor,int accuracy){
      }
    },lightSensor,SensorManager.SENSOR_DELAY_NORMAL);
  }
}
------------------------
Http://creativecommons.org/licenses/by-nc-sa/2.5/cn/legalcode

posted @ 2012-08-14 14:26 保密 阅读(149) | 评论 (0)编辑 收藏

1.传感器的分类
  一、动作传感器:加速度传感器、重力传感器和陀螺仪等
  二、位置传感器:方向传感器和磁力传感器
  三、环境传感器:温度传感器、压力传感器和亮度传感器等

2.Android设备传感器的特点
3.获取手机当中所有传感器的名称

使用传感器的方法:
1.获取SensorManager对象
2.执行SensorManager对象的getDefaultSensor()方法获取Sensor对象
3.获取Sensor对象的各种属性

posted @ 2012-08-11 11:07 保密 阅读(120) | 评论 (0)编辑 收藏
http://www.easyui.org.cn/------------JQuery插件 easyUI
http://extjs.org.cn/---------------JQuery插件Extjs
posted @ 2011-09-25 11:15 保密 阅读(110) | 评论 (0)编辑 收藏

作为一个java的初学者,不该在这个纯技术的领域,发这个博文,我且当做随笔好点。寥寥数语,寄予我美好的未来,不断的憧憬。我喜欢上了这首《Wish YOu were here》,尤其喜欢女生版的。O(∩_∩)O~   听到What I‘d do to have near near near                near near                                             near near near near                     
near near near                near near                                             near near near near                       
near near near                near near                                             near near near near
near near near                near near                                             near near near near
near near near                near near                                               near near near near
near near near               near near                                                near near near near
near near near               near near                                                near near near near
near near near near near near near                                              near near near near
near near near near near near near                                               near near near near
near near near near near near near                                              near near near near
near near near near near near near                                              near near near near
near near near near near near near                                              near near near near
near near near                near near                                             near near near near
near near near                near near                                             near near near near
near near near                near near                                             near near near near
near near near                near near                                            near near near near
near near near                near near                                           near near near near
near near near                near near                                          near near near near
near near near                near near                                          near near near near
near near near                near near                                          near near near near
near near near                near near                                     near near near near
near near near                near near                                 near near near near
near near near                near near                               near near near near
near near near                near near                           near near near near
 ,I wish you                    were here,                        dam,dam ,dam,hear  
near mier mier                 mier mier                       mier mier mier mier 
                           特                                      mier mier mier mier
                           鸡
                           冻
                        O(∩_∩)O~


不知道为啥子原因,那个ID不存在了,转而又有个似曾相识的 使用着不同的ID。  一个java初学者 不能去查IP 是最丢脸的事情,去查了也是很丢脸的玩意!     姑且当做落花有意,流水无情~~      




Expiration Date:

If you compel me to put it,I'll say forever!
在以下区域,试试点击鼠标
Best wish for my best friend!

 

posted @ 2011-07-20 23:00 保密 阅读(330) | 评论 (0)编辑 收藏