ContentProvider ContentProvider Class

Definition

Content providers are one of the primary building blocks of Android applications, providing content to applications.

[Android.Runtime.Register("android/content/ContentProvider", ApiSince=1, DoNotGenerateAcw=true)]
public abstract class ContentProvider : Java.Lang.Object, Android.Content.IComponentCallbacks2, IDisposable
type ContentProvider = class
    inherit Object
    interface IComponentCallbacks
    interface IJavaObject
    interface IDisposable
    interface IComponentCallbacks2
Inheritance
ContentProviderContentProvider
Derived
Attributes
Implements

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

ContentProvider() ContentProvider()

Construct a ContentProvider instance.

ContentProvider(IntPtr, JniHandleOwnership) ContentProvider(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

CallingPackage CallingPackage

Return the package name of the caller that initiated the request being processed on the current thread.

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Context Context

Retrieves the Context this provider is running in.

Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
IsTemporary IsTemporary

Returns true if this instance is a temporary content provider.

JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
ReadPermission ReadPermission

Return the name of the permission required for read-only access to this content provider.

ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

WritePermission WritePermission

Return the name of the permission required for read/write access to this content provider.

Methods

ApplyBatch(IList<ContentProviderOperation>) ApplyBatch(IList<ContentProviderOperation>)
AttachInfo(Context, ProviderInfo) AttachInfo(Context, ProviderInfo)

After being instantiated, this is called to tell the content provider about itself.

BulkInsert(Uri, ContentValues[]) BulkInsert(Uri, ContentValues[])

Override this to handle requests to insert a set of new rows, or the default implementation will iterate over the values and call Insert(Uri, ContentValues) on each of them.

Call(String, String, Bundle) Call(String, String, Bundle)

Call a provider-defined method.

Canonicalize(Uri) Canonicalize(Uri)

Implement this to support canonicalization of URIs that refer to your content provider.

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Delete(Uri, String, String[]) Delete(Uri, String, String[])

Implement this to handle requests to delete one or more rows.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Dump(FileDescriptor, PrintWriter, String[]) Dump(FileDescriptor, PrintWriter, String[])

Print the Provider's state into the given stream.

DumpAsync(FileDescriptor, PrintWriter, String[]) DumpAsync(FileDescriptor, PrintWriter, String[])
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetPathPermissions() GetPathPermissions()

Return the path-based permissions required for read and/or write access to this content provider.

GetStreamTypes(Uri, String) GetStreamTypes(Uri, String)

Called by a client to determine the types of data streams that this content provider supports for the given URI.

GetType(Uri) GetType(Uri)

Implement this to handle requests for the MIME type of the data at the given URI.

Insert(Uri, ContentValues) Insert(Uri, ContentValues)

Implement this to handle requests to insert a new row.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
OnConfigurationChanged(Configuration) OnConfigurationChanged(Configuration)

Called by the system when the device configuration changes while your component is running.

OnCreate() OnCreate()

Implement this to initialize your content provider on startup.

OnLowMemory() OnLowMemory()

This is called when the overall system is running low on memory, and actively running processes should trim their memory usage.

OnTrimMemory(TrimMemory) OnTrimMemory(TrimMemory)

Called when the operating system has determined that it is a good time for a process to trim unneeded memory from its process.

OpenAssetFile(Uri, String) OpenAssetFile(Uri, String)

This is like OpenFile(Uri, String), but can be implemented by providers that need to be able to return sub-sections of files, often assets inside of their .apk.

OpenAssetFile(Uri, String, CancellationSignal) OpenAssetFile(Uri, String, CancellationSignal)

This is like OpenFile(Uri, String), but can be implemented by providers that need to be able to return sub-sections of files, often assets inside of their .apk.

OpenFile(Uri, String) OpenFile(Uri, String)

Override this to handle requests to open a file blob.

OpenFile(Uri, String, CancellationSignal) OpenFile(Uri, String, CancellationSignal)

Override this to handle requests to open a file blob.

OpenFileHelper(Uri, String) OpenFileHelper(Uri, String)

Convenience for subclasses that wish to implement OpenFile(Uri, String) by looking up a column named "_data" at the given URI.

OpenPipeHelper(Uri, String, Bundle, Object, ContentProvider+IPipeDataWriter) OpenPipeHelper(Uri, String, Bundle, Object, ContentProvider+IPipeDataWriter)
OpenTypedAssetFile(Uri, String, Bundle) OpenTypedAssetFile(Uri, String, Bundle)

Called by a client to open a read-only stream containing data of a particular MIME type.

OpenTypedAssetFile(Uri, String, Bundle, CancellationSignal) OpenTypedAssetFile(Uri, String, Bundle, CancellationSignal)

Called by a client to open a read-only stream containing data of a particular MIME type.

Query(Uri, String[], Bundle, CancellationSignal) Query(Uri, String[], Bundle, CancellationSignal)
Query(Uri, String[], String, String[], String) Query(Uri, String[], String, String[], String)

Implement this to handle query requests from clients.

Query(Uri, String[], String, String[], String, CancellationSignal) Query(Uri, String[], String, String[], String, CancellationSignal)

Implement this to handle query requests from clients with support for cancellation.

Refresh(Uri, Bundle, CancellationSignal) Refresh(Uri, Bundle, CancellationSignal)
SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPathPermissions(PathPermission[]) SetPathPermissions(PathPermission[])

Change the path-based permission required to read and/or write data in the content provider.

SetReadPermission(String) SetReadPermission(String)
SetWritePermission(String) SetWritePermission(String)
Shutdown() Shutdown()

Implement this to shut down the ContentProvider instance.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
Uncanonicalize(Uri) Uncanonicalize(Uri)

Remove canonicalization from canonical URIs previously returned by Canonicalize(Uri).

UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Update(Uri, ContentValues, String, String[]) Update(Uri, ContentValues, String, String[])

Implement this to handle requests to update one or more rows.

Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to