- 博客(28)
- 资源 (1)
- 收藏
- 关注
原创 android in practice_Managing threads in thread pools(MyMovies project)
every list item is created in the list adapter’s getView method, and this method is called whenever you scroll the list to see more items. We could use this method to spawn a thread that downloads the
2012-12-31 15:28:37 670
原创 android:gravity 和 android:layout_Gravity
LinearLayout有两个非常相似的属性:android:gravity与android:layout_gravity。他们的区别在于:android:gravity 属性是对该view中内容的限定.比如一个button 上面的text. 你可以设置该text 相对于view的靠左,靠右等位置.android:layout_gravity是用来设置该view
2012-12-31 13:59:32 392
原创 android预定义样式
字体大小对于能够显示文字的控件(如TextView EditText RadioButton Button CheckBox Chronometer等等),你有时需要控制字体的大小。Android平台定义了三种字体大小。"?android:attr/textAppearanceLarge""?android:attr/textAppearanceMedium""?a
2012-12-31 13:53:36 573
转载 android ImageView scaleType属性
使用ImageView时经常会用到scaleType属性,如:android:layout_height="50dp" android:scaleType="matrix"android:src="@drawable/sample_small" />scaleType属性的各个值总是记不住之间的区别。今天找点时间总结了一下:scaleType的属性值有:matr
2012-12-29 03:43:14 667
原创 android in practice_Communicating change between threads(ImageDownloadWithMessagePassing)
by design it’s impossible to update user interface elements from outside the main UI thread.if you’re sharing state between two or more threads you always need to synchronize this shared data usin
2012-12-29 03:20:18 631
原创 android in practice_Basic threading(simpleImageDownload project)
After clicking the button that initiates the download, Android will give your application no more than a few seconds to respond to that input event. Otherwise, it’ll kill it and raise the previously m
2012-12-28 22:42:59 473
原创 android in practice_Threads and concurrency
you can run services in separate processes, but that isn’t a requirement. In fact, unless you specify a process ID explicitly, they won’t.one golden rule about user interfaces is to always remain re
2012-12-28 11:29:19 569
原创 android in practice_Using Cloud to Device Messaging(portfolio project)
It’s important to think about the effect that the preceding code will have on battery life. The CPU is going to be woken up to make a network call, update a local database,and possibly create Notifi
2012-12-27 16:18:31 583
原创 android in practice_Keeping Services awake(portfolio project)
AlarmManager help us to resurrect our killed Service. But that resurrection could be short-lived.the Service needs to do—retrieve fresh stock data from the Internet and send out Notifications if neede
2012-12-27 14:38:09 747
原创 android in practice_Using the AlarmManager(portfolio project)
system-level alarms.you can’t guarantee that it’ll still be running at that point in the future.To ensure that our code is executed at the desired time, we can’t rely on the Service because the OS
2012-12-26 14:51:43 587
原创 android in practice_Creating notifications(portfolio project)
Having the caching data in the background Service allows that Service to do other things with that data. A common example of this is to create notifications based on the data that’s retrieved from the
2012-12-26 13:27:30 646
原创 android in practice_Using a Service for caching data(portfolio project)
Caching of data can make a huge difference in the performance of any application.You want to centralize the access to this data in one place and cache it, since retrieving it over the network is slo
2012-12-25 15:51:21 484
原创 android in practice_Communicating with a Service (portfolio project)
IPC (InterProcess cummunication)mechanism. This mechanism allows Services to be exposed to other processes and for serialized data to be sent between the processes.create The Stock class, a Parcelab
2012-12-25 14:21:50 778
原创 高级Swing界面JTree编程
目标:1. 掌握JTree应用,树节点的操作;2. 使用JTree展数,管理对象。1.JTree的创建: 22.用JTree展示学生日志系统界面: 43.JTree节点的选中和信息获取 94.JTree的编辑《日志管理实现》: 135.完善分析 20总结和任务: 23
2012-12-24 15:41:42 5522 1
原创 UML中的泛化、依赖、关联、聚合、组合关系
1. OverviewUML设计类中,类的关系分为Generalization(泛化),Dependency(依赖关系)、Association(关联关系)、Aggregation(聚合关系)、Composition(组合关系)五种!2. Generalization(泛化)Generalization(泛化)表现为继承或实现关系(is a)。具体形式为类与类之间的继承关系
2012-12-24 13:18:28 606
原创 排序小结
public class SortAll {/** * 冒泡排序,选择排序,插入排序,希尔(Shell)排序 Java的实现 */ public static void main(String[] args) { int[] i = { 1, 5, 6, 12, 4, 9, 3, 23, 39, 403, 596, 87 }; System.out.
2012-12-24 13:11:30 408
原创 CCI习题 1-2:Reverse String
package question1_2;public class Question {public static String reverseString(String str){if(str.equals(null)){return null ;}StringBuffer sBuffer=new StringBuffer(str);String strResu
2012-12-24 11:14:48 547
转载 Java中equals和==的区别
java中的数据类型,可分为两类: 1.基本数据类型,也称原始数据类型。他们之间的比较,应用双等号(==),比较的是他们的值。 2.复合数据类型(类) 当他们用(==)进行比较的时候,比较的是他们在内存中的存放地址,所以,除非是同一个new出来的对象,他们的比较后的结果为true,否则比较后结果为false。 JAVA当中所有的类都是继承于Object这个基类的,在Ob
2012-12-21 16:52:56 429
原创 CCI习题1-1:String Contain Unique Char
package question1_1;/* * Implement an algorithm to determine if a string has all unique characters */public class Question {//位操作public static boolean isUniqueChars1(String str){if(s
2012-12-21 16:22:48 913
原创 移位运算符
移位运算符就是在二进制的基础上对数字进行平移。按照平移的方向和填充数字的规则分为三种:>(带符号右移)和>>>(无符号右移)。 在移位运算时,byte、short和char类型移位后的结果会变成int类型,对于byte、short、char和int进行移位时,规定实际移动的次数是移动次数和32的余数,也就是移位33次和移位1次得到的结果相同。移动long型的数值时,规定实际移动的次数是移动次
2012-12-21 15:29:54 1017
原创 按位与、按位或
(1)& 按位与: 1 & 1 = 1 1 & 0 = 0 3 & 1 → 11(二进制) &01 = 1(2)| 按位或0101 (expression1)1100 (expression2)----1101 (result)(3)按位与、按位或 和逻辑与、逻辑或是不同的运算。
2012-12-21 15:19:20 823
原创 高级Swing界面JTable编程
1.JTable与TableModel1.TableModel与JTable的关系:TableModel它是一个接口,javax.swing.JTable table=new javax.swing.JTable();table.setModel(new 实现了TableModel接口的类);2.TableModel实践: 首先,我们编写一个TableModel的实
2012-12-21 13:18:57 22446 2
原创 android in practice_create and start a service(portfolio project)
Main Application, Main Process, Main Service,Main Task,Main Activity vs Multiply Applications,Multiply Processes,Multiply Services,Multiply Tasks, Multiply ActivitiesThe way to fully implement multi
2012-12-14 14:52:35 439
原创 每日经文
约伯记5:7人生在世必遇患难,如同火星飞腾。5:8 至于我,我必仰望上帝,把我的事情托付他。8:20上帝必不丢弃完全人,也不扶助邪恶人。诗篇第一篇不从恶人的计谋,不站罪人的道路,不坐亵慢人的座位,唯喜爱耶和华的律法,昼夜思想,这人变为有福。他要像一棵树,载在溪水旁,按时候结果子,叶子也不枯干,凡他所做的尽都顺利。哥林多前书2:11上帝为爱他的人所预备的,
2012-12-12 10:18:34 3480 1
原创 Applying themes and styles(3)_Applying themes and styles
1.Applying and writing styles(example:)styles.xml14spbold#CCC@android:color/transparent5dipacitivity_main.xmlandroid:text="Hello, text view!"android:layout_width="w
2012-12-04 14:37:45 451
原创 android in practice_Managing a stateful list/Header and footer views
(1)ViewHolder pattern, which will make your list render significantly faster and hence scroll more smoothly.(2) Adapter, the views for our ListView are bound to the data source we’ll use a static
2012-12-04 11:47:27 790
struts2基础
2017-11-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人