Blogroll
Categories
Archives
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
Category Archives: 编程开发
#agile#敏捷修炼之道
下面一句话是对敏捷的精辟概况。 敏捷开发就是在一个高度协作的环境中,不断的使用反馈进行自我调整和完整。 首先,它要整个团队一起努力。敏捷团队往往是一个小型团队,或者是大团队分成若干小团队(10人左右)。团队所有成员都在一起工作,如果可能,最好有独立的工作空间,一起共享代码和必要的开发任务,而且大部分时间都在一起工作。同时和客户或者软件的用户紧密工作在一起,并且尽可能频繁地给他们演示最新的系统。 你要不断从自己写的代码中得到反馈,并且使用自动化工具不断的构建(持续集成)和测试系统。在前进的过程中,你都会有意识地修改一些代码:在功能不变的情况下,重新设计部分代码,改善代码的质量。这就是所谓的Refactor,它是软件开发中不可或缺的一部分–编码永远没有真正意义的上的“结束”。 要以迭代的方式进行工作:确定一小块时间(一周左右)的计划,然后按时完成它们。给客户演示每个迭代的工作成果,及时得到它们的反馈(这样可保证方向正确),并且根据实际情况尽可能频繁的发布新系统版本让用户使用。
#Agile#敏捷开发宣言
我们正通过亲身实践和帮助他人实践,揭示了一些更好的软件开发方法,通过这项工作我们认为: 个体和交互胜过过程和工具。 可工作的软件胜过面面俱到的文档。 客户协作胜过合同谈判。 响应变化胜过遵循计划。 虽然右项也有价值,但我们认为左项具有更大的价值。 更多详细信息可以访问agilemanifesto.org
Eclipse的HTML/JSP/XML/CSS/DTD/JavaScript的插件
我习惯偏好于Eclipse的最精简版–Eclipse IDE for Java Developers,它本省只带了很少的插件,当用到某些新技术的时候,我再去安装相关的插件,选择插件的首选原则也是实用、简洁。其实Eclipse有很多非常优秀的Plug-ins. 如,tomcat-plugin、Easyexplore、Eclipse HTML Editor等。 其中Eclipse HTML Editor就是一个优秀的Plug-in。 Eclipse HTML Editor is an Eclipse plugin for HTML/JSP/XML Editing. It works on Eclipse 3.0 (or higher), JDT and GEF. It has following features. HTML/JSP/XML/CSS/DTD/JavaScript语法高亮 HTML/JSP预览 JSP/XML验证 内容提示 (HTML标签/属性, … Continue reading
[android]设置Spinner弹出框/下拉框的样式
Spinner drop-down list 默认的样式比较丑陋的,默认效果图见上一篇文章Android Spinner例子。 所以我们要自定义dropdown list的样式,下拉框的样式不能直接在Spinner标签里定义的,但也非常简单。 如下所以: 1. Define layout XML 在res/layout/下新建一个XML文件-drop_down_item.xml ?View Code XML<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:textColor="#000000" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="12dip"> </TextView> 此layout XML是作用于下拉列表中一项的样式。 2. setDropDownViewResource ?View Code JAVAArrayAdapter<String> accountTypesAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, array_type); accountTypesAdapter.setDropDownViewResource(R.layout.account_type_drop_down_item); spinner.setAdapter(accountTypesAdapter); … Continue reading
Android的沙箱模式
一旦安装到设备上,每个Android应用都存活在各自的安全沙箱中: Android OS是多用户的Linux系统,每个应用都被分配给不同用户。 默认情况下,系统给每个应用分配唯一的Linux user ID(User ID只给系统使用,应用本身是不知道的)。系统为每一个应用下所有的文件都设置正确的权限,只有属于该应用的user ID才能访问它们。 每个进程都拥有专属的虚拟机,所以应用代码的运行跟另外的应用都是独立开来的。 默认下,每个应用都运行在自己专属的Linux进程。当一个应用中的任何一个组件要执行的时,Android会先为它启动进程;当应用不用的时或者必须要为其他应用腾出内存时,Android会关闭该进程。
Android Spinner例子
在Android中, Spinner组件就是下拉列表. 弹出一个选项列表,允许你从列表中选择一项。 布局的XML文件如下 ?View Code XML<Spinner android:id="@+id/Spinner01" android:layout_width="wrap_content" android:layout_height="wrap_content" /> Activity ?View Code JAVA1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 public class SpinnerExample extends Activity { private String … Continue reading
Posted in android, 编程开发
2 Comments
android自动关闭(隐藏)提示框(对话框)
正在做一个小项目,实现修改密码的功能,当输入的旧密码不正确时,弹出一个提示然后自动消失。 代码如下: ?View Code JAVAif (!settingInfo.getString(KEY_PWD, "132465").equals(oldPwd)) { Toast.makeText(getApplicationContext(), "Old password is wrong", Toast.LENGTH_SHORT).show(); return; } A toast notification is a message that pops up on the surface of the window. It only fills the amount of space required for … Continue reading
Android的LayoutInflater
LayoutInflater是用来把XML布局文件转换成Android的View对象。它从来不是直接实例化出来的,取而代之的是使用getLayoutInflater() or getSystemService(String)获取跟当前context绑定一起的LayoutInflater实例,这个实例跟当前运行的设备也正确的配置一起。 得到LayoutInflater实例的三个方法: LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater inflater = ((Activity) this).getLayoutInflater(); LayoutInflater inflater = LayoutInflater.from(getApplicationContext()) 生成View对象 View contentView = LayoutInflater.from(getApplicationContext()).inflate(R.layout.add_account, null);
Android实现底部菜单栏和顶部菜单栏
Android App的需求:同时显示顶部菜单栏和底部菜单栏,要一直显示在屏幕上,中间是一个可滚动的动态列表。 下面是实现的简单代码 main.xml包含top menu, bottom menu以及动态列表的占位符。 Main.xml <?xml version=“1.0″ encoding=“utf-8″?><LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”android:orientation=“vertical”android:layout_width=“fill_parent”android:layout_height=“fill_parent” > <!– top menu –> <LinearLayoutandroid:id=“@+id/top_menu” android:layout_width=“fill_parent” android:layout_height=“wrap_content” > <TextView android:id=“@+id/top” android:layout_width=“fill_parent” android:layout_height=“40px” android:background=“@drawable/red” android:text=“top static view” /> </LinearLayout> <!– placeholder for list –> <ListView android:id=“@android:id/list” android:layout_width=“fill_parent” android:layout_height=“wrap_content” android:layout_weight=“1″ /> <!– bottom menu –> <LinearLayout android:id=“@+id/bottom_meunun” android:layout_width=“fill_parent” android:layout_height=“wrap_content” > <TextView android:id=“@+id/bottom” android:layout_width=“fill_parent” … Continue reading
Android开发入门之如何使用ListView
ListView是Android经常用到的控件,它用来展示可以滚动的列表。ListView里的列表项是通过adapter来添加的,adapter必须是继承“BaseAdapter”,它的职责是提供数据模型,以及把数据转换成列表项。 Android自带ArrayAdapter、SimpleAdapter和CursorAdapter ArrayAdapter处理数组或者列表里的数据,通常列表项只有一个文本。 CursorAdapter主要针对数据使用。 SimpleAdapter处理列表里的数据,不同于ArrayAdapter,SimpleAdapter每一个列表项由一个Map对象提供数据。 SimpleAdapter实现ListView的步骤: 1. 定义列表项的layout 2. 准备ListView要显示的数据 ; 3. 把数据添加到数组里; 4. 构建适配器 , 数据适配器 , 动态数组有多少元素就生成多少个列表项; 5. 把适配器 添加到ListView,并显示出来。 1.定义列表项的layout,某一项的layout,并不是整个List的layout。 ?View Code XML<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal"> <TextView android:text="TextView" android:id="@+id/accountType" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="10pt" android:background="#FFFFFF" android:width="30pt"></TextView> <TextView android:text="TextView" … Continue reading
