android
文章平均质量分 55
chenzhangkai
这个作者很懒,什么都没留下…
展开
-
Android定时关机
第一个小项目练练手吧,,大多数内容都是参考别人的。1.设置关机时间。设置时间用的是TimePicker , tp_time1 = (TimePicker) findViewById(R.id.tp_time1); tp_time1.setIs24HourView(true); Button btn_settime1=(Button) findViewBy...原创 2017-10-14 12:19:29 · 4545 阅读 · 3 评论 -
创建xml文件并保存数据
直接上代码 XmlSerializer serializer = Xml.newSerializer(); File file = new File(getApplication().getFilesDir(), "data.xml"); FileOutputStream fos; try { fos = n...原创 2017-10-30 20:24:17 · 1142 阅读 · 0 评论 -
从xml文件中取数据
也是直接上代码 try { String path = getApplication().getFilesDir().toString(); File file = new File(path, "data.xml"); FileInputStream fis = new FileInputStream(file);...原创 2017-10-30 20:31:32 · 4307 阅读 · 0 评论 -
截图功能
在github上看到一个可以实现截图功能的demo,,,使用方法:public void getScreen() {String filename = getApplication().getFilesDir().toString() + "test.png";ScreentShotUtil.getInstance().takeScreenshot(getApplicationContex...转载 2017-11-02 10:21:05 · 264 阅读 · 0 评论 -
设置手机设备管理器
private void initDevice() { //设置设备管理器// 申请权限ComponentName componentName = new ComponentName(this,deviceAdminReceiver.class);// 设备安全管理服务 2.2之前的版本是没有对外暴露的 只能通过反射技术获取DevicePolicyManager devicePolic...转载 2018-03-21 17:04:55 · 1459 阅读 · 0 评论