- 博客(46)
- 资源 (1)
- 收藏
- 关注
原创 adb 相关命令
概览:1. 从手机截图。2. 从电脑拷贝文件到模拟器。3. 从模拟器拷贝文件到电脑。正文:1. 从手机截图。adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png2. 从电脑拷贝文件到模拟器。$ adb push 18.jpg /mnt/sdcard/DCIM/100A
2014-03-18 16:57:12
639
原创 从屏幕底部滑出Dialog
概览:1. 首先需要定义两个滑进滑出的动画。2. 定义Dialog的主题。3. 触发dialog。正文:1. 首先需要定义两个滑进滑出的动画。滑进的动画slide_in_up.xml<translate xmlns:android="http://schemas.android.com/apk/res/android" android:du
2014-03-18 15:51:02
1203
原创 apis.view 之Controls
概览:1. style改变标准控件的外观。正文:1. style改变标准控件的外观。让CheckBox 的框变成星。 <CheckBox android:id="@+id/star" style="?android:attr/starStyle" android:layout_width="wrap_co
2014-03-17 17:33:35
612
原创 系统版本
概览:1. 根据系统版本来确定是否启用Activity。正文:1. 根据系统版本来确定是否启用Activity。在activity 节点包含enable 属性 <activity android:name=".view.ContentBrowserActivity" android:label="Views/System
2014-03-17 15:01:57
518
原创 apis.view 之 Animation,AutoComplete,Baseline,Chronometer
ViewFlipper 在多个view 之间翻转,继承自ViewAnimator。 <ViewFlipper android:id="@+id/flipper" android:layout_width="match_parent" android:layout_height="wrap_content" android:flipInt
2014-03-17 10:35:18
592
转载 9-patch for Android UI
A simple guide to 9-patch for Android UIWhile I was working on my first Android app, I found 9-patch (aka 9.png) to be confusing and poorly documented. After a little while, I finally picked up
2014-02-13 15:18:57
897
转载 A Visual Git Reference
A Visual Git ReferenceOther Languages: Deutsch Español Français Italiano 日本語 한국어 Русский Slovenčina Tiếng Việt 简体中文If the images do not work, you can try the Non-SVG version of this page
2014-01-03 13:53:01
740
转载 二叉树的层次遍历(广度优先遍历)
二叉树的层次遍历(广度优先遍历)import java.util.*; public class BinaryTree { protected Node root; public BinaryTree(Node root) { this.root = root; } public Node g
2013-12-22 19:53:50
602
原创 Android-View-Animation 编辑框抖动shake
截图如下:1. Activity 很简单,如下:package com.example.viewanimationshake;import android.os.Bundle;import android.app.Activity;import android.view.View;import android.view.animation.Animation;
2013-12-13 16:04:04
3204
原创 用 javac 编译一个目录下的所有 java文件并打包成jar 包
# Linux$ find -name "*.java" > sources.txt$ javac @sources.txt或者find . -name "*.java" -print | xargs javac
2013-12-10 10:15:37
2356
转载 android--scrollview 高度的含义
v.getScrollY() 表示当前滚动到的y位置v.getHeight() scrollview窗口的高度v.getScrollY()+v.getHeight() 这个和表示已经展示给用户的内容的高度view.getMeasuredHeight() 表示实际内容(scrollview里的子只有一个,里面放的是实际的内容)总高度。整个滚动的过程,就好像拿着一个高度为v.g
2013-11-23 16:16:56
2081
转载 Android异步消息处理机制完全解析,带你从源码的角度彻底理解
转载请注明出处:http://blog.youkuaiyun.com/guolin_blog/article/details/9991569之前也是由于周末通宵看TI3比赛,一直没找到时间写博客,导致已经有好久没更新了。惭愧!后面还会恢复进度,尽量保证每周都写吧。这里也是先恭喜一下来自瑞典的Alliance战队夺得了TI3的冠军,希望明年中国战队能够虎起!开始进入正题,我们都知道,Andr
2013-11-23 11:55:19
592
转载 Android Service完全解析,关于服务你所需知道的一切(上)
转载请注明出处:http://blog.youkuaiyun.com/guolin_blog/article/details/11952435相信大多数朋友对Service这个名词都不会陌生,没错,一个老练的Android程序员如果连Service都没听说过的话,那确实也太逊了。Service作为Android四大组件之一,在每一个应用程序中都扮演着非常重要的角色。它主要用于在后台处理一些耗时的逻辑,
2013-11-23 11:15:59
608
转载 Android事件分发机制完全解析,带你从源码的角度彻底理解(上)
转载请注明出处:http://blog.youkuaiyun.com/guolin_blog/article/details/9097463其实我一直准备写一篇关于Android事件分发机制的文章,从我的第一篇博客开始,就零零散散在好多地方使用到了Android事件分发的知识。也有好多朋友问过我各种问题,比如:onTouch和onTouchEvent有什么区别,又该如何使用?为什么给ListVie
2013-11-23 10:40:26
685
原创 android--Touch Events 你应该记住的一些事
The onInterceptTouchEvent() method is called whenever a touch event is detected on the surface of a ViewGroup, including on the surface of its children. If onInterceptTouchEvent() returns true,
2013-11-22 21:55:29
642
原创 android--View 你应该记住的一些事
[1].A View occupies a rectangular area on the screen and is responsible for drawing and event handling. View is the base class for widgets, which are used to create interactive UI components (butt
2013-11-22 21:28:58
916
原创 android--Content Provider 你应该记住的一些事-1
[1].Content providers are the standard interface that connects data in one process with code running in another process.========== ========== ========== ========== ========== ==========
2013-11-21 16:40:10
832
转载 23种设计模式(超级简洁)
-By Jason McDonald原文地址:http://www.cnblogs.com/grkin/archive/2013/03/17/2964964.html关于设计模式 这个设计模式参考提供四人帮23种模式的快速参考,像原书《设计模式-可复用面向对象基础》中所陈述的,每个模式包括,类图,解释,使用说明和实际例子。 创建模式:用来构建对象以便能从实现系统解
2013-11-20 20:57:40
876
转载 UML类图关系大全
原文地址:http://www.cnblogs.com/riky/archive/2007/04/07/704298.html1、关联双向关联:C1-C2:指双方都知道对方的存在,都可以调用对方的公共属性和方法。在GOF的设计模式书上是这样描述的:虽然在分析阶段这种关系是适用的,但我们觉得它对于描述设计模式内的类关系来说显得太抽象了,因为在设计阶段关联关系必
2013-11-20 20:30:36
787
原创 android--Process and Thread 你应该记住的一些事
[1].If an application component starts and there already exists a process for that application (because another component from the application exists), then the component is started within that proc
2013-11-19 20:59:18
1323
原创 android--BitMap 你应该记住的一些事-1
[1].Mobile devices typically have constrained system resources. Android devices can have as little as 16MB of memory available to a single application.=============================================
2013-11-19 11:26:39
806
原创 android--service 你应该记住的一些事-2
[1].However, if you want the service to send a result back, then the client that starts the service can create a PendingIntent for a broadcast (with getBroadcast()) and deliver it to the service
2013-11-18 23:17:17
906
原创 android--service 你应该记住的一些事-1
Caution: A service runs in the main thread of its hosting process—the service does not create its own thread and does not run in a separate process (unless you specify otherwise). This means tha
2013-11-18 22:34:37
1086
转载 java 中的引用类型
Reference Types In Java Lately, I have been learning a thing or two about the JVM internals. And one of the most interesting things that I came to know about was, the existence of different types
2013-11-15 23:04:24
846
原创 继承-java-箴言
1. A subclass inherits all the members (fields, methods, and nested classes) from its superclass. Constructors are not members, so they are not inherited by subclasses, but the constructor of the su
2013-11-15 22:23:17
833
原创 得到今天00:00 的纪元毫秒数
工具方法:public static long getMilliSeconds(int year, int month, int date) { final Calendar cal = Calendar.getInstance(); cal.set(year, month, date, 0, 0, 0); cal.set(Calendar.MILLISECOND, 0
2013-11-15 17:54:14
1106
转载 Java开发中的23种设计模式详解
设计模式(Design Patterns) ——可复用面向对象软件的基础设计模式(Design pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性。 毫无疑问,设计模式于己于他人于系统都是多赢的,设计模式使代码编
2013-11-15 09:35:01
1005
原创 linux 命令
kill监听端口的进程$ lsof -i:8080COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEjava 2872 sampythoner 50u IPv6 0xb294a7dec76f599f 0t0 TCP *:http-alt (LISTEN)$ kill -
2013-11-13 16:12:40
835
原创 组合模式(Composite)-结构型模式
我们在开发过程中经常使用到树形结构,它分为叶子节点和和分支节点两种,客户对象在使用这两种对象时候经常要对它们加以区别,增加了代码的复杂度,也非常容易出错。组合模式为这两种类型提供了统一的接口,可以让我们像操作叶子节点那样方便地操作分支节点。 =======================================================================
2013-11-10 13:39:01
616
原创 Activity Notes
If either the MAIN action or LAUNCHER category are not declared for one of your activities, then your app icon will not appear in the Home screen's list of apps. // Make sure we're runn
2013-11-09 17:21:00
574
原创 Activity 的几个回调函数的用法
If either the MAIN action or LAUNCHER category are not declared for one of your activities, then your app icon will not appear in the Home screen's list of apps. // Make sure we're
2013-11-09 16:44:45
2357
原创 android自定义View
先看一个图:相关的类:View //android中所有的可视组件都继承自View,View定义了很多callbacks来定义它的行为,如onDraw(),onMeasure()等。ViewParent (interface) //ViewParent为所有想扮演其他views的父亲的类定义了协议。ViewGroup (extends View and implem
2013-11-08 09:41:39
732
原创 Sample Apps by Android Team 下载
git clone https://code.google.com/p/apps-for-android/阅读源码,从现在开始!
2013-11-06 22:33:35
459
原创 mongoDB 技巧
1.以"_id" 为索引,类型为String,因排序时需要,所以存储"0001","0002","0100"。重载setId()方法。public void setId(String id) { this.id = id;}public void setId(int id){ this.id = String.format("%04d", id);}
2013-11-06 12:50:28
425
原创 jsf 常用标签
1.删除一个对象的Button。h:commandButtonvalue="删除厨房"onclick="return confirm('确定删除?')"action="#{kitchenController.delete()}"class="delete_kitchen"> f:setPropertyActionListenertarget="#{ki
2013-11-05 15:13:24
782
原创 计算机珠玑
递归的目的是简化程序设计,使程序易读。但递归增加了系统开销。 时间上,执行调用与返回的额外工作要占用CPU时间。空间上,随着每递归一次,栈内存就多占用一截。相应的非递归函数虽然效率高,但却比较难编程,而且相对来说可读性差。现代程序设计的目标主要是可读性好。随着计算机硬件性能的不断提高,程序在更多的场合优先考虑可读而不是高效,所以,鼓励用递归函数实现程序思想。 ==》所以在数组小于10的情况下,插
2013-10-29 10:09:15
499
原创 git创建分支,提交分支,删除分支的开发流程
1.git branch // 在本地创建了新分支,此分支是基于你现在所在的分支之上的。 ************* ************* ************* *************\|/ ************* ************* ************* *************2.git checkout // 切换到你新创建的分支
2013-10-23 19:52:26
1102
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人