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
1 answer

How to add extras to an intent created by Linkify?

I have created a content provider (a word and its definition database). I also have an activity that will display a word and its definition, this activity requires two things: a custom Parcelable extra, and of course the word. The goal is that in…
Benoit Duffez
  • 11,839
  • 12
  • 77
  • 125
1
vote
2 answers

Android SQLite data displaying

I'm kinda new in android development and I am little confused about content providers. Content providers are used to share your data with other application legally, but is it correct to use it for retrieving your data from SQLite databaseand display…
Greich
  • 108
  • 1
  • 5
1
vote
0 answers

EPIPE (Broken Pipe)

I'm attempting to build a capability that allows a ContentProvider to extract a thumbnail from a raw image. Here is the implementation: @Override public ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode) throws…
Anthony
  • 7,638
  • 3
  • 38
  • 71
1
vote
2 answers

How to suspend notification to observers while doing many changes using a ContentProvider

I have an ExpandableListView that uses a SimpleCursorTreeAdapter which uses the cursors returned by a ContentProvider. This is fine as it always keeps in sync with the data but sometimes I need to do many changes to the database so that the cursor…
Tom
  • 5,068
  • 5
  • 29
  • 41
1
vote
1 answer

Would you like to integrate a POJO- or Cursor-based library in your android app?

My company wants to publish a library for android, so that other people can integrate our content easily in their custom apps. Now I am still very uncertain how I should provide the content. Right now I am using POJOs to provide the data in my…
OneWorld
  • 17,512
  • 21
  • 86
  • 136
1
vote
0 answers

Android - ContentProvider - How to use setReadPermission() and setWritePermission()?

I'm reading the docs https://developer.android.com/reference/android/content/ContentProvider.html#setReadPermission(java.lang.String) and it says Change the permission required to read data from the content provider. This is normally set for you…
Ivan
  • 361
  • 3
  • 16
1
vote
2 answers

ANDROID - How can I save a string and access it from any App

I have the need to store a created ID in an android device, this ID should be created by the first of the several of ours apps that is installed in the device, and should be read by any other app that is in the device. It also needs to work with all…
1
vote
2 answers

Have several apps managing one content provider - INSTALL_FAILED_CONFLICTING_PROVIDER

I need to have several apps using a same content provider. The first app that the user install creates the provider and adds a UUID, every other app, when installed, check if this provider already exists and use that UUID, or, if there is no other…
Javier Bullrich
  • 389
  • 1
  • 5
  • 22
1
vote
2 answers

Custom content provider and Permission Denial exception

) I have two apps. In the app A i have a database, which can be accessed from app B. I created my own ContentProvider to give app B an access to write data to app A. But when i am installing an app B and then app A - i get this exception - …
Fedor
  • 83
  • 1
  • 9
1
vote
1 answer

Not getting Contact Number in Fragment

I created below class but numbers is coming null. The same code is working fine with activity. I have made changes in context of Fragment. What else is creating problem in the code. public class TestFrag extends Fragment { private static final…
Panache
  • 1,701
  • 3
  • 19
  • 33
1
vote
1 answer

when using Intent.ACTION_GET_CONTENT how to avoid "SecurityException"

on Android os 5.11 (maybe other os as well), When using Intent.ACTION_GET_CONTENT to list the files with Android system file picker, Intent openIntent = new…
1
vote
2 answers

Securely restricting access to FileProvider

How can one create two Android apps where app "A" creates files and only app "B" can read the files? At first glance, Context.grantUriPermission seems like the trick because it allows restricting access to certain packages like so: //grant…
Brian Risk
  • 1,244
  • 13
  • 23
1
vote
1 answer

ContentProvider not called onCreate after deleting database

I have created ContentProvider which creates one Database on application launching. Now In that application, I am doing process of deleting database when user logout from app. After that when I come again to login, the ContentProvider cant call…
1
vote
1 answer

Why does the sync adapter won't work if android storage space running out

In my android application I have configured a periodic syncing using sync adapter, and its working fine except if the android storage space is running out.If i deleted some files and free up space then sync will start to work.Actually I am just…
1
vote
4 answers

RecyclerView.Adapter notifyDataSetChanged() using ContentProvider

Hello I am using ContentProvider and after deleting elements by clicking a button my adapter does not notify, if i go back and come again the element is deleted. So ContentProvider works but notifyDataSetChanged(); doesn't. public class…