- 博客(88)
- 资源 (1)
- 收藏
- 关注
翻译 INTEGER PRIMARY KEY简介
Sqlite 中INTEGER PRIMARY KEY AUTOINCREMENT和rowid/INTEGER PRIMARY KEY的使用在用sqlite设计表时,每个表都有一个自己的整形id值作为主键,插入后能直接得到该主键.因为sqlite内部本来就会为每个表加上一个rowid,这个rowid可以当成一个隐含的字段使用,但是由sqlite引擎来维护的,在3.0以前rowid是32
2011-10-31 15:23:04 18754 1
翻译 android中读写SD Card文件
1. 使用mksdcard命令创建一个名为 sdcard.img的128M(M需大写)SD卡镜像。mksdcard 128M sdcard.img2.把sdcard.img拷贝到D:\projects2下,在Eclipse中的Run Configuration对话框中设置启动参数。-sdcard D:\projects2\sdcard.img这样SD Card就可用了。3.sd
2011-10-31 14:35:23 1284
翻译 android中读XML文件
res/xml中的XML文件会被Android平台(如果使用Eclipse)自动提取并编译为资源。在程序中可能通过Android支持的XML格式来读取它。people.xml文件代码片段void readXmlFile(){ XmlPullParser parser=this.getResources().getXml(R.xml.people);
2011-10-31 14:18:08 1506
翻译 android中读取原始(Raw)资源
存储在res/raw位置的文件不会被平台编译,而是作为可用的原始资源。读取原始资源非常简单。首先调用Context.getResource获得当前应用程序上下文的Resources引用.然后调用openRawResource(int id)得到InputStream.最后,操作InputStream得到数据。注意:把文件放在res/raw目录下,则R类会自动提供该id.提速
2011-10-31 13:21:16 29404
翻译 android中读写文件
众所周知Android有一套自己的安全模型, 具体可参见Android开发文档。当应用程序(.apk)在安装时就会分配一个userid,当该应用要去访问其他资源比如文件的时候,就需要userid匹配。默认情况下 ,任何应用程序创建的文件,数据库, sharedpreferences都应该是私有的(位于/data/data/your_project/files/),程序私有的数据的默认路
2011-10-31 12:58:42 1344
翻译 SharedPreferences简介
public interfaceSharedPreferencesandroid.content.SharedPreferencesSharedPreferences是以键值对来存储应用程序的配置信息的一种方式,它只能存储基本数据类型。实际上SharedPreferences是采用了XML格式将数据存储到设备中,它在DDMS中的File Explorer中的/data/data
2011-10-29 16:09:51 1289
翻译 Service简介
public abstract classServiceextends ContextWrapperimplements ComponentCallbacksjava.lang.Object android.content.Context android.content.ContextWrapper
2011-10-29 15:51:37 813
翻译 AIDL和Service实现两进程通信
AIDL和Service实现两进程通信:AIDL (Android Interface Definition Language) 是一种接口定义语言,用于生成代码允许Android设备上的两个进程间进程通信(IPC).如果你需要编写一个进程(比如Activity) 访问另一个进程(比如Services)的对象的方法代码,你可以使用AIDL自动生成代码而不用自己配置大量的参数.AIDL
2011-10-29 15:49:39 950
原创 BroadcastReceiver
BroadcastReceiverjava.lang.Object android.content.BroadcastReceiverBase class for code that will receive intents sent by sendBroadcast(). You can either dynamically register an instance
2011-10-28 21:55:28 2139
原创 Intent技术简介
Intentjava.lang.Object android.content.IntentAn intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity, broadcastI
2011-10-28 13:41:27 1522
原创 常用广播动作
常用广播动作动作 备注ACTION_TIME_TICK 每分钟发一次,以表明时间的变化ACTION_TIME_CHANGED 用户更改设备的时间时发送。ACTION_TIMEZONE_CHANGED 用户更改设备的时区时发送。ACTION_BO
2011-10-27 20:49:57 1004
原创 常用Intent
常用Intent常用动作和类型的匹配ACTION_MAIN CATEGORY_HOME Launch the home screen.常用动作和URL的匹配ACTION_CALL tel:phone_number 打开电话应用程序并拨打指定的电话号码ACTION_
2011-10-27 20:48:14 805
原创 从网络读取图片
mport java.io.BufferedInputStream;import java.io.IOException;import java.net.URL;import java.net.URLConnection;import android.graphics.BitmapFactory;Bitmap getImage(String imageLink) {
2011-10-27 20:46:22 1195
原创 Contract简介
contact有9个表 ContactsContract defines an extensible database of contact-related information. Contact information is stored in a three-tier data model:最重要的是下面三个表 * A row in the ContactsContra
2011-10-27 20:44:26 1256
原创 GroupMembership
ContactsContract.CommonDataKinds.GroupMembershipjava.lang.Object android.provider.ContactsContract.CommonDataKinds.GroupMembershipClass OverviewGroup Membership.You can use all column
2011-10-27 20:37:40 1772
原创 Groups
public static final classContactsContract.Groupsjava.lang.Object android.provider.ContactsContract.GroupsClass OverviewConstants for the groups table. Only per-account groups are supp
2011-10-27 20:31:02 1375
原创 AggregationSuggestions
AggregationSuggestionsjava.lang.Object android.provider.ContactsContract.Contacts.AggregationSuggestionsClass OverviewA read-only sub-directory of a single contact aggregate that contai
2011-10-26 22:32:54 1162
原创 AggregationExceptions
AggregationExceptionsjava.lang.Object android.provider.ContactsContract.AggregationExceptionsClass OverviewConstants for the contact aggregation exceptions table, which contains aggre
2011-10-26 22:29:07 4420
原创 用PhoneLookup进行电话号码查询
public static final classContactsContract.PhoneLookupextends Objectimplements BaseColumns ContactsContract.ContactOptionsColumns ContactsContract.ContactsColumns ContactsContract.PhoneLookupColu
2011-10-26 22:22:07 2983
原创 Contact类
public static classContactsContract.Contactsextends Object implements BaseColumns ContactsContract.ContactOptionsColumns ContactsContract.ContactStatusColumns ContactsContract.ContactsColumns
2011-10-26 22:17:33 4012
原创 rawContact数据查询
对RawContacts主表可查询以下共18项数据:变量名 列名 备注 _ID _id 这个就是raw_contact_id CON
2011-10-26 22:08:13 2332
原创 RawContacts
public static final classContactsContract.RawContactsextends Objectimplements BaseColumns ContactsContract.ContactOptionsColumns ContactsContract.RawContactsColumns ContactsContract.SyncColumns
2011-10-26 22:05:22 2499
原创 raw contact子表数据查询
RAW_CONTACT子表的查询很有意思。RAW_CONTACT子表有很多。主要的有:android.provider.ContactsContract.CommonDataKinds.StructuredName;android.provider.ContactsContract.CommonDataKinds.Phone;android.provider.ContactsCon
2011-10-26 21:54:54 2596 2
原创 selector的使用
selector是在文件夹drawable中进行定义的xml文件。它主要定义控件在下pressed,selected,focused及平常状态下的属性。越前面定义的状态,其优先级越高。对定得某个状态,如果某个属性没有显示说明,则表示此时该属性为任意值,都没关系。示例1:定义背景图片bg_selector.xml文件selector xmlns:android="http
2011-10-26 21:51:53 1010
原创 数据适配器简介(ExpandableListAdapter)
Android为我们提供了android.widget.Adapter和android.widget.ExpandableListAdapter两大类数据适配器接口。android.widget.ExpandableListAdapter接口主要和android.widget.ExpandableListView配合使用而android.widget.Adapter接口主要和android
2011-10-26 21:28:01 4150
翻译 BaseExpandableListAdapter
public abstract classBaseExpandableListAdapter extends Object implements ExpandableListAdapter HeterogeneousExpandableListClass OverviewBase class for a ExpandableListAdapter used to p
2011-10-26 21:26:48 4844 3
翻译 ExpandableListAdapter
public interfaceExpandableListAdapterClass OverviewAn adapter that links a ExpandableListView with the underlying data.The implementation of this interface will provide access to the data of t
2011-10-26 19:40:03 1616
原创 HeaderViewListAdapter
public classHeaderViewListAdapter extends Object implements Filterable WrapperListAdapterClass OverviewListAdapter used when a ListView has header views. This ListAdapter wraps ano
2011-10-25 21:47:57 10938
原创 ResourceCursorAdapter
public abstract classResourceCursorAdapterextends CursorAdapterjava.lang.Object android.widget.BaseAdapter android.widget.CursorAdapter android.widge
2011-10-25 19:37:41 3361 1
原创 android中的Cursor
android.database.Cursor提供了两个接口来监听数据库的变化;abstract voidregisterContentObserver(ContentObserver observer)Register an observer that is called when changes happen to the content backing
2011-10-24 17:26:11 2887 2
原创 CursorAdapter
CursorAdapter继承于BaseAdapter,它是个虚类,它为cursor和ListView提供了连接的桥梁。 public abstract class CursorAdapter extends BaseAdapter直接子类只有ResourceCursorAdapterClass OverviewAdapter tha
2011-10-24 16:50:55 17072 4
原创 LayoutInflater
java.lang.Object android.view.LayoutInflaterThis class is used to instantiate layout XML file into its corresponding View objects. It is never be used directly -- use getLayoutInflater()
2011-10-24 16:39:32 1983 2
原创 Adapter接口
public interface Adapterandroid.widget.Adapter是用于绑定Data和AdapterView 的适配器实现它的直接接口类有: ListAdapter SpinnerAdapterAdapter定义了很多接口:Public Methodsabstract intgetCount(
2011-10-24 16:33:24 1026
原创 视图适配器简介
虚类AdapterViewjava.lang.Object android.view.View android.view.ViewGroup android.widget.AdapterViewClass OverviewAn AdapterView is a view whose childre
2011-10-24 16:29:17 991
原创 SpinnerAdapter
public interfaceSpinnerAdapterimplements AdapterClass Overview Extended Adapter that is the bridge between a Spinner and its data. A spinner adapter allows to define two different vie
2011-10-24 16:23:53 3873
原创 数据适配器简介(Adapter)
Android为我们提供了android.widget.Adapter和android.widget.ExpandableListAdapter两大类数据适配器接口。android.widget.ExpandableListAdapter接口主要和android.widget.ExpandableListView配合使用而android.widget.Adapter接口主要和android
2011-10-24 16:19:42 2019
原创 SimpleCursorAdapter
SimpleCursorAdapter继承于ResourceCursorAdapter。构造函数如下:Public ConstructorsSimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to)This construc
2011-10-24 16:17:45 3695
原创 SimpleAdapter
SimpleAdapter是ArrayList和 ListView的桥梁。这个ArrayList里边的每一项都是一个Map类型。ArrayList当中的每一项 Map对象都和ListView里边的每一项进行数据绑定一一对应。SimpleAdapter的构造函数:>, int, java.lang.String[], int[])" style="color:rgb(
2011-10-24 16:05:11 3120
转载 ListActivity和ListView
本文转载整理自:http://www.sf.org.cn/Android/lumen/20980.htmlListActivity。这个类其实就是一个含有一个ListView组件的Activity类。也就是说,如果我们直接在一个普通的Activity中自己加一个ListView也是完全可以取代这个ListActivity的,只是它更方便而已。package com.teleca;i
2011-10-24 15:54:05 3354
转载 风格和主题(style,themes)
当你设计你的程序的时候,你可以用风格和主题来统一格式化各种屏幕和UI元素。 * 风格(style)是一个包含一种或者多种格式化属性值的集合,你可以将其用为一个单位用在布局XML单个元素当中。比如,你可以定义一种风格来定义文本的字号大小和颜色,然后将其用在View元素的一个特定的实例。 * 主题(themes)是一个包含一种或者多种格式化属性值的集合,你可以将其为一个单位用在应用
2011-10-22 23:13:50 1187
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人