随笔分类 -  Android

1 2 3 4 5 ··· 7 下一页

安卓开发
Fresco使用及问题
摘要:1.Android Studio使用远程依赖时下载不了jar包的解决方法// 需要添加以下maven库,否则使用远程依赖时,可能无法下载fresco数据:compile ('com.facebook.fresco:fresco:0.4.0+')// Error:(126, 14) Failed to... 阅读全文

posted @ 2015-05-14 17:50 veins 阅读(7721) 评论(0) 推荐(0)

Difference between getContext() , getApplicationContext() , getBaseContext()
摘要:1.http://stackoverflow.com/questions/22966601/what-is-different-between-mainactivity-this-vs-getapplicationcontext/22967165#22967165There are two type... 阅读全文

posted @ 2015-05-13 15:09 veins 阅读(1492) 评论(0) 推荐(0)

Integrating .so files into your APK
摘要:With the recent changes (release 0.7.3 around Dec 27), thenew Android Build Systemstarts to be really interesting also if you are using the NDK!0.7.2:... 阅读全文

posted @ 2015-04-25 15:58 veins 阅读(222) 评论(0) 推荐(0)

简单优化:Zipalign
摘要:Android SDK中包含一个“zipalign”的工具,它能够对打包的应用程序进行优化。在你的应用程序上运行zipalign,使得在运行时Android与应用程序间的交互更加有效率。因此,这种方式能够让应用程序和整个系统运行得更快。我们强烈推荐在新的和已经发布的程序上使用zipalign工具来得... 阅读全文

posted @ 2015-04-07 10:33 veins 阅读(214) 评论(0) 推荐(0)

Using lists in Android (ListView) - Tutorial
摘要:LarsVogelVersion 4.6Copyright © 2010, 2011, 2012, 2013, 2014 vogella GmbH20.11.2014Using Android ListView, ListActivity and ListFragmentThis tutorial ... 阅读全文

posted @ 2015-04-03 16:37 veins 阅读(513) 评论(0) 推荐(0)

How to declare global variables in Android? --- Application Subclasses
摘要:I wrote this answer back in '09 when Android was relatively new, and there were many not well established areas in Android development. I have added a... 阅读全文

posted @ 2015-04-02 20:47 veins 阅读(248) 评论(0) 推荐(0)

android Application类的详细介绍
摘要:在代码中经常看到application这个类,一直不知道这个是干什么用的,今天刚好有点时间,所以进行了详细的学习。一.先对它的整体概念解释:在android源码中对他的描述是; * Base class for those who need to maintain global applicatio... 阅读全文

posted @ 2015-04-02 20:34 veins 阅读(248) 评论(0) 推荐(0)

Android setTag方法的key问题
摘要:android在设计View类时,为了能储存一些辅助信息,设计一个一个setTag/getTag的方法。这让我想起在Winform设计中每个Control同样存在一个Tag。今天要说的是我最近学习android遇见的setTag的坑。一般情况下我们只需要使用唯一参数的setTag方法。但有时我们需要... 阅读全文

posted @ 2015-03-31 20:17 veins 阅读(441) 评论(0) 推荐(0)

android事件拦截处理机制图解
摘要:前段时间刚接触过android手机开发,对它的事件传播机制不是很了解,虽然网上也查了相关的资料,但是总觉得理解模模糊糊,似是而非,于是自己就写个小demo测试了一下。总算搞明白了它的具体机制。写下自己的结论,分享之,希望对初学android的人有所帮助布局效果如图所示:图1参照上图先说说具体得到的结... 阅读全文

posted @ 2015-03-27 17:03 veins 阅读(376) 评论(0) 推荐(0)

android:clipToPadding和android:clipChildren
摘要:Android官网:android:clipChildren setClipChildren(boolean) Defines whether a child is limited to draw inside of its bounds or not. android:clipToPa... 阅读全文

posted @ 2015-03-27 17:01 veins 阅读(1221) 评论(0) 推荐(0)

