If you think the Android project GridListViewAdapters listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/**
* Copyright 2014-present Biraj Patel/*fromwww.java2s.com*/
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/package com.birin.cursorgridadapter.datasetup;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
publicclass TestContentProviderSqlHelper extends SQLiteOpenHelper {
publicstaticfinal String DATABASE_NAME = "TestDb";
publicstaticfinalint DATABASE_VERSION = 1;
publicstaticfinal String EMPLOYEE_TABLE_NAME = "Employee";
publicstaticfinal String INDEX = "_id";
publicstaticfinal String EMPLOYEE_NAME = "name";
publicstaticfinal String EMPLOYEE_COLUMN_CHAR = "char";
publicstaticfinal String EMPLOYEE_COLUMN_CHAR_COLOR = "char_color";
publicstaticfinalint EMPLOYEE_TABLE_IDENTIFIER = 1;
public TestContentProviderSqlHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
publicvoid onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE " + EMPLOYEE_TABLE_NAME + " " + "(" + INDEX
+ " INTEGER PRIMARY KEY AUTOINCREMENT," + EMPLOYEE_NAME
+ " TEXT" + "," + EMPLOYEE_COLUMN_CHAR + " TEXT DEFAULT "
+ Character.toString('a') + "," + EMPLOYEE_COLUMN_CHAR_COLOR
+ " INTEGER DEFAULT " + Integer.toString(0) + ");");
}
@Override
publicvoid onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + EMPLOYEE_TABLE_NAME);
onCreate(db);
}
}