public class

OmlibContentProvider

extends ContentProvider
java.lang.Object
   ↳ android.content.ContentProvider
     ↳ mobisocial.omlib.service.OmlibContentProvider

Class Overview

A ContentProvider that manages access to the local database synced from the Omlet network. Disallows all writes, since they typically include server-driven side effects. Instead, use the OmletApi for sending and manipulating data. See OmletModel for tables that can be queried using a ContentResolver.

This ContentProvider notifies against Uris when data has been received in the standard way, using the ContentResolver. Several events are also broadcasted for android.content.BroadcastReceivers. See OmlibContentProvider.Intents for a list of supported actions and parameters.

To use this content provider, you must first register it in your manifest. The authority of the provider must be your application's package name with an appended '.omlib.provider'. For example, for an app with package name com.demo.app, add a content provider reference as follows:

<manifest> <application> ... <provider xmlns:tools="http://schemas.android.com/tools" tools:replace="android:authorities" android:authorities="com.demo.app.omlib.provider" android:name="mobisocial.omlib.service.OmlibContentProvider" android:exported="false" /> </application> </manifest>

Summary

Nested Classes
interface OmlibContentProvider.CustomAPICall  
class OmlibContentProvider.Intents  
class OmlibContentProvider.MimeTypes  
Constants
int TIMEOUT_SECONDS
[Expand]
Inherited Constants
From interface android.content.ComponentCallbacks2
Public Constructors
OmlibContentProvider()
OmlibContentProvider(boolean allow_external)
Public Methods
Bundle call(String method, String arg, Bundle extras)
int delete(Uri uri, String selection, String[] selectionArgs)
static String getAuthority(Context c)
String getType(Uri uri)
Uri insert(Uri uri, ContentValues contentValues)
boolean onCreate()
ParcelFileDescriptor openFile(Uri uri, String mode, CancellationSignal signal)
ParcelFileDescriptor openFile(Uri uri, String mode)
Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
static void registerCustomApiCall(String method, OmlibContentProvider.CustomAPICall apiCall)
int update(Uri uri, ContentValues values, String selection, String[] selectionArgs)
[Expand]
Inherited Methods
From class android.content.ContentProvider
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2

Constants

public static final int TIMEOUT_SECONDS

Constant Value: 40 (0x00000028)

Public Constructors

public OmlibContentProvider ()

public OmlibContentProvider (boolean allow_external)

Public Methods

public Bundle call (String method, String arg, Bundle extras)

public int delete (Uri uri, String selection, String[] selectionArgs)

public static String getAuthority (Context c)

public String getType (Uri uri)

public Uri insert (Uri uri, ContentValues contentValues)

public boolean onCreate ()

public ParcelFileDescriptor openFile (Uri uri, String mode, CancellationSignal signal)

Throws
FileNotFoundException

public ParcelFileDescriptor openFile (Uri uri, String mode)

Throws
FileNotFoundException

public Cursor query (Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)

public static void registerCustomApiCall (String method, OmlibContentProvider.CustomAPICall apiCall)

public int update (Uri uri, ContentValues values, String selection, String[] selectionArgs)