摘要:转载留用http://www.trinea.cn/android/layout-performance/
阅读全文
随笔分类 - Android
摘要:http://ingramchen.io/blog/2014/09/prevention-of-android-dex-64k-method-size-limit.html
阅读全文
摘要:long startTime = System.currentTimeMillis(); // 开始下载时获取开始时间long curTime = System.currentTimeMillis();int usedTime = (int) ((curTime-startTime)/1000);i...
阅读全文
摘要:情况一:混淆不同的函数aTest、bTest-keep class com.zony.Test { void aTest(byte[], int, int); void bTest(String, int, int);}情况二:混淆相同的函数aTest(aTest参数不同)错误混淆方式:...
阅读全文
摘要:1. Parcelable接口Interface for classes whose instances can be written to and restored from a Parcel。 Classes implementing the Parcelable interface must ...
阅读全文
摘要:1、选中标题后,高亮标题@Override public void onPageSelected(int position) { setSelectTextColor(position); if (delegatePageListener !...
阅读全文
摘要:重写ListView、GridView即可:public class MyListView extends ListView { public MyListView(Context context) { // TODO Auto-generated method stub ...
阅读全文
摘要:一、监听home键盘,Android Home键系统负责监听,捕获后系统自动处理。有时候,我们需要监听home键处理自己的逻辑,监听方法如下: /** * 监听home键广播 */ private final static BroadcastReceiver homeLi...
阅读全文
摘要:1. 打开网页时不调用系统浏览器, 而是在本WebView中显示:mWebView.setWebViewClient(new WebViewClient(){ @Override public boolean shouldOverrideUrlLoading(WebView vi...
阅读全文
摘要:1、如何将一个android工程作为库工程(library project)library project是作为jar包被其它android工程使用的,首先它也是普通的android工程。然后:1)在eclipse Package Explorer,右键android工程选择Properties2)...
阅读全文
摘要:工程上右键 选择export 然后取消选择这个工程里的所有的文件 点开到gen文件夹下选择aidl生成的 java文件 选择生成的java文件和src目录导出jar包即可 AIDL 的编写主要为以下三部分: 创建要操作的实体类,实现 Parcelable 接口,以便序列化/反序列化 新建 aidl
阅读全文
摘要:Found the solution myself in the end. The problem was not with theLinearLayout,but with theScrollView(seems weird, considering the fact that theScroll...
阅读全文
摘要:一、生成密钥库将位置定位在jdk的bin文件中,输入以下命名行:keytool -genkey -alias ChangeBackgroundWidget.keystore -keyalg RSA -validity 20000 -keystore ChangeBackgroundWidget.keystore(中间不换行),按下“Enter”键,并根据提示填写相关信息,详细信息如下及图1(validity为有效期,这里有效期为20000天):输入keystore密码:再次输入新密码:您的名字与姓氏是什么?[Unknown]:mythlink您的组织单位名称是什么?[Unknown]:www.
阅读全文
摘要:很多人都在讨论如何让图片能在异步加载更加流畅,可以显示大量图片,在拖动ListView的时候不会出现卡的现象。关于ImageLoader这个开源框架的使用有很多网友都介绍过,不过还不够清楚,这里有一个关于这个开源项目的完美例子,ListView的图片加载、GridView的图片加载、ViewPager的图片加载、Gallery画廊的图片加载、Widget的使用。很完善的一个例子,在这里我把所有界面效果做出博客分享出来,需要源码的朋友到我的资源页下载下载地址:http://download.csdn.net/detail/wwj_748/5975847要使用ImageLoader就要到这里下载j
阅读全文
摘要:[2013-11-19 14:18:48 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.[2013-11-19 14:18:48 - AsyncDemo] Conversion to Dalvik format failed: Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.一、项目中
阅读全文
摘要:public boolean isChinese(String strName) { char[] ch = strName.toCharArray(); for (int i = 0; i < ch.length; i++) { char c = ch[i]; if (isChinese(c)) { return true; } } return false; } private boolean isChinese(char c) { Character.UnicodeBlock ub = Character.UnicodeBlock.of(c); if (u...
阅读全文
摘要:ailed to fectch URl https://dl-ssl.google.com/android/repository/addons_list.xml, reason: Connection to https://dl-ssl.google.com refused解决办法来源于:code.google.comwindows打开C:\WINDOWS\system32\drivers\etc中的hosts文件在最后一行添加74.125.237.1 dl-ssl.google.com成功解决问题。Linuxsudo sugedit /etc/hosts在最后一行添加74.125.237.1
阅读全文
摘要:获取本机WIFIprivate String getLocalIpAddress() { WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); WifiInfo wifiInfo = wifiManager.getConnectionInfo(); // 获取32位整型IP地址 int ipAddress = wifiInfo.getIpAddress(); //返回整型地址转换成“*.*.*.*”地址 r...
阅读全文
摘要:空两个字符         换行\n
阅读全文
摘要:首先,android平台应用程序可能产生以下四种crash:App层:Force close crashANR crashNative层:Tombstone crashKernel层:Kernel panic比较难定位,可以查看/proc/last_kmsg来辅助定位。最近需要通过monkey工具测试Tombstone类型的crash,抓取log并分析。通过monkey测试,如果要抓取native类型的crash,需要加上--monitor-native-crash参数:seed=$(date +%Y%m%d%H%m%S)monkey -s $seed --pkg-whitelist-file
阅读全文