當前位置: 首頁>>代碼示例>>Java>>正文


Java CursorFactory類代碼示例

本文整理匯總了Java中android.database.sqlite.SQLiteDatabase.CursorFactory的典型用法代碼示例。如果您正苦於以下問題:Java CursorFactory類的具體用法?Java CursorFactory怎麽用?Java CursorFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CursorFactory類屬於android.database.sqlite.SQLiteDatabase包,在下文中一共展示了CursorFactory類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SQLiteAssetHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
/**
 * Create a helper object to create, open, and/or manage a database in
 * a specified location.
 * This method always returns very quickly.  The database is not actually
 * created or opened until one of {@link #getWritableDatabase} or
 * {@link #getReadableDatabase} is called.
 *
 * @param context to use to open or create the database
 * @param name of the database file
 * @param storageDirectory to store the database file upon creation; caller must
 * ensure that the specified absolute path is available and can be written to
 * @param factory to use for creating cursor objects, or null for the default
 * @param version number of the database (starting at 1); if the database is older,
 * SQL file(s) contained within the application assets folder will be used to
 * upgrade the database
 */
public SQLiteAssetHelper(Context context, String name, String storageDirectory, CursorFactory factory, int version, DatabaseErrorHandler errorHandler) {
    super(context, name, factory, version, errorHandler);

    if (version < 1) throw new IllegalArgumentException("Version must be >= 1, was " + version);
    if (name == null) throw new IllegalArgumentException("Database name cannot be null");

    mContext = context;
    mName = name;
    mFactory = factory;
    mNewVersion = version;

    mAssetPath = ASSET_DB_PATH + "/" + name;
    if (storageDirectory != null) {
        mDatabasePath = storageDirectory;
    } else {
        mDatabasePath = context.getApplicationInfo().dataDir + "/databases";
    }
    mUpgradePathFormat = ASSET_DB_PATH + "/" + name + "_upgrade_%s-%s.sql";
}
 
開發者ID:albertogiunta,項目名稱:justintrain-client-android,代碼行數:36,代碼來源:SQLiteAssetHelper.java

示例2: DeleteOnDowngradeSQLiteOpenHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public DeleteOnDowngradeSQLiteOpenHelper(Context context, String name, CursorFactory factory, int version) {
    super(context, name, factory, version);
    mDatabaseFile = context.getDatabasePath(name);
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:5,代碼來源:DeleteOnDowngradeSQLiteOpenHelper.java

示例3: createdb

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public void createdb(View v) {
	CursorFactory factory = null;
	int version = 1;// �Զ�����1��ʼ
	String name = "db.db";// ���ݿ���
	Context Context = v.getContext();
	// ʹ��sqlliteopenhelpeʵ������ȡһ��sqldatabase
	SQLiteOpenHelper helper = new MySQLiteOpenHelper(Context, name,
			factory, version);
	SQLiteDatabase db = helper.getWritableDatabase();

}
 
開發者ID:z9961,項目名稱:DoList,代碼行數:12,代碼來源:CreateDBActivity.java

示例4: OpenHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public OpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory, SCHEMA_VERSION);
}
 
開發者ID:xiarunhao123,項目名稱:Ency,代碼行數:4,代碼來源:DaoMaster.java

示例5: DevOpenHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public DevOpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory);
    mContext = context;
}
 
開發者ID:zqHero,項目名稱:rongyunDemo,代碼行數:5,代碼來源:DaoMaster.java

示例6: DevOpenHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public DevOpenHelper(Context context, String name, CursorFactory factory) {
    super(context, name, factory);
}
 
開發者ID:yippeesoft,項目名稱:NotifyTools,代碼行數:4,代碼來源:DaoMaster.java

示例7: RobustSQLiteOpenHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public RobustSQLiteOpenHelper(Context context, String name,
		CursorFactory factory, int version) {
	super(context, name, factory, version);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:5,代碼來源:RobustSQLiteOpenHelper.java

示例8: DBHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public DBHelper(Context context, String name, CursorFactory factory, int version) {
	super(context, name, factory, version);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:DBHelper.java

示例9: DatabaseOpenHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public DatabaseOpenHelper(Context context, String name, CursorFactory factory, int version) {
    super(context, name, factory, version);
    this.context = context;
    this.name = name;
    this.version = version;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:DatabaseOpenHelper.java

示例10: Database

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public Database(Context context, String name, CursorFactory factory, int version)
{
	super(context, name, factory, version);
}
 
開發者ID:vassela,項目名稱:AC2RD,代碼行數:5,代碼來源:DatabaseProvider.java

示例11: DbHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public DbHelper(Context context, String name, CursorFactory factory, int version) {
    super(context, name, factory, version);
}
 
開發者ID:facetome,項目名稱:smart_plan,代碼行數:4,代碼來源:DbHelperManger.java

示例12: DBHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public DBHelper(Context context, String name, CursorFactory factory, int version) {
    //必須通過super 調用父類的構造函數
    super(context, name, factory, version);
}
 
開發者ID:MarukoZ,項目名稱:FaceRecognition,代碼行數:5,代碼來源:DBHelper.java

示例13: openOrCreateDatabase

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
@Override
public SQLiteDatabase openOrCreateDatabase(
        String name, int mode, CursorFactory factory, DatabaseErrorHandler errorHandler) {
    return super.openOrCreateDatabase(
            name, mode | Context.MODE_NO_LOCALIZED_COLLATORS, factory, errorHandler);
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:7,代碼來源:NoLocaleSqliteContext.java

示例14: DatabaseHelper

import android.database.sqlite.SQLiteDatabase.CursorFactory; //導入依賴的package包/類
public DatabaseHelper(Context context, String name, CursorFactory factory, int version) {
  super(context, name, factory, version);
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:4,代碼來源:DatabaseFactory.java


注:本文中的android.database.sqlite.SQLiteDatabase.CursorFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。