Android - SpannableString或SpannableStringBuilder以及string.xml文件中的整型和string型代替
摘要:背景介绍在开发应用过程中经常会遇到显示一些不同的字体风格的信息犹如默认的LockScreen上面的时间和充电信息。对于类似的情况,可能第一反应就是用不同的多个TextView来实现,对于每个TextView设置不同的字体风格以满足需求。这里推荐的做法是使用android.text.*;和 andro... 阅读全文

posted @ 2015-02-03 14:18 veins 阅读(286) 评论(0) 推荐(0)

Android-SharedPreferences源码学习与最佳实践
摘要:最近有个任务是要做应用启动时间优化,然后记录系统启动的各个步骤所占用的时间,发现有一个方法是操作SharedPreferences的,里面仅仅是读了2个key,然后更新一下值,然后再写回去,耗时竟然在500ms以上(应用初次安装的时候),感到非常吃惊。以前只是隐约的知道SharedPreferenc... 阅读全文

posted @ 2015-02-03 11:05 veins 阅读(634) 评论(0) 推荐(0)

Android获取屏幕宽高的方法
摘要:1. 实现代码 private int mWidth; private int mHeight; @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public void getDisplayMetrics() { ... 阅读全文

posted @ 2015-01-07 15:38 veins 阅读(2264) 评论(0) 推荐(0)

Fragment Transactions Reference/Animations
摘要:I recently found myself looking at Fragment transactions and wondering precisely what each Fragment state meant. I vaguely had an idea of what added, ... 阅读全文

posted @ 2015-01-06 11:10 veins 阅读(209) 评论(0) 推荐(0)

SharedPreference.Editor的apply和commit方法异同
摘要:在android 中存储数据时经常用SharedPreference, 并且在提交数据时一直用的是Editor的commit方法, 今天无意了看到了系统用了apply,看了方法的介绍, 原来这个方法也是可以提交数据的.apply方法在官方SDK说明如下:Commit your preferences... 阅读全文

posted @ 2014-12-29 16:25 veins 阅读(200) 评论(0) 推荐(0)

Android 网络通信框架Volley简介(Google IO 2013)
摘要:Volley主页https://android.googlesource.com/platform/frameworks/volleyhttp://www.youtube.com/watch?v=yhv8l9F44qo&feature=player_embedded1. 什么是Volley在这之前,... 阅读全文

posted @ 2014-12-26 16:12 veins 阅读(189) 评论(0) 推荐(0)

Android调试工具之Traceview
摘要:Traceview是android平台配备的一个很好的性能分析工具。它可以通过图形化的方式让我们了解我们要跟踪的程序的性能,并且能具体到method。进行Traceview的版本限制对于Android 1.5及以下的版本:不支持。对于Android 1.5以上2.1下(含2.1)的版本:受限支持。t... 阅读全文

posted @ 2014-12-19 14:57 veins 阅读(345) 评论(0) 推荐(0)

解决android studio启动时fetching Android sdk compoment information连接时间较长
摘要:1)进入刚安装的Android Studio目录下的bin目录。找到idea.properties文件,用文本编辑器打开。2)在idea.properties文件末尾添加一行: disable.android.first.run=true ,然后保存文件。3)关闭Android Studio后重新启... 阅读全文

posted @ 2014-12-18 16:59 veins 阅读(228) 评论(0) 推荐(0)

ConcurrentModificationException and a HashMap
摘要:This is not a synchronization problem. This will occur if the underlying collection that is being iterated over is modified by anything other than the... 阅读全文

posted @ 2014-12-17 17:56 veins 阅读(153) 评论(0) 推荐(0)

ListView分栏的实现
摘要:ListView分栏(Columnar ListView)的好处在于,区分内容,便于用户操作选择。核心思想是:在指定位置插入标题内容。实现方法如下:1,实现Adapter的areAllItemsEnabled()方法和isEnabled()方法,确定内容显然,ListView的Item中,标题不可被... 阅读全文

posted @ 2014-12-12 14:04 veins 阅读(729) 评论(0) 推荐(0)

1 2 3 4 5 ··· 7 下一页

导航