de.theappguys.winzigsql
Class WinzigDbProvider
java.lang.Object
android.content.ContentProvider
de.theappguys.winzigsql.WinzigDbProvider
- All Implemented Interfaces:
- android.content.ComponentCallbacks
public abstract class WinzigDbProvider
- extends android.content.ContentProvider
Class that generically wraps any SQLiteOpenHelper into a provider.
uris are assumed to be of the form:
content://[authority]/[table]
As this provider allows direct, raw access to the underlying sqlite it is
*not* a good idea to make it available to other apps publicly!
|
Method Summary |
static android.net.Uri |
createBaseUri(String authority)
|
protected abstract android.database.sqlite.SQLiteOpenHelper |
createDb(android.content.Context context)
|
int |
delete(android.net.Uri uri,
String selection,
String[] selectionArgs)
|
android.net.Uri |
getBaseUriForDatabase()
|
android.net.Uri |
getBaseUriForTable(String table)
|
String |
getType(android.net.Uri uri)
|
android.net.Uri |
insert(android.net.Uri uri,
android.content.ContentValues values)
|
boolean |
onCreate()
|
android.database.Cursor |
query(android.net.Uri uri,
String[] projection,
String selection,
String[] selectionArgs,
String sortOrder)
|
int |
update(android.net.Uri uri,
android.content.ContentValues values,
String selection,
String[] selectionArgs)
|
| Methods inherited from class android.content.ContentProvider |
applyBatch, attachInfo, bulkInsert, getContext, getPathPermissions, getReadPermission, getWritePermission, isTemporary, onConfigurationChanged, onLowMemory, openAssetFile, openFile, openFileHelper, setPathPermissions, setReadPermission, setWritePermission |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WinzigDbProvider
public WinzigDbProvider(String authority)
- Parameters:
authority - the first part of the content url of this provider,
should be the namespace of the app
createBaseUri
public static android.net.Uri createBaseUri(String authority)
createDb
protected abstract android.database.sqlite.SQLiteOpenHelper createDb(android.content.Context context)
getBaseUriForDatabase
public android.net.Uri getBaseUriForDatabase()
getBaseUriForTable
public android.net.Uri getBaseUriForTable(String table)
onCreate
public boolean onCreate()
- Specified by:
onCreate in class android.content.ContentProvider
query
public android.database.Cursor query(android.net.Uri uri,
String[] projection,
String selection,
String[] selectionArgs,
String sortOrder)
- Specified by:
query in class android.content.ContentProvider
insert
public android.net.Uri insert(android.net.Uri uri,
android.content.ContentValues values)
- Specified by:
insert in class android.content.ContentProvider
delete
public int delete(android.net.Uri uri,
String selection,
String[] selectionArgs)
- Specified by:
delete in class android.content.ContentProvider
update
public int update(android.net.Uri uri,
android.content.ContentValues values,
String selection,
String[] selectionArgs)
- Specified by:
update in class android.content.ContentProvider
getType
public String getType(android.net.Uri uri)
- Specified by:
getType in class android.content.ContentProvider
Copyright © 2013. All Rights Reserved.