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
0 answers

ContentProvider notifyChange getting ignored

We have an AsyncTaskLoader in which in the function loadInBackground we query a content provider. On return of the query we get a cursor from the provider. Now on this cursor we have set a ForceLoadContentObserver as below : private final…
1
vote
1 answer

No contacts for my AccountManager account

I am currently working on a project in which I want to access the mobile contacts, So I have managed to create account with accountmanager and also able to perform Syncadapter operation. I could see my account got created in the mobile…
1
vote
1 answer

Android SMS handling

I am just wondering about how android handles sms when it receives them. More precisely my question is when the android phone receives a sms message, which application saves the message to the mmssms database? Is this done by the OS or by the native…
Yash
  • 2,259
  • 4
  • 26
  • 33
1
vote
1 answer

How to fetch txt file from whatsapp fileprovider

I trying to get whatsapp chat txt file. As i saw on Android documentation: private void handleSentMultipleAttached(Intent intent) { ArrayList attachedFilesUris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM); if…
1
vote
1 answer

Is it possible to get the last "N" IDs from a ContentProvider bulkInsert?

The problem Say that I want to insert 1000 elements on a table using a ContentProvider. I'd normally use bulkInsert for that. But what if I want the IDs of the successful insert operations? I can't get that information through the bulkInsert…
Mauker
  • 11,237
  • 7
  • 58
  • 76
1
vote
1 answer

main thread is waiting on sqlcipher cursor close

In my app we are doing applyBatch for around 2000 records in worker thread. at the same time if i rotate the screen i am getting black screen. "main@6280" prio=5 waiting java.lang.Thread.State: WAITING blocks main@6280 at…
Vivart
  • 14,900
  • 6
  • 36
  • 74
1
vote
0 answers

How to make content provider visible to all users on tablet

Is it possible to make your content provider public to be able to provide data to all the users and profiles on a tablet ? I know that export=true can make it visible to all apps in a given user account, but how about all users ?
bianca
  • 7,004
  • 12
  • 43
  • 58
1
vote
3 answers

How can i send image without storing in sdcard?

I am developing an application that displays images. The application provides an option to email the image as an attachment. I have to save the image to the SD card in order to email the image as an attachment. Is it possible to email the image as…
sivaraj
  • 1,849
  • 9
  • 35
  • 52
1
vote
0 answers

Launch the Details page for a specific contact in android default contact application from our app

I have created a list of contacts that exists in my phone, sync to all accounts(i.e. SIM1,SIM2, Phone, Google account). Now on the click of my list item I want to open the default contact app's detail page of the user when a given user is…
1
vote
1 answer

Android content provider unable to update data

In the project i am working i have to update data at run-time. But here when i am trying to update. The data is not updating in the database.I am using Contentprovider for insert/update/delete operations Here is my code: private void saveData() …
Satyajeet
  • 89
  • 1
  • 7
1
vote
1 answer

How to display live progress of a message? What data structure/view to use?

I have a working service that allows users to send emails over Ethernet. This service is a part of a greater application that allows users to view the progression of those messages (both sending and receiving) as they are transmitted. My service is…
1
vote
2 answers

Creating All-Day Events Using Android Calendar Provider

I would like my app to insert all day events into the calendar. I started off with the example given at https://developer.android.com/guide/topics/providers/calendar-provider.html. To make it all-day, I add the ALL_DAY content value and set the time…
user3386180
1
vote
0 answers

Android MediaStore playlists members returning wrong Album ID

Im using the below function that takes a playlist id and returns the tracks that belongs to that playlist. public Track[] findTracksByPlaylistId(Context context, Long id) { ContentResolver contentResolver = context.getContentResolver(); …
Tejas
  • 437
  • 5
  • 12
1
vote
1 answer

Android app widget update based on contentprovider data change

I am trying to add a widget to the launcher3 app that takes data from a contentprovider running in a separate process and displays it in a listview in the widget. The widget must update its listview items whenever the contentprovider data gets…
Ravs
  • 261
  • 2
  • 7
  • 15
1
vote
0 answers

How to clean db with ProviderTestCase2 or RenamingDelegatingContext

I do not understand what exactly should I do in order to get a clean and a different db from the one that the app uses. This is my test class: public class SQLTest extends ProviderTestCase2{ private static String testDbPrefix = "unitTest_"; …