android-contentprovider

SGS-3 bug related to SMS conversations list?

試著忘記壹切 提交于 2019-12-17 19:05:43
问题 This issue was reported several times, but still not resolved yet. I read all messages/thread which somehow related to this topic either in Samsung's developers site or in StackOverflow Let me again describe whole problem just in few words: Developers used to get list of SMS conversations through simple query like: Uri.parse("content://mms-sms/conversations/"); Cursor cursor = context.getApplicationContext().getContentResolver().query(uri, null, null, null, null); or something like this. Key

IllegalArgumentException: the bind value at index 1 is null

依然范特西╮ 提交于 2019-12-17 18:39:13
问题 Does anybody know what this means? 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): Caused by: java.lang.IllegalArgumentException: the bind value at index 1 is null 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:234) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:182) 12-31 20:55:45.861: ERROR/AndroidRuntime(12478): at android.database.sqlite

When should I call close() on SQLiteOpenHelper used by ContentProvider

风流意气都作罢 提交于 2019-12-17 18:37:35
问题 In my android app, I use SQLiteOpenHelper to implements ContentProvider. Query, add, delete operations are all through ContentProvider. But in one of my android phone(htc g13), I found *.db-wal file in directory /data/data/[package name]/databases. And the file size increate very fast when operating with ContentProvider. It occupied user RAM space too much. It is recommended to close the SQLiteOpenHelper to solve my problem (it is useful) in post enter link description here. But I want to

using ContentProviderClient vs ContentResolver to access content provider

≯℡__Kan透↙ 提交于 2019-12-17 17:24:50
问题 The documentation on Android content providers describes using a ContentResolver , obtained from getContentResolver() , to access the content. However there is also a ContentProviderClient , which can be obtained from getContentResolver().acquireContentProviderClient(authority) . It seems to provide more or less the same methods available in the ContentResolver for accessing content from the provider. When should I use a ContentProviderClient instead of just using the ContentResolver directly

How to put a video file in android custom content provider

╄→尐↘猪︶ㄣ 提交于 2019-12-17 16:55:12
问题 I have a video file. i want to store it in a custom content provider. and after that i want to read it and want to play it through Uri. Below is my code. package com.videocon.nds; public class FileProvider extends ContentProvider { public static final Uri CONTENT_URI=Uri.parse("content://com.videocon.nds/"); private static final HashMap<String, String> MIME_TYPES=new HashMap<String, String>(); static { MIME_TYPES.put(".mp4", "video/mp4"); } @Override public boolean onCreate() { File f=new

Best practices for exposing multiple tables using content providers in Android

纵然是瞬间 提交于 2019-12-17 14:59:05
问题 I'm building an app where I have a table for events and a table for venues. I want to be able to grant other applications access to this data. I have a few questions related to best practices for this kind of problem. How should I structure the database classes? I currently have classes for EventsDbAdapter and VenuesDbAdapter, which provide the logic for querying each table, while having a separate DbManager (extends SQLiteOpenHelper) for managing database versions, creating/upgrading

can we get chrome browsing history/bookmarks in our android app

爷,独闯天下 提交于 2019-12-17 07:15:44
问题 can we get chrome browsing history/bookmarks like we get in default browser using READ_HISTORY_BOOKMARKS permission? PS:I Just want to know is it possible? 回答1: Yes it is very much possible. Use this uri: content://com.android.chrome.browser/bookmarks instead of Browser.BOOKMARKS_URI String[] proj = new String[] { Browser.BookmarkColumns.TITLE,Browser.BookmarkColumns.URL }; Uri uriCustom = Uri.parse("content://com.android.chrome.browser/bookmarks"); String sel = Browser.BookmarkColumns

can we get chrome browsing history/bookmarks in our android app

寵の児 提交于 2019-12-17 07:15:15
问题 can we get chrome browsing history/bookmarks like we get in default browser using READ_HISTORY_BOOKMARKS permission? PS:I Just want to know is it possible? 回答1: Yes it is very much possible. Use this uri: content://com.android.chrome.browser/bookmarks instead of Browser.BOOKMARKS_URI String[] proj = new String[] { Browser.BookmarkColumns.TITLE,Browser.BookmarkColumns.URL }; Uri uriCustom = Uri.parse("content://com.android.chrome.browser/bookmarks"); String sel = Browser.BookmarkColumns

How to use SMS content provider? Where are the docs?

帅比萌擦擦* 提交于 2019-12-17 07:08:03
问题 I'd like to be able to read the system's SMS content provider. Basically I wanted to make an SMS messaging app, but it would only be useful if I could see past threads etc. It seems like there's a content provider for this, but I can't find documentation for it - anyone know where that is? Thanks -------- edit ----------- Ok I found a way to get the sms inbox provider, and I just dumped all the column names in that provider, looks like this: Uri uriSms = Uri.parse("content://sms/inbox");

CursorLoader not updating after data change

我怕爱的太早我们不能终老 提交于 2019-12-17 06:29:29
问题 I have created a small application, trying to understand the functionality of the LoaderManager and CursorLoader -classes. I have implemented LoaderCallbacks<Cursor> on my FragmentActivity -class and everything works fine, except the fact that when I update my data via ContentResolver.update() or ContentResolver.insert() -methods, onLoadFinished() is not called and as a result my data doesn't update. I have a custom ContentProvider and I am wondering if the problem is in my ContentProvider