2011年1月19日

android组件通讯 Intent-Category属性

摘要: 程序文件/Chapter06_Intent_Category/src/com/amaker/test/MainActivity.java代码布局文件/Chapter06_Intent_Category/res/layout/main.xml代码 阅读全文

posted @ 2011-01-19 23:48 linzheng 阅读(1004) 评论(0) 推荐(0) 编辑

android组件通讯 Intent-Action属性

摘要: Action属性应用实例1、自定义Action属性程序文件/Chapter06_Intent_TestAction/src/com/amaker/ch06/app/MainActivity.java代码/Chapter06_Intent_TestAction/src/com/amaker/ch06/app/MyActivity.java代码布局文件/Chapter06_Intent_TestAction/res/layout/main.xml代码/Chapter06_Intent_TestAction/res/layout/my_layout.xml代码清单文件/Chapter06_Inten 阅读全文

posted @ 2011-01-19 23:42 linzheng 阅读(1396) 评论(0) 推荐(0) 编辑

android组件通讯 Intent-ComponnentName属性

摘要: ComponnentName属性应用实例/Chapter06_Intent_ComponentName/src/com/amaker/ch06/app/MainActivity.java代码/Chapter06_Intent_ComponentName/src/com/amaker/ch06/app1/MyActivity.java代码/Chapter06_Intent_ComponentName/res/layout/main.xml代码/Chapter06_Intent_ComponentName/res/layout/my_layout.xml代码 阅读全文

posted @ 2011-01-19 23:34 linzheng 阅读(2077) 评论(0) 推荐(0) 编辑

Android组件的通讯-Intent

摘要: 1、概述一个应用程序的三个核心组件——activities、services、broadcast receivers,都是通过叫做intents的消息激活。Intent消息是一种同一或不同应用程序中的组件之间延迟运行时绑定的机制。intent本身(是一个Intent对象),是一个被动的数据结构保存一个将要执行的操作的抽象描述,或在广播的情况下,通常是某事已经发生且正在宣告。对于这三种组件,有独立的传送intent的机制:Activity:一个intent对象传递给Context.startActivity()或Activity.startActivityForRestult()去启动一个活动或 阅读全文

posted @ 2011-01-19 23:33 linzheng 阅读(1705) 评论(0) 推荐(0) 编辑

android基本程序单元Activity

摘要: 一、Activity 简介在android开发中Activity非常重要,在一个应用中,每一个显示的屏幕都是一个Activity.所以学习android,必须要对Activity有一定的了解. activity类处于android.app包中,继承体系如下: 1.java.lang.Object 2.android.content.Context 3.android.app.ApplicationContext 4.android.app.Activity activity是单独的,用于处理用户操作。几乎所有的activity都要和用户打交道,所以activity类创建了一个窗口,开发 阅读全文

posted @ 2011-01-19 22:23 linzheng 阅读(1688) 评论(0) 推荐(2) 编辑

android用户界面-组件Widget-网络视图WebView

摘要: 一个WebView的简单例子 。 在开发过程中应该注意几点: 1.AndroidManifest.xml中必须使用许可"android.permission.INTERNET",否则会出Web page not available错误。 2.如果访问的页面中有Javascript,则webview必须设置支持Javascript。 webview.getSettings().setJavaScriptEnabled(true); 3.如果页面中链接,如果希望点击链接继续在当前browser中响应,而不是新开Android的系统browser中响应该链接,必须覆盖 webview的WebVi 阅读全文

posted @ 2011-01-19 00:25 linzheng 阅读(4744) 评论(1) 推荐(1) 编辑

android用户界面-组件Widget-地图视图MapView

摘要: 一、在Google地图上显示本地的位置。1、首先注意在AndroidManifest.xml文件中,增加权限:uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/uses-permission在application中activity外,增加:uses-libraryuses-library android:name="com.google.android.maps" / 2、在类中,将extends Activity改为extends MapActivity3、设置可放大缩小地图的控件。在x 阅读全文

posted @ 2011-01-19 00:20 linzheng 阅读(2323) 评论(0) 推荐(0) 编辑

android用户界面-组件Widget-画廊视图Gallery

摘要: Android的Gallery控件是个很不错的看图控件,大大减轻了开发者对于看图功能的开发,而且效果也比较美观。/Chapter04_UI_Gallery01/src/com/amaker/test/MainActivity.java代码/Chapter04_UI_Gallery01/res/layout/main.xml代码 阅读全文

posted @ 2011-01-19 00:17 linzheng 阅读(1622) 评论(0) 推荐(0) 编辑

android用户界面-组件Widget-网格视图GridView

摘要: GridView按照行列的方式来显示内容。一般适合显示图标。图片等内容,主要用于设置Adapter。通过基础类BaseAdapter类,重写getView()方法来设置图片显示格式。/Chapter04_UI_GridView01/src/com/amaker/test/MainActivity.java代码 阅读全文

posted @ 2011-01-19 00:06 linzheng 阅读(4727) 评论(0) 推荐(0) 编辑

android用户界面-组件Widget-列表视图ListView

摘要: ListView是比较常用的控件程序效果是实现一个ListView,ListView里面有标题,内容和图片,并加入点击和长按响应。列表的显示需要三个元素:1.ListVeiw 用来展示列表的View。2.适配器用来把数据映射到ListView上的中介。3.数据具体的将被映射的字符串,图片,或者基本组件。根据列表的适配器类型,列表分为三种,ArrayAdapter,SimpleAdapter和SimpleCursorAdapterSimpleAdapter的例子如下:首先在xml里面定义一个ListViewXml代码 ?xmlversion="1.0"encoding="utf-8"?Li 阅读全文

posted @ 2011-01-19 00:01 linzheng 阅读(2287) 评论(0) 推荐(0) 编辑

导航