2012年5月27日
摘要: 传感器的种类: 1.动作传感器 加速度传感器、重力传感器和陀螺仪(判断手机姿态)等 2. 位置传感器 方向传感器和磁力传感器 3. 环境传感器 温度传感器 、压力传感器和亮度传感器 使用传感器的方法: 1. 获取SensorManager对象 SensorManagersensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); 2. 执行SensorManager对象的getDefaultSensor()方法获取Sensor对象并且传入一个特定的参数 3. 获取Sensor对象的各种属性 4. 使用Sens. 阅读全文
posted @ 2012-05-27 18:49 lee0oo0 阅读(497) 评论(0) 推荐(0) 编辑
摘要: 1. 首先继承EditText 2. 并重写onTouchEvent方法 public boolean onTouchEvent(MotionEvent event) { Editable ed=this.getEditableText(); //获得action int action = event.getAction(); //用来显示文本的Layout布局 Layout layout = this.getLayout(); //获得第几行 int pointY = layout.getLineForVertical(getScrollY()+(in... 阅读全文
posted @ 2012-05-27 13:41 lee0oo0 阅读(330) 评论(0) 推荐(0) 编辑
摘要: String uriPic = "http://lh3.ggpht.com/_s354WAuIc9E/" + "R_DpW4Rzj-I/AAAAAAAAAsc/Ox73tdxGLSw/logo.jpg"; /* new URL对象将网址传入 */ URL imageUrl = new URL(uriPic); /* 取得联机 */ HttpURLConnection conn = (HttpURLConnection) imageUrl .openConnection(); conn.connect(); /* 取得回传的Inpu... 阅读全文
posted @ 2012-05-27 10:34 lee0oo0 阅读(254) 评论(0) 推荐(0) 编辑