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 implementation in Titanium Android Module

Is it possible to implement a ContentProvider in a Titanium Android module? I have the ContentProvider already written as a Cordova plugin for a hybrid/Cordova style app but I want to port it to Titanium. My problem is that I can't see how or where…
1
vote
1 answer

Register content provider dynamically

Is it possible to register a content provider dynamically? What I mean is that I don't want to write anything about content provider in manifest. I want to register from my java code ifself. Is it possible? If yes How to do this?
Hari Ram
  • 3,098
  • 5
  • 23
  • 30
1
vote
1 answer

UriMatcher handing back wrong value

I have two Uris. Suppose they are: content://myprovider/messages content://myprovider/messages/# In my extended ContentProvider I have declared the following: private static final int MESSAGES = 1; private static final int MESSAGES_ID =…
Andrew
  • 20,756
  • 32
  • 99
  • 177
1
vote
1 answer

Map multiple columns to one column for custom search suggestions

What I'm trying to accomplish: custom search in Android that can look across multiple columns for suggestions to the user. I can map a single column "Topics" to the system-specified SUGGEST_COLUMN_TEXT_1, and that works wonderfully, I even have it…
Jacob
  • 588
  • 1
  • 4
  • 14
1
vote
1 answer

foreigns key in android fts4 tables

I have the following sql tables Parent(_id,name) Kid(_id,name,parent_id)//where parent_id is foreign key Toy(_id,name,…,kid_id)//where kid_id is foreign key right now I have queries that get all the Kids of a given Parent and also all the Toys for a…
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
1
vote
1 answer

How to have other apps know what CONTENT_URI to look for?

I have been researching everything I can on Content Providers, but I cannot grasp the concept of how other apps installed on the phone can have access to the Content I am Providing. How can other apps possibly know what my CONTENT_URIs are??? I am…
1
vote
0 answers

Save Content Provider Data to Own Sqlite Database - Android

I have created my own Sqlite database with all the columns that are there in Content Provider Media Image. Now I want to save(add) all the rows (data) of Content Provider to my sqlite database. So please help me as to which is the best memory…
1
vote
1 answer

DownloadManager with custom Uri

I have my own custom Uri which looks like: stream://com.mydomain.myprovider/[blah-blah] Basically it points to SQLite record with some blob For sure I do have custom ContentProvider which handles this kind of Uri My intention is to use…
Barmaley
  • 16,638
  • 18
  • 73
  • 146
1
vote
0 answers

Where is the background image column in SearchManager?

I could not find any column to set background image inside SearchManager class. When Google Play app's search result is selected, a background image is displayed but I don't seem to find any public api/column to set it. Here is my code for content…
1
vote
1 answer

Using same sqlite database in multiple Android Apps

I have a set of 4 applications, all of them need a general database. The user can use any app first and that app creates the sqlite database. I think I can create the database in a specific folder using a full path in the SQLiteOpenHelper, maybe I…
joel
  • 59
  • 1
  • 2
1
vote
1 answer

Querying Android db for specific piece of data

I'm creating a method that will see if a column in a database row is populated; and if so, it returns the varchar in that row, else it calls a web service to return that data. My question is: What is the standard way of simply selecting a column…
Andrew
  • 20,756
  • 32
  • 99
  • 177
1
vote
0 answers

How propagate Exceptions through Content Provider's openFile() method? (API 14)

I am using public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { If I call it and the CP can't provide the file, the caller (client) will still get an empty file no matter what I do on the CP side. That is, an…
JohnyTex
  • 3,323
  • 5
  • 29
  • 52
1
vote
0 answers

Android MS word and ContentProvider

I have fine working content provider that communicates with a lot of applications.. It works fine. But when i try to open a document in MS word i see a label "Read only - You can't save changes to this file" and 2 options 'Save a copy' and…
Vetalll
  • 3,472
  • 6
  • 24
  • 34
1
vote
0 answers

Android ContentResolver: Pass the data with cursor without requery or get the exact executed cursor when querying from activity

Say, I'm having a ContentProvider (which in fact do not performs database call) and I want to pass some additional data (for example, call statistics) with the cursor to the caller: public class SomeProvider extends ContentProvider { . . . …
shaman.sir
  • 3,198
  • 3
  • 28
  • 36
1
vote
2 answers

What does it mean "the content provider can be instantiated by the system"?

A few times in Android's components I've encountered a sentence ... can be instantiated by the system in particular here Whether or not the content provider can be instantiated by the system — "true" if it can be, and "false" if not So what does…
Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103
1 2 3
99
100