摘要: Android applications are, at least on the T-Mobile G1, limited to 16 MB of heap. It’s both a lot of memory for a phone and yet very little for what so... 阅读全文
posted @ 2015-08-29 23:15 -小城- 阅读(109) 评论(0) 推荐(0) 编辑
摘要: This document primarily covers micro-optimizations that can improve overall app performance when combined, but it's unlikely that these changes will r... 阅读全文
posted @ 2015-08-29 23:12 -小城- 阅读(78) 评论(0) 推荐(0) 编辑
摘要: IntroductionMemory allocation and de-allocation in Android* always comes at a cost. The Chinese saying “Easy to be luxurious from frugal, hard to be f... 阅读全文
posted @ 2015-08-29 23:10 -小城- 阅读(139) 评论(0) 推荐(0) 编辑
摘要: For those trackingthe evolution of Android, it is evident that the future of the Android based ecosystem goes far beyond just phones and tablets. The ... 阅读全文
posted @ 2015-08-29 23:09 -小城- 阅读(173) 评论(0) 推荐(0) 编辑
摘要: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a backg... 阅读全文
posted @ 2015-08-29 23:07 -小城- 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 本文首先概述了Android的进程间通信的Binder机制,然后结合一个AIDL的例子,对Binder机制进行了解析。概述 我们知道,在Android app中的众多activity,service等组件可以运行在同一进程中,也可以运行在不同进程中。当组件运行在同一进程中进行通信就显得比较简单,在之... 阅读全文
posted @ 2015-08-29 21:17 -小城- 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 本文首先从整体架构分析了Android整个线程间消息传递机制,然后从源码角度介绍了各个组件的作用和完成的任务。文中并未对基础概念进行介绍,关于threadLacal和垃圾回收等等机制请自行研究。基础架构 首先,我们需要从整体架构上了解一下Android线程通信都做了哪些工作。我们都知道,进程是... 阅读全文
posted @ 2015-08-29 21:10 -小城- 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 1. 基本介绍大家平时只要懂一点Android知识的话,都一定会知道,一个应用的组成,往往包含了许多的activity组件,每个activity都应该围绕用户的特定动作进行跳转设计。比如说,一个电话通讯录的应用可能有一个总体展示电话录上所有存储的姓名的activity,当用户选择指定的姓名时,可以启... 阅读全文
posted @ 2015-08-29 21:00 -小城- 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 难度:中等给出一个字符串数组S,找到其中所有的乱序字符串(Anagram)。如果一个字符串是乱序字符串,那么他存在一个字母集合相同,但顺序不同的字符串也在S中。样例对于字符串数组["lint","intl","inlt","code"]返回["lint","inlt","intl"]注意所有的字符串... 阅读全文
posted @ 2015-08-29 12:14 -小城- 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 难度:容易字符串查找(又称查找子字符串),是字符串操作中一个很有用的函数。你的任务是实现这个函数。对于一个给定的 source 字符串和一个 target 字符串,你应该在 source 字符串中找出 target 字符串出现的第一个位置(从0开始)。如果不存在,则返回-1。样例如果 source ... 阅读全文
posted @ 2015-08-29 02:41 -小城- 阅读(4435) 评论(0) 推荐(0) 编辑
摘要: 难度:容易写出一个函数anagram(s, t)去判断两个字符串是否是颠倒字母顺序构成的。样例给出 s="abcd",t="dcab",返回true。S="abcd",T="aabd",返回false。答案: 1 public class Solution { 2 /** 3 * ... 阅读全文
posted @ 2015-08-29 01:26 -小城- 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 难度:中等Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the t... 阅读全文
posted @ 2015-08-29 00:50 -小城- 阅读(183) 评论(0) 推荐(0) 编辑