系出名门Android(9) - 数据库支持(SQLite), 内容提供器(ContentProvider)
2010-01-28 17:18
519 查看
[索引页]
[源码下载]
[align=center]系出名门Android(9) - 数据库支持(SQLite), 内容提供器(ContentProvider)[/align]
作者:webabcd
介绍
在 Android 中使用 SQLite, ContentProvider
数据库支持(SQLite) - Android 开发平台提供了操作 SQLite 数据库的相关 API
内容提供器(ContentProvider) - 当数据需要在应用程序之间共享时,可以在某程序中使用 ContentProvider 定义 URI, 以使其它应用程序可以通过此 URI 访问指定的数据
1、SQLite 的 Demo
DatabaseHelper.java
代码
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.webabcd.contentprovider"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Main"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!--
配置一个自定义的 ContentProvider"
-->
<provider android:name="MyContentProvider" android:authorities="com.webabcd.MyContentProvider" />
</application>
<uses-permission android:name="android.permission.WRITE_CONTACTS"></uses-permission>
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
<uses-sdk android:minSdkVersion="3" />
</manifest>
OK
[源码下载]
[源码下载]
[align=center]系出名门Android(9) - 数据库支持(SQLite), 内容提供器(ContentProvider)[/align]
作者:webabcd
介绍
在 Android 中使用 SQLite, ContentProvider
数据库支持(SQLite) - Android 开发平台提供了操作 SQLite 数据库的相关 API
内容提供器(ContentProvider) - 当数据需要在应用程序之间共享时,可以在某程序中使用 ContentProvider 定义 URI, 以使其它应用程序可以通过此 URI 访问指定的数据
1、SQLite 的 Demo
DatabaseHelper.java
代码
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.webabcd.contentprovider"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Main"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!--
配置一个自定义的 ContentProvider"
-->
<provider android:name="MyContentProvider" android:authorities="com.webabcd.MyContentProvider" />
</application>
<uses-permission android:name="android.permission.WRITE_CONTACTS"></uses-permission>
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
<uses-sdk android:minSdkVersion="3" />
</manifest>
OK
[源码下载]
相关文章推荐
- 系出名门Android(9) - 数据库支持(SQLite), 内容提供器(ContentProvider)
- 系出名门Android(9) - 数据库支持(SQLite), 内容提供器(ContentProvider)
- 系出名门Android(9) - 数据库支持(SQLite), 内容提供器(ContentProvider)
- 系出名门Android(9) - 数据库支持(SQLite), 内容提供器(ContentProvider)
- 系出名门Android(9) - 数据库支持(SQLite)
- 系出名门Android(9) - 数据库支持(SQLite),
- Android组件系列----ContentProvider内容提供者【4】
- Android组件系列----ContentProvider内容提供者【1】
- Android四大组件ContentProvider 内容提供者
- Android中内容提供者ContentProvider实现数据库增删改查
- Android四大组件之内容提供者--ContentProvider
- Android编程使用内容提供者方式(ContentProvider)进行存储的方法
- Android为 ContentProvider 提供了那些服务内容?
- Android小技巧(二):为ContentProvider添加数据库事务支持
- (8)Launcher3客制化之ContentProvider内容提供者,实现其它应用改动数据库更新等操作
- (8)Launcher3客制化之ContentProvider内容提供者,实现其他应用修改数据库更新等操作
- Android 程式开发:(二十)内容提供者 —— 20.6 自定义ContentProvider的使用
- Android中SQLite数据库操作(2)——使用SQLiteDatabase提供的方法操作数据库
- Android——contentProvider内容提供者
- 解决android数据库降级时,sqlite不支持drop column的问题