摘要: Code can control the LED notification in Android device, using android.app.Notification: ledARGB: The color of the led. The hardware will do its best 阅读全文
posted @ 2016-03-17 19:29 Mosthink 阅读(253) 评论(0) 推荐(0) 编辑
摘要: You don’t need to set a big size image as the background of pages if the image is texture or uniform color. How to tile small texture image onto big p 阅读全文
posted @ 2016-03-17 19:28 Mosthink 阅读(118) 评论(0) 推荐(0) 编辑
摘要: The design of SimpleAdapter is not good in my opinion. An adapter should just adapter the data to view, not care to inflate xml to create Layout View, 阅读全文
posted @ 2016-03-17 19:26 Mosthink 阅读(120) 评论(0) 推荐(0) 编辑
摘要: In my case, I want to write a TextView with an animation in its left side. ImageView + TextView could work but it’s not frugal enough. TextView with d 阅读全文
posted @ 2016-03-17 19:26 Mosthink 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Generally, I use a selector to select pictures or colors to render the normal and the pressed background for View. And use a Shape to draw a fixed bac 阅读全文
posted @ 2016-03-17 19:25 Mosthink 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Here is this topic’s background: I defined a custom View which extends FrameLayout and contains a TextView, calledMyView here. And I defined custom at 阅读全文
posted @ 2016-03-17 19:24 Mosthink 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Eclipse 【ADT】 源 https://dl-ssl.google.com/android/eclipse Notice that no matter what scenario causes the activity to stop, the system always calls onP 阅读全文
posted @ 2016-03-17 19:16 Mosthink 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 定义描述类名或者方法名的注解:ClassOrMethodFullName.java 【写一个js方法】 function + 方法名 + 括号 + 代码块 【调用这个js方法得加括号】 【带参数的函数,参数是不需要声明类型部分的】 【带返回值的函数,很好理解】 返回值是可选的,means,你想在哪个 阅读全文
posted @ 2016-03-17 19:13 Mosthink 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 单例模式的并发问题和延迟加载 非并发的单例模式: 多线程下,上面的instance == null 与 instance = new Singleton()的操作不是原子的,所以会导致instance == null的判断不正确,从而导致出现多个实例; synchronized能保证上述的原子性: 阅读全文
posted @ 2016-03-17 19:10 Mosthink 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 某个线程获得对象的锁之后,只能阻止其他线程获得同一个锁,并不能阻止其他线程通过另外的锁来访问对象的变量 每个可变或共享的变量都该由同一个锁来保护; 简单粗暴的全部synchronized会使得并发程序变成串行程序,影响性能,多核CPU会有空载运行,应该缩小同步块的大小,将不影响共享状态并且执行时间较 阅读全文
posted @ 2016-03-17 19:09 Mosthink 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 发送一个子类对象给声明了其父类类型的方法,是没问题的; 但是发送一个子类对象List给声明了其父类类型List的方法,是不行的; 这个时候,有限通配符就可以派上用场,在接受方法的声明中:List<? extends E> o; 阅读全文
posted @ 2016-03-17 19:08 Mosthink 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 类加载器阶段的“通过一个类的全限定名来获取描述此类的二进制字节流”这个动作被放到了Java虚拟机外部去实现,以便让应用程序自己定义如何获取所需要的类,即,可在自己的代码中实现一个java.lang.ClassLoader类作为自定义的类加载器; 不同的类加载器加载上来的类并不相等,即使是来源于同一个 阅读全文
posted @ 2016-03-17 19:07 Mosthink 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 代码在github:https://github.com/Viyu/PushNewsmth2Mail 当年买Kindle的时候,想再Kindle上阅读水木的帖子,但Kindle的Web上网体验太差,想着把文章推送到Kindles上看,就写了这个项目。 基本流程就是: JavaFx的WebEngine 阅读全文
posted @ 2016-03-17 19:05 Mosthink 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 代码在github: https://github.com/Viyu/DoubleFacedCamera 这个app的想法是:用手机的前置和后置摄像头同时拍摄画面合成输出一张图,把拍摄者和被拍摄者的画面同时保存。 完成进度:可以以固定位置的方式,将前置照片合到后置照片上,两张照片“几乎”是同时拍摄的 阅读全文
posted @ 2016-03-17 19:04 Mosthink 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 代码在github: https://github.com/Viyu/BluetoothChat 蓝牙聊天核心是Android Demo里的,我加上了类似微信的界面。 我觉得这个应用要是能推广的话,有点市场,它的应用场景在于: 1, 聊天不需要流量,在没有网络、断网的情况下,两个人聊天,这个软件就派 阅读全文
posted @ 2016-03-17 19:02 Mosthink 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 代码在github: https://github.com/Viyu/ANotepad 这是我学习安卓做的第一个应用。 一个简单的记事本,界面简洁,黑板粉笔风格。 主要功能有:1、可以保存记事;2、可根据记事类别选择不同的字体颜色,目前支持三种;3、可对记事设置提醒闹钟,在系统的提醒栏进行提醒;4、 阅读全文
posted @ 2016-03-17 19:01 Mosthink 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 代码在github: https://github.com/Viyu/LianLianKan 朴素大气的连连看游戏,简约而不简单,黑白色调,高端大气上档次,省时省力省眼睛。内容至上,界面朴素简洁,用词言简意赅,功能完整,操作简单,体验良好,休闲娱乐,老少皆宜。应用的主要功能有:1、连连看难度选择:有 阅读全文
posted @ 2016-03-17 19:00 Mosthink 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 代码在github: https://github.com/Viyu/TransformersPuzzle 这是一款拼图游戏,Transformers的主题。 这个游戏一共包含18个级别,1-6级的是3x3的难度,7-12级的是4x4的难度,13-18级的是5x5的难度。 你可以打开声音或振动提示, 阅读全文
posted @ 2016-03-17 18:58 Mosthink 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 【选择排序】 a[i++] —> a[n],从前往后看、选择最小值、一次交换到位 1,完整循环找到数组中最小的元素; 2,把这个最小的元素与a[0]交换; 3,在a[i]-an的子数组中重复1-2步骤; 简写: 特点: 选择排序的扫描路线:a[i++] —> a[n] 选择排序是在每个大循环下,通过 阅读全文
posted @ 2016-03-17 18:54 Mosthink 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 局部变量表(虚拟机栈中的一部分)在编译期完成分配,运行期不会再改变大小; 每个方法对应一个栈帧(存储局部变量表、操作数栈、动态链接、方法出口等),栈帧被存储到虚拟机栈中,每个线程对应一个虚拟机栈,方法结束,栈帧生命周期结束,线程结束,虚拟机栈生命周期结束; 如果线程请求的虚拟机栈深度大于虚拟机所允许 阅读全文
posted @ 2016-03-17 18:53 Mosthink 阅读(235) 评论(0) 推荐(0) 编辑