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

Permission Denial: opening provider Android Studio

I'm new to Content Provider. As i'm trying to fetch info from an app to another one but Im getting a permission denial:opening provider error. I tried to do so by creating a Content provider in one of my apps(App1) : public class DroneProvider…
1
vote
1 answer

Configuring library build types while generating signed apk in android

I am working on making a large project modular. I have separated the code and layout files and everything is working fine except one issue. I needed to create 3 build types in the module namely, beta, stage and live (for a reason mentioned later).…
1
vote
0 answers

java.lang.SecurityException: Permission Denial: opening provider when get data from content provider of another app

I have two apps from which i want to share data between the apps using content provider.What i do, i have create Content Provider in app A. Below is Manifest.xml file of app A.
1
vote
0 answers

Change custom ringtone of a phone number is not change on some Nougat device (LG - K10, OS -7.0)

I want to change ringtone of given phone number programmatically. I have facing below mention issues. 1. Ringtone is not change on some Nougat device (LG k10, Samsung). 2. It is working fine below the Nougat device. I am using below mention code to…
Qa Flexsin
  • 11
  • 2
1
vote
0 answers

delete method using content provider

I seem to encounter a minor bug somewhere in the code and it is pissing me off because I seem not to find it. Anyways the insert method as well as the update method works fine. This is the code I use for delete method: @Override public int…
Luka Čagalj
  • 31
  • 1
  • 6
1
vote
0 answers

How to keep Content provider running for external app

I have a "data hub" that contains a ContentProvider that I wish to access from other external apps. I have so far succeeded in setting up the required permissions and contract classes to access the data through a ContentResolver, which works well…
Bondolin
  • 2,793
  • 7
  • 34
  • 62
1
vote
0 answers

The implementation of a ContentProvider just feels wrong

A bit of history: I used to code on main frames with COBOL back in the 90s when top down programming was all that was needed. I then lived through 2-tier, 3-tier and n-tier programming, so I understand abstracting the UI layer from the data layer,…
Aaron Bar
  • 611
  • 1
  • 7
  • 20
1
vote
2 answers

LAST_TIME_CONTACTED has unexpected value

When I try to get the last time that I contacted some contacts, the results has the value converted to "01/01/1970" but I know the real date and time of the last call (for example, it is 14/02/2016). I noted that in my logs the last saved call is…
1
vote
1 answer

Registering an app for receiving all file types in SEND action

What I want is a custom intent-filter that can receive any file types like text, audio, image, video, apk, pdf, word, excel, power point, etc sharing from other apps. The important thing that must be mentioned is that my app is a file sharing app.…
1
vote
0 answers

URI Matcher with arguments in the URI

I am writing a content provider and I'm trying to match URIs using UriMatcher. I've already written a few matchers ending either in a ...path/ or .../path/# and that works well. However, my next step is to start using URIs that include arguments…
rothloup
  • 1,220
  • 11
  • 29
1
vote
1 answer

How to test exception thrown in Android ContentProvider

I am trying to test the getType method of my contentprovider, particularly when an invalid uri is passed in. Currently I throw an IllegalArgumentException, but no exception is caught in my test. Here is my test public void…
Joe Young
  • 1,076
  • 1
  • 14
  • 27
1
vote
1 answer

Not able to read Service messages using READ_SMS permission android

We have an Android app where we are trying to read all the messages available in the phone. We are using READ_SMS permission but we are not able to read service messages in this way. By service mesaage I mean the messages obtained from different…
Yesha
  • 648
  • 1
  • 7
  • 29
1
vote
0 answers

Android: How to View PDF asset via Google Drive?

So in an Android app, I've got a ContentProvider providing assets from my app -- and it's working just fine with ACTION_SEND to send PDFs to Google Drive. And elsewhere I'm viewing PDF URIs with Google Drive via various ACTION_VIEW Intent --…
1
vote
1 answer

How to inspect ContentProvider available for Intent (or block specific one)

I use the Intent mechanism to have the user select an image via the standard way val intent = Intent(Intent.ACTION_GET_CONTENT) intent.type = "image/*" intent.addCategory(Intent.CATEGORY_OPENABLE) ctx.startActivityForResult(intent,…
androidguy
  • 3,005
  • 2
  • 27
  • 38
1
vote
1 answer

Support CursorLoader with EXTRA_ADDRESS_BOOK_INDEX

I am using a support CursorLoader to load Contacts. When using an API larger than 21, I call loader.setUri(ContactsContract.Data.CONTENT_URI.buildUpon().appendQueryParameter(ContactsContract.Data.EXTRA_ADDRESS_BOOK_INDEX, "true").build()); Meaning…