摘要: androidSDK中并没有锁定文件相关的api.但是android是基于linux操作系统的,linux比较底层,灵活性也更大,为了实现锁定文件的效果,大概有以下几种办法:用chmod命令修改文件读写权限利用linux中的多线程独占锁,启动一个长期占用文件的后台线程使用文件IO流,对文件的前1K字... 阅读全文
posted @ 2016-01-09 21:08 BlogCommunicator 阅读(2952) 评论(0) 推荐(1) 编辑
摘要: 转自:http://blog.csdn.net/pwei007/article/details/6015907Android平台支持蓝牙网络协议栈,实现蓝牙设备之间数据的无线传输。本文档描述了怎样利用android平台提供的蓝牙API去实现蓝牙设备之间的通信,蓝牙设备之间的通信主要包括了四个步骤:设... 阅读全文
posted @ 2015-12-24 22:44 BlogCommunicator 阅读(290) 评论(0) 推荐(0) 编辑
摘要: (1)基本#id element .class * selector1,selector2,selectorN (2)层次选择器:ancestor descendant parent > child prev + next prev ~ siblings (3)基本过滤器选择器:first :las... 阅读全文
posted @ 2015-12-13 21:59 BlogCommunicator 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 先上代码,后面会分析String url = "http://wxpay.weixin.qq.com/pub_v2/app/app_pay.php?plat=android";Button payBtn = (Button) findViewById(R.id.appay_btn);payBtn.s... 阅读全文
posted @ 2015-12-09 15:36 BlogCommunicator 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 我们知道xUtils中的bitmapUtils与listview相配合可以实现滚动时暂停加载只需要一句话:listview.addOnScrollListener(new PauseOnScrollListener( bitmapUtils, false, true))... 阅读全文
posted @ 2015-11-25 22:06 BlogCommunicator 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://jijiaxin89.com/2015/08/30/Android-s-Runtime-Permission/Android M 新的运行时权限开发者需要知道的一切android M 的名字官方刚发布不久,最终正式版即将来临!android在不断发展,最近的更新 M 非常不同... 阅读全文
posted @ 2015-11-22 23:06 BlogCommunicator 阅读(296) 评论(0) 推荐(0) 编辑
摘要: StackTraceElement caller = Thread.currentThread().getStackTrace()[4]; String className = caller.getClassName();// 带有包名信息 className = cla... 阅读全文
posted @ 2015-11-22 22:59 BlogCommunicator 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://blog.csdn.net/x_i_a_o_h_a_i/article/details/40449847其实网上的3D旋转的例子很多,在这里我只是想把其代码做一个解释。先上图:代码:TurnAroundActivity/** * 图片浏览器的主Activity。 * * @... 阅读全文
posted @ 2015-11-19 09:59 BlogCommunicator 阅读(1331) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://blog.sina.com.cn/s/blog_4c277ad30100yfqo.html客户需求需要增加对手机尺寸的读取于是找了两个方法第一种:通过activity引用调用getWindowManager()但是我的客户端是没有界面的因此使用另一种方法第二种:只需要传入co... 阅读全文
posted @ 2015-11-19 09:53 BlogCommunicator 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 第一个,计算字符串的md5值public static String getMD5(String s){ String newString = null; byte[] inputByteArray = s.getBytes(); char hexDigi... 阅读全文
posted @ 2015-11-17 13:53 BlogCommunicator 阅读(266) 评论(0) 推荐(0) 编辑