日期:2014-05-17  浏览次数:20795 次

介绍一下android的各种权限。 代码如下: Html代码 <manifestxmlns:androidmanifestxmlns:an

?

介绍一下android的各种权限。

代码如下:

Html代码
  1. < manifestxmlns:android manifestxmlns:android = "http://schemas.android.com/apk/res/android" ??
  2. ??????package = "net.sunniwell.launcher" ??
  3. ??????android android:versionCode ="1"android :versionName = "1.0.1" > ??


关于自定义权限,这是很好的例子,其他apk程序要想使用Launcher的功能必须添加这些权限,而这些权限都是在这里声明的。


这个是安装快捷方式的权限定义:

Html代码
  1. < permission ??
  2. ????????android:name = "com.android.launcher.permission.INSTALL_SHORTCUT" ??
  3. ????????android:permissionGroup = "android.permission-group.SYSTEM_TOOLS" ??
  4. ????????android:protectionLevel = "normal" ??
  5. ????????android:label = "@string/permlab_install_shortcut" ??
  6. ????????android:description = "@string/permdesc_install_shortcut" /> ??




这个是卸载快捷方式的权限定义:

Html代码
  1. < permission ??
  2. ????????android:name = "com.android.launcher.permission.UNINSTALL_SHORTCUT" ??
  3. ????????android:permissionGroup = "android.permission-group.SYSTEM_TOOLS" ??
  4. ????????android:protectionLevel = "normal" ??
  5. ????????android:label = "@string/permlab_uninstall_shortcut" ??
  6. ????????android:description = "@string/permdesc_uninstall_shortcut" /> ??



这个是读取launcher.db内容的权限定义:

Html代码
  1. < permission ??
  2. ????????android:name = "net.sunniwell.launcher.permission.READ_SETTINGS" ??