Questions tagged [android-contentprovider]

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

Content providers are one of the primary building blocks of Android applications, providing content to applications. They encapsulate data and provide it to applications through the single ContentResolver interface. A content provider is only required if you need to share data between multiple applications.

For example, the contacts data is used by multiple applications and must be stored in a content provider. If you don't need to share data amongst multiple applications you can use a database directly via SQLiteDatabase

For more information about using content providers, read the Content Provider's documentation.

3206 questions
1
vote
2 answers

ContentProviderOperation.withYieldAllowed() does it even work?

I need to execute a big batch of operations. To avoid blocking I need to begin and commit database transactions several times while executing this batch. I've read this article about ContentProviderOperation.withYieldAllowed(). This would fit…
1
vote
1 answer

Can any one please describe me that what is oneway in aidl for android?

Can any one please describe me that what is oneway in aidl for android ? like in below code what oneway does ? oneway interface IPackageStatsObserver { void onGetStatsCompleted(in PackageStats pStats, boolean succeeded); }
1
vote
1 answer

How to search by Number format in ListView Data in android

[I am New of android,i m working by contacts,,,I am completed search by text but I want search By number Format in android][1] public class ContactFragment extends Fragment implements View.OnClickListener { RequestQueue requestQueue; public static…
1
vote
0 answers

Creating Network Based Content Provider

I am trying to achieve the following things. 1.Activity via cursor loader will query to the content provider by query() method. public Loader onCreateLoader(int id, Bundle args) { CursorLoader cursorLoader = new…
1
vote
0 answers

Two content Providers

I am developing an application and the app has a database with two table so my question is should both table have their own helper class and should each has it own content provider and if their are two versions of both wont the helper of first table…
Nikhil Soni
  • 1,011
  • 1
  • 11
  • 23
1
vote
1 answer

Do I need to use the same URI returned from my insert() method to fetch a row

I have a simple doubt regarding Android Content providers . While inserting a single record into db I am returning a URI by appending the _id fetched from the insert() method and also I am calling getContentResolver().notifyChange() on this URI…
animo3991
  • 181
  • 2
  • 9
1
vote
1 answer

Problems with implementing DocumentsProvider for the cloud on Android

I made custom Documents provider implementation where files are actually stored on a server. I followed the documentation so the provider works most of the time, but I have issues with certain applications, namely: 1) Gmail attaching a file from my…
1
vote
1 answer

Why the Content provider starting first instead of Launcher activity?

I am working on a project and when I was debugging the code, I found that the Custom content provider is starting first instead of Application class or the starting activity. I have checked all the code we are not calling the provider in the…
user927341
1
vote
1 answer

Perform instrumentation testing of ContentProvider

Say my ContentProvider is called DogProvider. How do I set up my Instrumentation test skeleton? When I try to run the following, I always end up with a null MockContentResolver. import org.junit.Test; import org.junit.runner.RunWith; import…
1
vote
1 answer

Android: How to figure out the client of content resolver

I am currently working on a project that is going to filter out some specific query from a specific app to android contact books. I am wondering how can I figure out which app is accessing the contacts provider? I've looked through the API…
1
vote
1 answer

Search for parts of a string in a content provider

Hello I'm implementing a searchview and inside onQueryTextChange, every time the user press a letter I want to search that in my DB. The onQueryTextChange is implemented and working, I need help with the search, for example: String selection =…
1
vote
0 answers

Android Xamarin - Failed to find provider info for 'provider'

I have been stuck on this for a while and I have no idea how to proceed forward. I have tried all the solutions listed in Stack and other sources but the problem still unsolved. I am developing a content provider which must be accessed from another…
1
vote
1 answer

Android ContentProvider and ContentProviderOperation.newUpdate()

I'm trying to use overrided applyBatch() method on a custom contentprovider. I know it gets passed an ArrayList of ContentProviderOperations. In my case they're all update ContentProviderOperations. In my provider I want to update the data in a…
M. Smith
  • 379
  • 1
  • 20
1
vote
1 answer

ContentResolver.requestSync doesn't call SyncAdapter

So I followed the tutorial on creating a SyncAdapter without a real ContentProvider and an Account (from here) but came across a problem I just can't fix. When calling ContentResolver.requestSync() to manually force a sync, it seems, that the…
1
vote
1 answer

How do someone decide between Sync Adapter and Firebase for Android App

As Sync Adapters does is as soon as the data is changed the UI gets updated and it requires content providers to be created and Firebase does the same thing when DataBase is created on it Edit: So what exactly should I implement in my app to sync…