android学习笔记
CreasyOoooh
这个作者很懒,什么都没留下…
展开
-
Android中点亮屏幕的代码
PowerManager mPowerManager = (PowerManager) getSystemService(POWER_SERVICE); mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "com.example.test");.....................原创 2014-04-30 15:56:31 · 973 阅读 · 0 评论 -
android中搜索联系人
public static final int COLUMN_INDEX_DISPLAYNAME = 1; public static final int COLUMN_INDEX_SEARCHENUMBER = 2; public static ArrayList searchContactsWithSuggest(Context context, String原创 2014-12-18 11:13:18 · 539 阅读 · 0 评论 -
Android中根据电话号码取联系人姓名
public static String getDisplayNameByNumber(Context context, String number) { String displayName = null; Cursor cursor = null; try { ContentResolver resolver原创 2014-12-18 11:43:49 · 2446 阅读 · 0 评论 -
android apk 防止反编译技术第一篇-加壳技术
http://mobile.51cto.com/design-488829.htm转载 2015-12-18 15:21:40 · 375 阅读 · 0 评论 -
一个Android代码小站
http://www.itlanbao.com/转载 2015-12-25 15:43:49 · 326 阅读 · 0 评论 -
Android之UID and PID
http://blog.sina.com.cn/s/blog_62ef2f140101j6q2.html转载 2015-12-09 16:41:28 · 259 阅读 · 0 评论 -
笔记之-uevent机制
http://blog.chinaunix.net/uid-22590270-id-3304271.html转载 2016-02-25 17:30:25 · 360 阅读 · 0 评论 -
解决Android原生TextView显示中英文等末尾参差不齐问题
http://www.tuicool.com/articles/baIJnmm用这个链接里面自己封装的AutoSplitTextView即可,这个封装类解决了TextView获取初始宽度的问题。转载 2016-05-10 16:49:50 · 4118 阅读 · 0 评论 -
Android中github上的开源工程
https://github.com/Trinea/android-open-project/tree/master/English%20Version转载 2016-05-25 16:04:23 · 243 阅读 · 0 评论 -
Android中根据Activity的Category搜索匹配的Activity集合,并对此集合排序
Android中根据Activity的Category搜索匹配的Activity集合,并对此集合排序protected List> getData(String prefix) { List> myData = new ArrayList>(); Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);转载 2016-04-20 11:25:43 · 656 阅读 · 0 评论 -
设计模式学习网站
http://design-patterns.readthedocs.io/zh_CN/latest/转载 2016-05-04 18:49:23 · 266 阅读 · 0 评论 -
Android中的两种空格
空格: 窄空格:原创 2016-07-06 15:44:26 · 1308 阅读 · 0 评论 -
PorterDuffXfermode的SRC_IN使用问题总结
问题场景:因为要做一个透明图片和绘制图形的叠加效果,该透明图片是当前绘制图形所在View的背景,绘制图形在当前View的onDraw方法里面绘制。然后画笔使用SRC_IN,结果在只有当前View时,SRC_IN才起作用。当View放置到一个layout里面,layout背景设置为黑色时,SRC_IN失效了,网上搜索了下,尝试了下,解决方法如下:解决方法:总体的解决方法就是针对当前Vie原创 2016-07-29 11:27:29 · 3381 阅读 · 0 评论 -
unable to execute dex:GC overhead limit exceeded unable to execute dex:java heap space 解决方案
转载地址:http://www.cnblogs.com/garygou/p/3501346.html项目中需要用自己定义的framework.jar,但是这个jar导入以后,编译apk一致卡在99%,最后Eclipse报告unable to execute dex:GC overhead limit exceeded错误,网上找了解决方案修改-Xms128m-Xmx51转载 2016-10-12 16:59:25 · 326 阅读 · 0 评论 -
android中读取联系人的所有信息
public static ArrayList getContactDetailsById(Context context, long id) { Cursor cursor = null; ArrayList details = new ArrayList(); try { String selection =原创 2014-12-10 09:40:36 · 571 阅读 · 0 评论 -
Android中查找短信数据库
public static final Uri MMSSMS_CONTENT_URI = Uri.parse("content://mms-sms"); public static Loader createCursorLoader(Context context, int type, Bundle params) { Uri uri;原创 2014-12-18 11:58:46 · 581 阅读 · 0 评论 -
Android中根据联系人的Recipient ID获取电话号码
public static final Uri MMSSMS_CONTENT_URI = Uri.parse("content://mms-sms"); private static final String COLUMN_ADDRESS = "address"; private static final String COLUMN_ID = "_id"; public stat原创 2014-12-18 11:51:56 · 889 阅读 · 0 评论 -
Android中CheckTextView无法显示
在CheckTextView的XML文件的属性里面加上:多选:android:checkMark="?android:attr/listChoiceIndicatorMultiple"单选:android:checkMark="?android:attr/listChoiceIndicatorSingle"原创 2014-03-31 10:22:26 · 679 阅读 · 0 评论 -
Android中完美解决CheckedTextView选择乱跳问题
XML文件:checked_layout.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:o原创 2014-03-31 10:35:34 · 2495 阅读 · 0 评论 -
android中判断应用是否是系统应用
public boolean isSystemApp(ApplicationInfo info) { if ((info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) { return true; } else if ((info.flags & ApplicationInfo.FLAG_SYST原创 2014-03-29 17:22:15 · 1062 阅读 · 0 评论 -
Android中按照固定长宽缩放图片
private Bitmap getMetadataBitmap(Bitmap bm){ int width = bm.getWidth(); int height = bm.getHeight(); //固定的长宽 int newWidth = 90; int newHeight = 130; float s原创 2014-03-27 10:04:58 · 649 阅读 · 0 评论 -
有用的UI效果
http://my.oschina.net/gluoyer/blog/转载 2014-03-25 18:28:59 · 418 阅读 · 0 评论 -
Android中的JSON详细总结
http://shazhuzhu1.iteye.com/blog/974758转载 2014-03-27 09:46:29 · 406 阅读 · 0 评论 -
Android中监听电池变化
private BroadcastReceiver batteryReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_BATTERY_CHAN原创 2014-06-07 11:29:56 · 562 阅读 · 0 评论 -
Android中一个动态更新时间并显示的小例子
这是一个利用线程和Handler配合更新时间的原创 2014-06-09 16:39:15 · 729 阅读 · 0 评论 -
一个重复滚动的轮子效果的动画
先上重点,动画布局:原创 2014-06-30 14:17:09 · 1707 阅读 · 0 评论 -
一个随手指滑动转动图片的例子
主要是手指滑动时,图片随着滑动而转圈。运用了Android中的原创 2014-07-25 11:13:07 · 1928 阅读 · 0 评论 -
Eclipse导入工程显示:Invalid project description
把当前引起出错的工程COPY到其他目录下,再导入,这样就行了。原创 2014-07-08 10:54:25 · 684 阅读 · 0 评论 -
Android开源项目
一:http://www.csdn.net/article/2013-05-03/2815127-Android-open-source-projects二:转载 2014-07-08 16:20:42 · 553 阅读 · 0 评论 -
Android中定时关机的代码实现
最近客户要求实现平板的定时关机功能。经过在网上查找,结合自己的研究,原创 2014-09-19 10:53:46 · 4867 阅读 · 0 评论 -
Android中一个用Handler实现的循环任务
近期有一个循环任务的问题让人花了不少心思,网上查的要用T原创 2014-10-25 15:37:00 · 1357 阅读 · 0 评论 -
android中根据电话号码读取通话记录表
public static Loader createCursorLoader(Context mContext, int type, Bundle params) { switch (type) { case CallsLogView.TYPE_DEFAULT: return new CursorLoader(mContext, Ca原创 2014-12-18 11:23:21 · 1901 阅读 · 0 评论 -
git中设置http代理和取消http代理
设置http代理git config --global https.proxy https://127.0.0.1:1080取消http代理git config --global --unset http.proxy原创 2016-12-13 16:56:25 · 12361 阅读 · 0 评论