public abstract class OllieProvider
extends android.content.ContentProvider
Default implementation of a ContentProvider. As with any content provider, this class must be declared in the manifest.. When using this content provider, manual initialization is not required as the content provider does this for you. This is not a feature of the provider, but rather a requirement due to the behavior of content providers.
Content Uris are built in a restful manner using your package name and tables names. For example:| Constructor and Description |
|---|
OllieProvider() |
| Modifier and Type | Method and Description |
|---|---|
static android.net.Uri |
createUri(java.lang.Class<? extends Model> type)
Create a Uri for a model table.
|
static android.net.Uri |
createUri(java.lang.Class<? extends Model> type,
java.lang.Long id)
Create a Uri for a model row.
|
int |
delete(android.net.Uri uri,
java.lang.String selection,
java.lang.String[] selectionArgs) |
protected java.lang.String |
getAuthority()
Returns the package name as the default Uri authority.
|
protected int |
getCacheSize()
Returns the default cache size.
|
protected abstract java.lang.String |
getDatabaseName()
Returns the database name.
|
protected abstract int |
getDatabaseVersion()
Returns the database version.
|
protected Ollie.LogLevel |
getLogLevel()
Returns the default log level of NONE.
|
java.lang.String |
getType(android.net.Uri uri) |
android.net.Uri |
insert(android.net.Uri uri,
android.content.ContentValues values) |
static boolean |
isImplemented()
Returns whether the provider has been implemented.
|
boolean |
onCreate() |
android.database.Cursor |
query(android.net.Uri uri,
java.lang.String[] projection,
java.lang.String selection,
java.lang.String[] selectionArgs,
java.lang.String sortOrder) |
int |
update(android.net.Uri uri,
android.content.ContentValues values,
java.lang.String selection,
java.lang.String[] selectionArgs) |
applyBatch, attachInfo, bulkInsert, call, canonicalize, dump, getCallingPackage, getContext, getPathPermissions, getReadPermission, getStreamTypes, getWritePermission, isTemporary, onConfigurationChanged, onLowMemory, onTrimMemory, openAssetFile, openAssetFile, openFile, openFile, openFileHelper, openPipeHelper, openTypedAssetFile, openTypedAssetFile, query, setPathPermissions, setReadPermission, setWritePermission, shutdown, uncanonicalizepublic static boolean isImplemented()
public static android.net.Uri createUri(java.lang.Class<? extends Model> type)
type - The model type.public static android.net.Uri createUri(java.lang.Class<? extends Model> type, java.lang.Long id)
type - The model type.id - The row Id.public boolean onCreate()
onCreate in class android.content.ContentProviderpublic java.lang.String getType(android.net.Uri uri)
getType in class android.content.ContentProviderpublic android.net.Uri insert(android.net.Uri uri,
android.content.ContentValues values)
insert in class android.content.ContentProviderpublic int update(android.net.Uri uri,
android.content.ContentValues values,
java.lang.String selection,
java.lang.String[] selectionArgs)
update in class android.content.ContentProviderpublic int delete(android.net.Uri uri,
java.lang.String selection,
java.lang.String[] selectionArgs)
delete in class android.content.ContentProviderpublic android.database.Cursor query(android.net.Uri uri,
java.lang.String[] projection,
java.lang.String selection,
java.lang.String[] selectionArgs,
java.lang.String sortOrder)
query in class android.content.ContentProviderprotected abstract java.lang.String getDatabaseName()
protected abstract int getDatabaseVersion()
protected java.lang.String getAuthority()
protected int getCacheSize()
protected Ollie.LogLevel getLogLevel()