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
9
votes
5 answers

SimpleCursorAdapter's old constructor deprecated.. really?

Here it says that SimpleCursorAdapter's API level 1 constructor is deprecated and the use of LoaderManager and CursorLoader is recommended. But delving into the LoaderManager and CursorLoader's use I found this example where inside an inner class…
Bilthon
  • 2,461
  • 8
  • 36
  • 44
9
votes
1 answer

Android ContentProvider read and write permissions

permissions don't seem to make any difference... In the manifest, I have only one (permission.INTERNET), and I have two elements:
davidcesarino
  • 16,160
  • 16
  • 68
  • 109
9
votes
3 answers

Approach to populate the Expandable List View with local SQlite database

I have a sqlite database in my application. I want to make an expandable list view with that. I am fixed with the approach I should take for that. Tried a lot to find a tutorial for the same, but could not find a single one, where one is populating…
9
votes
2 answers

How to use Android Jetpack App Startup library

As part of Jetpack, there is now a library to handle App Startup. Specifically, you can implement a component initializer for any of your dependencies, apparently ones that use ContentProvider for their initialization, in order to speed up the app…
9
votes
1 answer

Content provider URI matcher

There is distinct recomendation in documentation for defining all uris while implementing ContentProvider. But I'm confused with URI matcher part: for example, I've got package org.company.example, table named 'items', then I define public static…
user468311
9
votes
2 answers

ContentProvider without SQL

I have two pieces of data that need to be accessed from outside applications and stored. According to documentation ContentProviders are the only possible way, but it also mentions external storage. ContentProviders implement a database-like…
9
votes
2 answers

Select first n rows in contentProvider

I've this select: final Cursor cursorConversations = getContentResolver().query( Uri.parse("content://gmail-ls/conversations/" + Uri.encode(mailAddress)), null, null, null, BaseColumns._ID + " DESC"); ContentQueryMap mQueryMap …
Geltrude
  • 1,093
  • 3
  • 17
  • 35
9
votes
0 answers

Android error "E/ConfigurationContentLoader: PhenotypeFlag unable to load ContentProvider"

Recently I Factory Reset my phone and tried running my app on the phone again and now I get this error in Logcat: 09-18 20:15:57.629 29355-29378/com.******.com E/ConfigurationContentLoader: PhenotypeFlag unable to load ContentProvider, using default…
Richard
  • 1,087
  • 18
  • 52
9
votes
3 answers

IllegalArgumentException: Invalid column

Here is the logcat: 01-15 16:06:03.622: ERROR/AndroidRuntime(22300): Uncaught handler: thread main exiting due to uncaught exception 01-15 16:06:03.657: ERROR/AndroidRuntime(22300): java.lang.RuntimeException: Unable to start activity…
9
votes
2 answers

ContentProvider in android library project

Is it possible to have private (exported=false) ContentProvider for a library project that's used by many different apps? The issue is that even when the CP is not exported, it has to have unique authority. When it's not unique then you can't…
LR89
  • 397
  • 1
  • 4
  • 14
9
votes
1 answer

Why is Content Provider without permissions and with exported=true accessible to any app?

Here is a test I ran to understand Android Content Provider permissions: App ProviderApp manifest:
Sébastien
  • 13,831
  • 10
  • 55
  • 70
9
votes
3 answers

How to find and collect all the information available in a give contact in any android phone?

Currently I am displaying all the contacts of my phone in my app as a custom recyclerview. Till now I am showing name, mobile number and profile image of the contact on the list item view but I need to get all the information for that contact and…
9
votes
1 answer

SQLite data to a RecyclerView

The app has data in a SQLite database. The UI is primarily a RecyclerView. The question is how to best to transfer data from the database into the UI, whilst keeping off the main thread? I originally planned to use a CursorLoader, ContentProvider,…
9
votes
2 answers

Android Browser.BOOKMARKS_URI does not work on all devices. How to find out the correct uri for a given device?

I am trying to use Android Browser.BOOKMARKS_URI to CRUD device bookmarks from within my app ( https://play.google.com/store/apps/details?id=com.elementique.web ) It's working fine on most of the devices, but does not work on some :-( On those…
Pascal
  • 15,257
  • 2
  • 52
  • 65
9
votes
1 answer

Android KitKat (API 19) - How to write messages in SMS Content Provider, without sending them, from Non-Default App?

I am trying to create an Android app that writes messages in the Sent Box of the system. These messages should not be sent over the GSM network to the recipient, the idea is only to write them in the Sent Content Provider. For now, I have this…
supertreta
  • 421
  • 1
  • 4
  • 11