控件:Chronometer --- 计时器(定时震动)
摘要:现在可以发现计时器组件是TextView的子类,所以其主要功能肯定还是显示文本操作。main.xmlView Code <?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" andr
阅读全文
posted @
2012-03-24 19:28
大米稀饭
阅读(653)
推荐(0)
控件:AnalogClock与DigitalClock --- 时钟组件
摘要:AnalogClock 可以完成指针时钟的显示;DigitalClock 可以完成数字时钟的显示。main.xmlView Code <?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&quo
阅读全文
posted @
2012-03-24 19:11
大米稀饭
阅读(291)
推荐(0)
四大组件之一 ----------- BroadcastReceiver (拦截短信并屏蔽系统的Notification .)
摘要:拦截短信有几个关键点:1.android接收短信时是以广播的方式2.程序只要在自己的Manifest.xml里加有"接收"SMS的权限View Code <uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>3.要写个广播接收类View Code public class smsreceiveandmask extends BroadcastReceiver { private String TAG = "smsr
阅读全文
posted @
2012-03-20 15:12
大米稀饭
阅读(258)
推荐(0)
四大组件之一 ----------- BroadcastReceiver (短信拦截)
摘要:main.xmlView Code <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"
阅读全文
posted @
2012-03-19 10:49
大米稀饭
阅读(256)
推荐(0)
Eclipse IDE中Android项目打红叉的解决方法
摘要:先可以去看一下几个窗口的输出内容,不同的错误日志要采用不同的方法,要灵活使用各种方法!1>菜单路径----Window/Show View/Console2>菜单路径----Window/Show View/Error Log3>菜单路径----Window/Show View/Problems排除打红叉的常用方法,只是一个总结性的东西,大家不要太较真!1>工程在项目列表中删除(不从磁盘删除)并重新导入一次2>工程先Clean/Refresh一下,然后再重新编译3>删除工程下的gen目录再重新编译一次,或者把R.java删除掉再重新编译一次4>看res
阅读全文
posted @
2012-03-04 21:48
大米稀饭
阅读(1121)
推荐(0)
四大组件之一 ----------- Service 全面总结
摘要:http://www.cnblogs.com/newcj/archive/2011/05/30/2061370.html
阅读全文
posted @
2012-03-04 21:46
大米稀饭
阅读(137)
推荐(0)
控件:ZoomControls --- 缩放控制
摘要:main.xmlView Code <?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"&
阅读全文
posted @
2012-03-04 17:15
大米稀饭
阅读(670)
推荐(0)
控件:ScrollView --- 滚动视图
摘要:MyScrollViewDemo.javaView Code import android.app.Activity;import android.os.Bundle;import android.view.ViewGroup;import android.widget.Button;import android.widget.LinearLayout;public class MyScrollViewDemo extends Activity { // 准备出若干个信息而这些信息以后将通过程序加入到内嵌的线性布局文件之中 private String data[] = { "AA.
阅读全文
posted @
2012-03-04 17:06
大米稀饭
阅读(278)
推荐(0)
控件:Gallery --- 3.(实现图片切换)
摘要:◆使用Gallery + ImageSwitcher完成图片浏览功能grid_layout.xmlView Code <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" an
阅读全文
posted @
2012-03-04 16:50
大米稀饭
阅读(309)
推荐(0)
控件:Gallery --- 2.(SimpleAdapter)
摘要:除了使用BaseAdapter之外,SimpleAdapter也是一种最为常见的适配器操作类。既然决定要使用SimpleAdapter类了,那么就需要为其准备一个List集合,而在这个List集合之中,一定要保存Map集合,而且Map集合的key必须是String。grid_layout.xmlView Code <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/androi
阅读全文
posted @
2012-03-04 16:35
大米稀饭
阅读(254)
推荐(0)
控件:Gallery --- 1.(自定义适配器)
摘要:发现setAdapter()设置的时候可以使用的子类:ArrayAdapter、SimpleAdapter、BaseAdapter。1.BaseAdapter实际上是一个用户自己去实现的操作,包括定义显示的组件等等。main.xmlView Code <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/My
阅读全文
posted @
2012-03-04 16:24
大米稀饭
阅读(248)
推荐(0)
控件:文本切换 --- TextSwitcher
摘要:◆TextSwitcher和ViewFactory的使用View Code <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/MyLayout" android:orientation="vertical" android:layout_width="fill_pa
阅读全文
posted @
2012-03-04 13:26
大米稀饭
阅读(293)
推荐(0)
Android客户端GPS定位
摘要:AndroidManifest.xml文件配置:View Code <?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cn.itcast.main" android:versionCode="1" android:versionName="1.0"> <applica
阅读全文
posted @
2012-03-04 10:37
大米稀饭
阅读(681)
推荐(0)
Android进程间通信--消息机制及IPC机制实现
摘要:一、概念及说明Android为了屏蔽进程的概念,利用不同的组件[Activity、Service]来表示进程之间的通信!组件间通信的核心机制是Intent,通过Intent可以开启一个Activity或Service,不论这个Activity或Service是属于当前应用还是其它应用的!Intent包含两部分:1、目的[action]--要往哪里去2、内容[category、data]--路上带了些啥,区分性数据或内容性数据Intent类型:1、显式--直接指定消息目的地,只适合同一进程内的不同组件之间通信new Intent(this,Target.class)2、隐式--AndroidMa
阅读全文
posted @
2012-02-20 21:01
大米稀饭
阅读(476)
推荐(0)
Android 跨进程通信(二)
摘要:2. 客户端实现: (1)目录结构,如下图: (2)将服务器端的IAIDLService.aidl,Person.aidl和Person.java文件拷贝到本工程中,如上图所示: (3)res/layout/main.xml实现:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android"android:orientation = "vertic
阅读全文
posted @
2012-02-20 20:40
大米稀饭
阅读(639)
推荐(0)
Android 跨进程通信(一)
摘要:一. 概述: 跨进程通信(AIDL),主要实现进程(应用)间数据共享功能。二. 实现流程: 1. 服务器端实现:(1)目录结构,如下图: (2)实现*.aidl文件: A. IAIDLService.aidl实现:import com.focus.aidl.Person; interface IAIDLService { String getName(); Person getPerson(); } B. Person.aidl实现:parcelable Person; (3)进程间传递对象必需实现Parcelable或Serializable接口,下面是被传递的Person对象...
阅读全文
posted @
2012-02-20 20:38
大米稀饭
阅读(386)
推荐(0)
Android Intent的几种用法全面总结
摘要:Intent应该算是Android中特有的东西。你可以在Intent中指定程序要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料。都指定好后,只要调用startActivity(),Android系统会自动寻找最符合你指定要求的应用程序,并执行该程序。下面列出几种Intent的用法显示网页:Uri uri = Uri.parse("http://www.google.com");Intent it = new Intent(Intent.ACTION_VIEW,uri);startActivity(it);显示地图:Uri uri = U
阅读全文
posted @
2012-02-20 16:40
大米稀饭
阅读(275)
推荐(0)