سؤال

In Android 4.1 (Jelly Beans) cannot access the APN details. When i try to access the APN details using

final Cursor apnCursor = this.context.getContentResolver().query(Uri.withAppendedPath(Carriers.CONTENT_URI, "current"), null, null, null, null);

In my program I wanna send a mms without using the Intent.

This will return a error saying I don't have write apn permission to access the APN details.

Then I added the following line to android manifest:

<uses-permission android:name="android.permission.WRITE_APN_SETTINGS"/>

this prompt the error permission is only granted to system apps.

So how can I solve this?

هل كانت مفيدة؟

المحلول

Send your MMS via the Intent.

For security reasons, you cannot read APN details without WRITE_APN_SETTINGS, and that permission requires your app to be signed by the same signing key that signed the firmware or for your app to be installed on the system partition (e.g., by a rooted device user).

نصائح أخرى

I think It is an compile bug. In my case (I want the same permission WRITE_APN_SETTINGS), after clean the project (Eclipse->project->clean). the compile error prompt will disappear.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top