随笔-311  评论-598  文章-0  trackbacks-0
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package
="com.backgroundservice" android:versionCode="1"
    android:versionName
="1.0">
    
<application android:icon="@drawable/icon" android:label="@string/app_name">

        
<service android:name="TestBackgroundService"
            android:permission
="com.tigertian.permission.TEST_SERVICE">
            
<intent-filter>
                
<action android:name="android.intent.action.STORE_REQUEST"></action>
                
<category android:name="android.intent.category.DEFAULT"></category>
                
<data android:scheme="x-id"></data>
            
</intent-filter>
        
</service>
        
<!--
            <receiver android:name="ServiceReceiver"> <intent-filter> <action
            android:name="android.intent.action.STORE_REQUEST"></action>
            <category android:name="android.intent.category.DEFAULT"></category>
            <data android:scheme="x-id"></data> </intent-filter> </receiver>
        
-->
        
<provider android:name="TestContentProvider"
            android:authorities
="com.backgroundservice.TestContentProvider"
            android:multiprocess
="false" android:grantUriPermissions="false"></provider>
    
</application>
    
<uses-sdk android:minSdkVersion="3" />

    
<permission-group android:name="android.permission-group.GAMEHALL"
        android:label
="@string/gamehall_group" android:description="@string/permission_desc">

    
</permission-group>
    
<permission android:name="com.tigertian.permission.TEST_SERVICE"
        android:description
="@string/permission_desc" android:label="@string/permission_label"
        android:protectionLevel
="dangerous" android:permissionGroup="android.permission-group.GAMEHALL"></permission>
</manifest> 
一般最好声明一个权限租,所有权限都分配好组,之后给相应的Activity或者Service赋予权限。这样在安装使用程序的时候,会提示用户使用了哪一个权限组下面的哪一个权限,否则权限组名称就会变成Default。下面是使用程序:
<uses-permission android:name="com.tigertian.permission.TEST_SERVICE"></uses-permission>


---------------------------------------------------------
专注移动开发

Android, Windows Mobile, iPhone, J2ME, BlackBerry, Symbian
posted on 2010-02-18 18:20 TiGERTiAN 阅读(2406) 评论(0)  编辑  收藏 所属分类: JavaAndroid

只有注册用户登录后才能发表评论。


网站导航: