android-contentprovider

Logic code reuse between apps for Android and other platforms: To ContentProvider or not to ContentProvider?

不打扰是莪最后的温柔 提交于 2019-11-29 14:30:48
I'm developing an app which I want to make available both for Android and Blackberry (possibly to JavaME in the future). The business logic will be common to all the platforms - and hence, so will the corresponding layer in code. But I also have a data layer - which will obviously be different to the various platforms. My approach to this is to have a bean and an abstract DataStore class. If I were using Android's NotePad sample, it would look like this: Note Bean: public class Note { private long id; private String title; private String note; private long created; private long modified; /

How to grant temporary access to custom content provider using FLAG_GRANT_READ_URI_PERMISSION

谁都会走 提交于 2019-11-29 13:43:59
问题 I am trying to query custom content provider(App A) from another app(App B). I can do that when there is no permission protection for content provider. Specifically, I build custom content provider on App A and sent an intent containing the URI to App B. Here is intent-sending part in App A. class InsertOnClickListener implements OnClickListener{ public void onClick(View v) { ContentValues values = new ContentValues(); values.put(DataBaseConfiguation.TableConfiguation.USER_NAME, "Jack"); Uri

IllegalArgumentException: Invalid column

此生再无相见时 提交于 2019-11-29 13:30:49
Here is the logcat: 01-15 16:06:03.622: ERROR/AndroidRuntime(22300): Uncaught handler: thread main exiting due to uncaught exception 01-15 16:06:03.657: ERROR/AndroidRuntime(22300): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mohit.geo2do/com.mohit.geo2do.activities.TaskEdit}: java.lang.IllegalArgumentException: Invalid column due_date 01-15 16:06:03.657: ERROR/AndroidRuntime(22300): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 01-15 16:06:03.657: ERROR/AndroidRuntime(22300): at android.app.ActivityThread.handleLaunchActivity

SecurityException: Permission Denial error

大兔子大兔子 提交于 2019-11-29 13:24:24
I've just upgraded to the new version of gmail (v2.3.5) and I've got an app that queries the content provider to get details about the contacts that messages are received for...... With the latest version I'm getting the below error: java.lang.SecurityException: Permission Denial: opening provider com.google.android.gm.provider.MailProvider from ProcessRecord{40adef58 3576:com.rageconsulting.android.lightflow/10056} (pid=3576, uid=10056) requires com.google.android.gm.permission.READ_GMAIL or com.google.android.gm.permission.WRITE_GMAIL` For gmail in my manifest I'm declaring the following: <!

Broadcast Intent on contact added/edited/changed - android

随声附和 提交于 2019-11-29 12:44:16
In my app, I have a service in which I want to listen for any changes in contacts i.e., when any contact is added or edited in the native contacts app or through any other app. Is there any broadcast intent which I can register to for this purpose? Or is there any other way to achieve this? atomman Found someone with a similar problem, his solution was using RawContacts. Broadcast on contact add/change? http://developer.android.com/reference/android/provider/ContactsContract.RawContacts.html 来源: https://stackoverflow.com/questions/14038956/broadcast-intent-on-contact-added-edited-changed

What is the equivalent of Android content provider in IOS?

谁说我不能喝 提交于 2019-11-29 12:24:15
What is the equivalent of Android's content provider in iOS? Summary: A content provider manages access to a central repository of data. A provider is part of an Android application, which often provides its own UI for working with the data. However, content providers are primarily intended to be used by other applications, which access the provider using a provider client object. Together, providers and provider clients offer a consistent, standard interface to data that also handles inter-process communication and secure data access. Docs: http://developer.android.com/guide/topics/providers

Calendar event intent - startActivityForResult

落花浮王杯 提交于 2019-11-29 11:26:08
I want to create an event into the calendar from my app. I can start a new event activity with: Intent intent = new Intent(Intent.ACTION_EDIT).setData(uri); intent.setType("vnd.android.cursor.item/event"); startActivityForResult(intent, REQUEST_ID); Is it possible to get the ID of the created event ? OnActivityResult resultCode is always 0 - whether I create the event or not. The data is always null. Is there some way to do it? 来源: https://stackoverflow.com/questions/11508511/calendar-event-intent-startactivityforresult

Why my ContentObserver is not being called when I send an SMS?

点点圈 提交于 2019-11-29 11:24:54
I am trying to detect when a SMS is sent. I have searched on the web and on StackOverflow and all seems to be the same solution. I have a simple Activity that starts a Service and in the service I am trying to detect when a SMS is sent: MainActivity.java import android.os.Bundle; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.util.Log; import android.view.Menu; public class MainActivity extends Activity { Intent serviceIntent; private static MyReceiver

Android Facebook content provider authority

倖福魔咒の 提交于 2019-11-29 11:16:49
问题 I'm developing an app with (at least) two flavors having different package names - therefore actually two different apps as far as the android system is concerned. The app uses Facebook sharing, so I have the provider declared in the manifest: <provider android:authorities="com.facebook.app.FacebookContentProvider{app id here}" android:name="com.facebook.FacebookContentProvider" android:exported="true"/> This is done according to Facebook's instructions: https://developers.facebook.com/docs

Android / Google Plus - Cannot share image from my content provider

时间秒杀一切 提交于 2019-11-29 09:37:20
问题 I have used this code and can successfully share an image (from my phone's gallery) with text to google+ from my Android app. However, when I try to post an image from my app's content provider, the image is showing up on my google+ page like this... ...and that is despite the intended image being displayed fine on the google+ app preview screen. The code I am using to share is: String message = "My message"; Uri localImageUri = ContentUris.withAppendedId(DbContentProvider.CONTENT_URI