android-contentprovider

What to do when - java.io.FileNotFoundException: No content provider?

≡放荡痞女 提交于 2019-11-28 22:47:32
问题 when I try to attach a file to an email, I get a java.io.FileNotFoundException: No content provider logcat output. If anyone could tell me what I am doing wrong or what I should do instead, that would be great.Thank you. This is how I add the files to the email..: Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_STREAM, uri); sendIntent.setType("video/3gp"); sendIntent.setType("video/mp4"); startActivity(sendIntent); ...and here is the entire logcat error

Master-detail Using ContentResolver.applyBatch()?

倾然丶 夕夏残阳落幕 提交于 2019-11-28 21:57:19
问题 I was wondering if its possible to save master and detail records to a content provider using the android.content.ContentResolver.applyBatch() method in the same operation where subsequent ContentProviderOperation items in the providers parameter depend on the result of previous items. The problem I'm having is that the actual Uri isn't known at the time that the ContentProviderOperation.newInsert(Uri) method is called and the Uri is immutable. What I have come up with is shown below: Master

Query Android content provider from command line (adb shell)

冷暖自知 提交于 2019-11-28 21:16:27
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? There is a content command: usage: adb shell content [subcommand] [options] usage: adb shell content insert --uri <URI> [--user <USER_ID>] --bind <BINDING> [--bind <BINDING>...] <URI> a content provider URI. <BINDING> binds a typed value to a column and is formatted:

Using @string for android:authorities in a ContentProvider

元气小坏坏 提交于 2019-11-28 20:32:05
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 authorities in a single strings.xml file and not have conflicts between apps since I should be able to change

Good way to cache data during Android application lifecycle?

青春壹個敷衍的年華 提交于 2019-11-28 19:33:47
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 what I want. Would storing all received data in main activity A (HashMaps? ContentProviders?) and then

Problems with Android's UriMatcher

喜夏-厌秋 提交于 2019-11-28 19:27:20
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 final int MEMBER_COLLECTION_URI = 1; private static final int MEMBER_SINGLE_URI = 2; private static final

Custom ContentProvider - openInputStream(), openOutputStream()

廉价感情. 提交于 2019-11-28 18:50:53
The content provider/ resolver APIs provide a complicated, but robust way of transferring data between processes using a URI and the openInputStream() and openOutputStream() methods. Custom content providers have the ability to override the openFile() method with custom code to effectively resolve a URI into a Stream ; however, the method signature of openFile() has a ParcelFileDescriptor return type and it is not clear how one might generate a proper representation for dynamically generated content to return from this method. Returning a memory mapped InputStream from a content provider? Are

How do I get the _count in my content provider?

戏子无情 提交于 2019-11-28 18:36:15
What should I do to get my content provider to return the _count column with the count of records? The documentation says it is automatic, but maybe it's only taking about some built-in content provider. Running a query to the database seems not to return it. Will If you are using ContentProvider.query() a Cursor is returned. Call Cursor.getCount() to get a count of records in the returned cursor. saurabh If you are using contentProvider then you have to do it like count(*) AS count . If you use cursor.getCount() , that would not be as efficient as the above approach. With cursor.getCount()

Android ContentProvider database query multiple tables

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 18:27:27
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 Link table. My databases is an Android ContentProvider (sqlite) and looks like the following: | Categories | | Links | | Feeds | |------------| |---------| |-------| | _ID | | Category| | _ID | | Title | | Feed | | Title | | URL | I currently wrote the following code in my

Android Content provider list

泄露秘密 提交于 2019-11-28 17:36:24
Where can I get the full list of Content Provider that Android offers out of the box? Specifically, I'm looking for a content provider that lists received SMS. The publicly available ones are listed in the android.provider package in the SDK documentation: http://developer.android.com/reference/android/provider/package-summary.html All other ones are undocumented, presumably for a reason. You are welcome to search the Android source code for those classes which extend ContentProvider , perhaps using Google Code Search . And, if you are working on improving the Android firmware, you can also