tags:

views:

118

answers:

1

Hi, I'm trying to make a ticker widget for BBC News, most of it was working perfectly well last night, but I had a few issues getting the permissions for the configuration activity correct. After re-writing my Manifest nothing works at all, despite being completely how it should be as far as I can tell.

Here's my manifest:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.news.bbcwidget"
      android:versionCode="1"
      android:versionName="101">
    <application android:label="@string/app_name" android:icon="@drawable/logo" android:permission="android.permission.INTERNET" android:persistent="true" android:debuggable="true" android:enabled="true">
    <activity android:name="BBCWidgetConfig" android:permission="android.permission.INTERNET">
    <intent-filter>
    <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE">
    </action>
</intent-filter>
</activity>
<activity android:name="Launcher" android:permission="android.permission.INTERNET">
</activity>
<receiver android:name="BBCNewsWidget" android:permission="android.permission.INTERNET"><service android:permission="android.permission.INTERNET" android:name="BBCNewsService">
</service>
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE">
</action>
</intent-filter>
<meta-data android:resource="@xml/bbcnews" android:name="android.appwidget.provider"></meta-data>
</receiver><service android:name="BBCNewsWidget$BBCNewsService"></service>
</application>
</manifest> 

and here are the key bits of the errors received:

    06-19 20:06:34.339: WARN/ActivityManager(58): Permission Denial: Accessing service ComponentInfo{com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget$BBCNewsService} from pid=58, uid=1000 requires android.permission.INTERNET

    06-19 20:06:34.529: ERROR/AndroidRuntime(247): java.lang.RuntimeException: Unable to start receiver com.news.bbcwidget.BBCNewsWidget: java.lang.SecurityException: Not allowed to start service Intent { cmp=com.news.bbcwidget/.BBCNewsWidget$BBCNewsService } without permission android.permission.INTERNET

0`6-19 20:06:34.529: ERROR/AndroidRuntime(247): Caused by: java.lang.SecurityException: Not allowed to start service Intent { cmp=com.news.bbcwidget/.BBCNewsWidget$BBCNewsService } without permission android.permission.INTERNET`

06-19 20:10:51.558: WARN/ActivityManager(58): Permission Denial: broadcasting Intent { act=android.appwidget.action.APPWIDGET_DELETED cmp=com.news.bbcwidget/.BBCNewsWidget (has extras) } from android (pid=113, uid=10000) requires android.permission.INTERNET due to receiver com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget

06-19 20:10:51.558: WARN/ActivityManager(58): Permission Denial: broadcasting Intent { act=android.appwidget.action.APPWIDGET_DISABLED cmp=com.news.bbcwidget/.BBCNewsWidget } from android (pid=113, uid=10000) requires android.permission.INTERNET due to receiver com.news.bbcwidget/com.news.bbcwidget.BBCNewsWidget

It was previously giving "bad process" errors but that seems to have stopped now... From what I understand the Manifest is giving android.permission.INTERNET to all of my services, activities and the AppWidgetProvider, so I don't understand why this is happening...it used to work before!

Cheers!

+2  A: 

Add

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

To your manifest node and not to the activities

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.news.bbcwidget"
      android:versionCode="1"
      android:versionName="101">
<application 
....
</application>
<uses-permission
        android:name="android.permission.INTERNET"></uses-permission>
</manifest> 
Pentium10
Thanks very much!
Marogian
That should work well, check the syntax here: http://code.google.com/p/moonblink/source/browse/trunk/Dazzle/AndroidManifest.xml?r=645
Pentium10