contentprovider

Dataflow between Android BroadcastReceiver, ContentProvider, and Activity?

I've developed an application that receives a Broadcast and then launches an Activity, where that Activity queries a ContentProvider which pulls information out of the DNS in real-time. I'd like to be able to shuffle this so that instead of going: BroadcastReceiver.onReceive() { Intent intent = new Intent(...); intent.setData(...);...

Android: SearchBox -> fill hint list dynamically with data received via HTTP/JSON

I've been looking into the Android SDK's example of the SearchableDictionary for a while now, but I'm still not sure if that is the right approach. The problem is, that I want to fill my hint list (see picture below) with data, which I will receive via a HTTP/JSON query. So I'm not sure if using a ContentProvider as used in the above ex...

How to query the MMS Log in Android

In my app I need to query both the SMS and the MMS log to get the history of all incoming and outgoing messages. This code has worked wonderfully for SMS: Cursor c = cr.query(Uri.parse("content://sms"), null, null, null, null); But when I try the following I get completely different results: Cursor c = cr.query(Uri.parse("content://...

Content Provider is part of my application?

Hello, I need to create 3 things: Content Provider Service Application I'm wondering if these all three will be in one single project, or they will be three different projects? Also how can I limit my Content Provider to my services and my applications? Regards, Pentium10 ...

Android: SQLite transactions when using ContentResolver

The goal: refresh database from XML data The process: Start transaction Delete all existing rows from the tables Per each main element of parsed XML insert row into main table and get PK Per each child of the main element insert record into 2nd table providing FK from the previous step Commit transaction Pretty standard stuff as far...

Class structure for a ContentProvider having multiple sub tables

The ContentProvider doc says to make ONE entry in the AndroidManifest for your ContentProvider class. If your class supports multiple sub-tables then there must be one CONTENT_URI constant declared for each. How? You can't do that unless you sub-class for each sub-table. Why not just have multiple providers? Do you implement the sub-tab...

On Android, how do I grant a LiveFolders the required permission of my ContentProvider?

On Android, for a content provider that requires the FINE_LOCATION permission, how do I create a LiveFolder? <provider android:authorities="gpstracker" android:name=".db.GPStrackingProvider" android:permission="android.permission.ACCESS_FINE_LOCATION" > </provider> The LiveFolder keeps crashing in the at com.android.launch...

Receiving a NullPointerException when calling a cursor in Android

I am creating an application which tracks the users location using GPS, stores the longitude and latitude in a database using a content provider then output the first long and lat to a mapview. I am able to create the cursor using this line of code: Cursor c = getContentResolver().query(GPSContentProvider.CONTENT_URI, ...

Am I able to run SQL functions on a ContentResolver columns query?

I am wondering if Android's ContentResolver supports using SQL functions over the columns when you query a ContentProvider. Such as SQLite3 date functions, to get a specific date format, or datediff? What do you know about this? ...

Android - Using PreferenceScreen to display and save settings to/from ContentProvider

I have my own custom Content Provider that loads a database which contains the settings information for my application. I load the settings from the ContentProvider on the creation of my Settings activity. My Settings activity is made up of a PreferenceScreen and Dialog based EditText's. The following code shows how I use the preferen...

Android - Redirect sending of SMS message

I currently use a ContentObserver to listen for changes in the SMS ContentProvider and tell my application whether a message has been sent or received. Upon getting notification that a message is being sent I would like to present the user the option to send that SMS normally over GSM/CDMA or if connected to Wifi to send the SMS over an...

Android - Querying the SMS ContentProvider?

I currently register a content observer on the following URI "content://sms/" to listen out for incoming and outgoing messages being sent. This seems to work ok and I have also tried deleting from the sms database but I can only delete an entire thread from the following URI "content://sms/conversations/" Here is the code I use for tha...

ContentObserver on content://sms/ in 1.6+ ?

Hi, I have a content observer that polls content://sms/ in android 1.5 so that I get notified of changes in the sms database and can react to them accordingly. However in 1.6 this doesn't work, has the uri been changed from content://sms/ to something else? I have seen content://mms-sms/ popping up in the logcat on my 1.6 device but ...

Good way to cache data during Android application lifecycle?

Hello, keeping my question short, I have creating application with 3 activities, where A - list of categories, B - list of items, C - single item. Data displayed in B and C is parsed from online XML. But, if I go trough A -> B1 -> C, then back to A and then back to B1 I would like to have it's data cached somewhere so I wouldn't have to...

Pagination For SMS in Android specifically

Hi. I had a pagination related question posted earlier. Here I went through the posted answers and suggested choices and I realized that to implement pagination in an application I could still write db level queries and ensure that I could implement pagination, even if in a crude form. However I have few follow up questions now: I am ...

custom content providers in android

I'm attempting to make a custom ContentProvider so that more than one application (activity?) has access to it. I have several questions about how to do this, How do I declare in the code that it is a ContentProvider? How do other applications (activities?) use or import the ContentProvider? ...

Android ContentProvider database query multiple tables

Hello all, I'm writing an RSS reader for Android. I've faced a certain difficulty which the problem I can't resolve since databases aren't my expertise.. So i figured out maybe one of you could help me out! I currently have 3 tables (Categories, links and feeds). My goal is too link a feed to multiple categories. Therefor I'm using a Li...

Any way to override the managedQuery method to include a limit param when using a self-made content provider?

I've built my own content provider and I've run into an instance where I need to execute a query and include a limit param. The method call to managedQuery doesn't include this param and there fore I see no way to implement this w/o somehow overriding the managedQuery method? I've created a second query method in my content provider wh...

accessing phone images through content provider in android

Hi, I need a sample code or tutorial for accessing phone images/media through content provider ? I know the following, what next ? ContentResolver cr = mContext.getContentResolver(); Cursor cursor = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null); ...

Dealing w/ Sqlite Join results in a cursor

I have a one-many relationship in my local Sqlite db. Pretty basic stuff. When I do my left outer join I get back results that look like this: the resulting cursor has multiple rows that look like this: A1.id | A1.column1 | A1.column2 | B1.a_id_fk | B1.column1 | B1.column2 A1.id | A1.column1 | A1.column2 | B2.a_id_fk | B2.column1 | B...