上一页 1 ··· 7 8 9 10 11 12 13 14 下一页
摘要: 步骤: 1、获取SensorMananger的实例:SensorManager sensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); 2、调用getDefaultSensor()获取任意的传感器类型。 3、监 阅读全文
posted @ 2016-12-08 11:30 yl007 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 自己的位置:LocationManager 基本用法:创建实例:LocationManager locationManager = (LocationManager)getSystemService(Context,LOCATION_SERVICE); 位置提供器:GPS_PROVIDER、NETW 阅读全文
posted @ 2016-12-07 16:35 yl007 阅读(599) 评论(0) 推荐(0) 编辑
摘要: WebView:在应用中嵌入一个浏览器 webView需要在AndroidManifest.xml中声明权限 HTTP协议 原理:客户端向服务端发送一条HTTP请求,服务器收到请求后返回数据给客户端,客户端再对数据进行解析和处理。 发送请求:HttpURLConnection和HttpClient两 阅读全文
posted @ 2016-12-07 15:48 yl007 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Android多线程: 定义线程的2种方式: 1、继承Thread类,重写run()方法,new一个实例,用start()方法启动:new MyThread().start(); 2、实现Runnable接口:new Thread(new Runnable()){实现run()} 子线程中更新UI: 阅读全文
posted @ 2016-12-06 16:28 yl007 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 步骤: 1、调用getSystemService()获取NotificationManager:NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); 2、创 阅读全文
posted @ 2016-12-05 17:49 yl007 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 借用ContentResolver类访问ContentProvider中共享的数据。通过getContentResolver()方法获得该类的实例。 ContentResolver中的方法:insert()、updata()、delete()、query() ContentResolver中增删改查 阅读全文
posted @ 2016-11-25 16:33 yl007 阅读(855) 评论(0) 推荐(0) 编辑
摘要: 数据持久化: 1、文件存储 适合用于存储一些简单的文本数据或二进制数据 存储数据:openFileOutput(文件名,操作模式),返回值为一个FileOutputStream对象,借助FileOutputStream对象构建出OutputStreamWriter对象,再借助OutputStream 阅读全文
posted @ 2016-11-24 16:54 yl007 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 广播的类型: 1、标准广播(Normal broadcat) 完全异步执行的广播,所有广播接收器同一时间接收广播消息。 效率高,但无法被截断。 2、有序广播 同步执行的广播,同一时刻只能有一个广播接收器接收广播消息,当执行完毕后才会继续传递。 优先级高的先收到广播,并且可以截断广播。 接收系统广播: 阅读全文
posted @ 2016-11-14 16:27 yl007 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Fragment的生命周期: onAttach():onAttach()方法会在Fragment与Activity窗口关联后立刻调用。 onCreate():在调用完onAttach()执行完之后,立即就会调用onCreate()方法,可以在Bundle对象中获取一些在Activity中传过来的数据 阅读全文
posted @ 2016-11-11 16:45 yl007 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 一、Android控件 1、TextView 属性:id、width、height、gravity(对齐方式)、textSize(文字大小)、textColor(文字颜色) 2、Button 属性:id、width、height... 监听器:setOnClickListener() 3、EditT 阅读全文
posted @ 2016-11-11 13:27 yl007 阅读(165) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 下一页