随笔分类 -  Tutorial

摘要:Date Picker 日期选择控件,允许你选择月,日,年。 在本教程中,将创建DatePickerDialog 对话框。TextView将更新显示选中的日期。 新建项目 HelloDatePicker。 打开res/layout/main.xml文件修改代码如下: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orienta 阅读全文
posted @ 2011-03-25 16:24 敏捷学院 阅读(314) 评论(0) 推荐(0)
摘要:TabLayout 选项卡布局 创建一个Tab用户界面,你需要使用一个TabHost和TabWidget。这个TabHost必须在根节点布置,包含了TabWidget显示制表符和FrameLayout标签显示的内容。 新建项目 HelloTabWidget。 首先在项目中创建3个Activity类:ArtistsActivity,AlbumsActivity和SongsActivity,使用TextView显示一条简单的信息。 package com.helloview.layout; import android.app.Activity; import android.os.Bundle; 阅读全文
posted @ 2011-03-25 16:19 敏捷学院 阅读(262) 评论(0) 推荐(0)
摘要:TabLayout 选项卡布局 创建一个Tab用户界面,你需要使用一个TabHost和TabWidget。这个TabHost必须在根节点布置,包含了TabWidget显示制表符和FrameLayout标签显示的内容。 新建项目 HelloTabWidget。 首先在项目中创建3个Activity类:ArtistsActivity,AlbumsActivity和SongsActivity,使用TextView显示一条简单的信息。 package com.helloview.layout; import android.app.Activity; import android.os.Bundle; 阅读全文
posted @ 2011-03-25 16:17 敏捷学院 阅读(490) 评论(0) 推荐(0)
摘要:GridView Layhout GridView是一个ViewGroup子试图。用于二维、滚动网格。GridView自动添加了一个ListAdapter布局 新建项目HelloGridView 将一些图片放到res/drawable/目录 打开res/layout/main.xml文件,按一下修改。 <?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android" a 阅读全文
posted @ 2011-03-25 16:16 敏捷学院 阅读(296) 评论(0) 推荐(0)
摘要:表格布局 Table Layout TableLayout是一个ViewGroup子视图显示元素的行和列 创建新项目HelloTableLayout。 打开 res/layout/main.xml文件如下编辑 <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" 阅读全文
posted @ 2011-03-25 16:15 敏捷学院 阅读(245) 评论(0) 推荐(0)
摘要:相对布局 Relative Layout RelativeLayout是一个ViewGroup子视图显示元素相对位置 视图的位置可以指定为相对于同级元素 (例如,向左的或给定元素的下面),或在位置相对于 RelativeLayout 领域 (例如,对齐左下中心)。 一个RelativeLayout是一个非常强大的工具,用来设计的用户界面,因为它能消除嵌套的ViewGroups。如果你发现自己用几套LinearLayout组,你就可以用单一的RelativeLayout取代它们。 新建项目HelloRelativeLayout。 打开res/layout/main.xml文件,如下修改 < 阅读全文
posted @ 2011-03-25 16:14 敏捷学院 阅读(218) 评论(0) 推荐(0)
摘要:Linear Layout 新建项目HelloLinearLayout。 打开 res/layout/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_pare 阅读全文
posted @ 2011-03-25 16:10 敏捷学院 阅读(222) 评论(0) 推荐(0)
摘要:Hello,View 本演练以在完成Hello World演练基础上进行。可以让你快速的了解Android布局和小部件。 布局 Layout Linear LayoutRelative LayoutTable LayoutGrid ViewTab LayoutList View Widgets & Other Views Date PickerTime PickerForm StuffSpinnerAuto CompleteGalleryGoogle Map ViewWeb View 阅读全文
posted @ 2011-03-25 16:06 敏捷学院 阅读(248) 评论(0) 推荐(0)
摘要:Android 应用程序组成 4个部分组成 Activity Broadcast Intent Receiver Service Content Provider 在AndroidManifest.xml 中声明和描述需要用到的组件。 Activity 介绍 Activity代表手机的一个屏幕,可以在Activity中添加Button, CheckBox等View。Activity之间可以传递值。 Intent 和 Intent Filters 一个Intent 就是对将要执行的操作的抽象描述。通过Intent可以在多个Activity之间进行跳转。Intent两个最重要的部分是Intent. 阅读全文
posted @ 2011-03-25 16:03 敏捷学院 阅读(362) 评论(0) 推荐(0)
摘要:本演练演示,输出Hello,World字符串到Android系统屏幕。 搭建Android开发环境 是本演练的前提条件 依照惯例我们将创建Hello,World。程序。 开发平台的安装 参见:搭建Android开发环境 创建AVD(Android Virtual Device) To create an AVD: 1.In Eclipse, choose Window > Android SDK and AVD Manager. 2.Select Virtual Devices in the left panel. 3.Click New. The Create New AVD dial 阅读全文
posted @ 2011-03-25 16:00 敏捷学院 阅读(289) 评论(0) 推荐(0)
摘要:推荐使用 Android SDK 2.2 Eclipse IDE + ADT Android软件开发包 JDK1.6 以上 http://java.sun.com/javase/downloads Eclipse 3.4 以上 http://www.eclipse.org/downloads For Java developer Android SDK 2.0 http://developer.android.com ADT plugin Windows 开发环境搭建 1. 下载jdk安装包或解压缩包 2. 下载Android SDK开发包,解压到任意目录。将SDK的tools路径添加到PA. 阅读全文
posted @ 2011-03-25 15:38 敏捷学院 阅读(298) 评论(0) 推荐(0)
摘要:Google 于2007年11月 宣布组建 "开放手机联盟",联盟将支持Android开放源代码的移动操作系统。 官方网站: http://www.Android.com 此处略去238个字….. ^_^ 阅读全文
posted @ 2011-03-25 15:33 敏捷学院 阅读(251) 评论(0) 推荐(0)
摘要:为实体类Product添加验证消息[Table(Name="Products")]public class Product : IDataErrorInfo{[Column(IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]public int ProductID { get; set; }[Column]public string Name { get; set; }[Column]public string Description { get; set; }[Column]p 阅读全文
posted @ 2011-03-24 21:10 敏捷学院 阅读(469) 评论(2) 推荐(0)
摘要:定义一个订单提供 IoC 组件在DomainModel项目中新建文件夹Services添加以下接口:namespace DomainModel.Services{public interface IOrderSubmitter{void SubmitOrder(Cart cart);}}修改CartController添加IOrderSubmitter接口。private IOrderSubmitter orderSubmitter;public CartController(IProductsRepository productsRepository, IOrderSubmitter ord 阅读全文
posted @ 2011-03-24 21:03 敏捷学院 阅读(524) 评论(0) 推荐(0)
摘要:创建一个自定义的Model绑定在WebUI根目录添加 CartModelBinder类public class CartModelBinder : IModelBinder{private const string cartSessionKey = "_cart";public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext){if (bindingContext.Model != null)throw new InvalidOperationE 阅读全文
posted @ 2011-03-24 20:48 敏捷学院 阅读(941) 评论(0) 推荐(0)
摘要:样式(Style)以下是我们将要创建的网页布层:Sports Store (Header)主页分类1分类2分类 3产品1产品2产品3设计Master Page略创建 Partial View (视图控件)右键单击 Views/Shared 打开添加 View对话框。ViewName为 ProductSummary选中Create a partial view。编辑如下代码:<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DomainModel.Entities.Pro 阅读全文
posted @ 2011-03-24 19:14 敏捷学院 阅读(785) 评论(0) 推荐(0)
摘要:测试驱动开发(TDD)下载工具http://www.nunit.orghttp://code.google.com/p/moq为Tests项目添加如下引用:nunit.FrameworkSystem.WebSystem.Web.AbstractionsSystem.Web.RoutingSystem.Web.MvcMoq.DllDomainModelWebUI为Tests创建类[TestFixture]public class ProductsControllerTests{[Test]public void List_Presents_Correct_Page_Of_Products(){I 阅读全文
posted @ 2011-03-24 18:46 敏捷学院 阅读(507) 评论(0) 推荐(0)
摘要:连接数据库创建SportStore数据库。创建表 Products添加一些演示数据:设置Linq to SQL注意:需要引用 System.Data.Linq。[Table(Name="Products")]public class Product{[Column(IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]public int ProductID { get; set; }[Column]public string Name { get; set; }[Column]pu 阅读全文
posted @ 2011-03-24 18:42 敏捷学院 阅读(735) 评论(0) 推荐(0)
摘要:Download!!!介绍使用一下技术创建简单的购物网演练。 ASP.NET MVC Framework Castle-Windsor-2.0 NUnit 创建项目创建空的解决方案 SportStore ,向解决方案添加: 项目名称项目类型DomainModelC# class libraryWebUIASP.NET MVC2 Web Application不包含 Unit TestTestsC# class library单元测试 删除WebUI自动生成的文件: 目录文件Controllers*Views/Account*Views/Home* (保留index)Views/SharedEr 阅读全文
posted @ 2011-03-24 18:34 敏捷学院 阅读(996) 评论(0) 推荐(0)