android-contentprovider

What is the Android sent sms intent?

有些话、适合烂在心里 提交于 2019-11-27 15:50:36
Hey! I'd like to know which is the intent android sends when it sends a message. And how can I listen for this intent in my application. I wanted that, when I send a message in native android messaging, my application listen this intent, so it will know a new message has been sent. So, which one is it, and how to listen for this intent? Thanks. plainjimbo I believe the Intent is: public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_SENT"; This guy had an article about how to build a BroadcastReceiver to do this. http://mobiforge.com/developing/story/sms-messaging

How to get a contact's facebook id or url from native contacts / content resolver?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 15:03:54
How to get the facebook id or url of a contacts that's been synced to the native contacts app via Facebook sync adapter? I went through different urls, but didn't see any info regarding facebook. I tried ContactsContract.Data.CONTENT_URI ContactsContract.CommonDataKinds.Email.CONTENT_URI ContactsContract.CommonDataKinds.Phone.CONTENT_URI ContactsContract.Contacts.CONTENT_URI as URIs already in the code below: Uri uri = ContactsContract.Data.CONTENT_URI; Cursor c = getContentResolver().query(uri, null, null, null, null); while (c.moveToNext()) { for (int i=0; i<c.getColumnCount(); i++) { Log.d

Android Permission denial in Widget RemoteViewsFactory for Content

匆匆过客 提交于 2019-11-27 14:49:04
问题 I have a widget which I am trying to use to display information from my app's local database inside of a listview. I'm using the RemoteViewsService.RemoteViewsFactory interface to load my list's contents. If I run the block of code which reloads the list in the onDataSetChanged method. the app crashes with the following message: 11-01 16:40:39.540: E/ACRA(27175): DataDisplay fatal error : Permission Denial: reading com.datadisplay.content.ContentProviderAdapter uri content://com.datadisplay

Possible to use multiple authorities with FileProvider?

最后都变了- 提交于 2019-11-27 14:33:32
问题 Background I maintain a library whose core functionality involves sharing programmatically-captured screenshots to external email applications. I use a FileProvider to accomplish this, which means my library's manifest contains a <provider> tag: <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.bugshaker.fileprovider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS"

Query Android content provider from command line (adb shell)

北战南征 提交于 2019-11-27 13:40:29
问题 There is a command to start an activity based on intent: am start . Also to send a broadcast: am broadcast . I think probably there should be a shell command to query a content provider, probably something like: query content://com.myapp.authority/path --where 'column=?' --arg 1 --order 'column desc' or similar. Is there one? 回答1: There is a content command: usage: adb shell content [subcommand] [options] usage: adb shell content insert --uri <URI> [--user <USER_ID>] --bind <BINDING> [--bind

Using @string for android:authorities in a ContentProvider

随声附和 提交于 2019-11-27 12:59:53
问题 I have a ContentProvider in my manifest, when I define them fully with hardcoded strings it works. E.g. <provider android:name="com.myprovider" android:authorities="com.myprovider"/> Works perfect, however the ContentProviders are in a library that gets used by multiple projects, and I don't want authority conflicts, so I attempted to do the following. <provider android:name="com.myprovider" android:authorities="@string/myProviderAuthority"> This way I should be able to define all my

How to properly insert values into the SQLite database using ContentProvider's insert() method through a CursorLoader?

不羁的心 提交于 2019-11-27 12:44:31
问题 I was reading the doc, but I am still not too sure. Its says to use getContentResolver() , but then that really isn't using CursorLoader. So is there a way to do it through CursorLoader ? I know how to do it with query() . Are the steps very similar? Even just a link that explains exactly this would be helpful. Please note, do not link me to the Google doc as they do not have an example that ever uses the insert() method from ContentProvider using a CursorLoader . Thanks in advance!! Edit: I

Problems with Android's UriMatcher

牧云@^-^@ 提交于 2019-11-27 12:23:32
问题 In an answer to a previous question of mine someone indicated that there is some flakiness (for lack of a better word) inherent in the Android class UriMatcher. Can anyone pinpoint the known issues with UriMatcher? I'm designing a Content Provider that relies on UriMatcher to match my Uris correctly (as opposed to incorrectly I suppose). Are there workarounds to the known issues? Or is there a better strategy for matching Uris? Example: Here is the code setting my UriMatcher private static

Good way to cache data during Android application lifecycle?

心不动则不痛 提交于 2019-11-27 12:22:59
问题 keeping my question short, I have created an 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 through A -> B1 -> C, then back to A and then back to B1, I would like to have its data cached somewhere so I wouldn't have to request the XML again. I'm new to Android and Java programming, I've googled a lot and still can't find (or simply do not have an idea where to look) a way to do

Android - Having Provider authority in the app project

会有一股神秘感。 提交于 2019-11-27 11:58:04
An android library project contains a few providers whose authority is defined like the following in a contract class : public static final String CONTENT_AUTHORITY = "my.com.library.providers.tester"; private static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY); Now there are a lot of app projects which uses this library project. The problem I am currently having is that for every app project, I need to have a separate branch in the library project for every app just for having a unique content authority. This is creating some version management problems (like