編輯:關於Android編程
The Android 6.0 application permission model is designed to make permissions more understandable, useful, and secure for users. The model moves Android applications that require dangerous permissions (seeAffected permissions) from aninstalltime permission model toruntimepermission model:
Runtime permissions provide users additional context and visibility into the permissions applications are seeking or have been granted. The runtime model also encourages developers to help users understand why applications require the requested permissions and to provide greater transparency about the benefits and hazards of granting or denying permissions.
Users can revoke application permissions using the Apps menu in Settings.
Android 6.0 requires only dangerous permissions to use a runtime permissions model. Dangerous permissions are higher-risk permissions (such asREAD_CALENDAR) that grant requesting applications access to private user data or control over the device that can negatively impact the user. To view a list of dangerous permissions, run the command:
adb shell pm list permissions -g -d
Android 6.0 does not change the behavior of normal permissions (all non-dangerous permissions including normal, system, and signature permissions). Normal permissions are lower-risk permissions (such asSET_WALLPAPER) that grant requesting applications access to isolated application-level features with minimal risk to other applications, the system, or the user. As in Android 5.1 and earlier releases, the system automatically grants normal permissions to a requesting application at installation and does not prompt the user for approval. For details on permissions, refer to
The runtime permission model applies to all applications, including pre-installed apps and apps delivered to the device as part of the setup process. Application software requirements include:
Permissions granted to applications on Android 5.x remain granted after updating to Android 6.0, but users can revoke those permissions at any time.
When integrating the Android 6.0 application runtime permissions model, you must update pre-installed applications to work with the new model. You can also define exceptions for apps that are the default handlers/providers for core functionality, define custom permissions, and customize the theme used in the PackageInstaller.
Applications on the system image and pre-installed applications are not automatically pre-granted permissions. We encourage you to work with pre-installed app developers (OEM, Carrier, and third party) to make the required app modifications usingdeveloper guidelines. Specifically, you must ensure that pre-installed applications are modified to avoid crashes and other issues when users revoke permissions.
Pre-loaded apps that use dangerous permissions must target API level 23 and maintain the Android 6.0 AOSP permission model (i.e. the UI flow during an app installation should not deviate from the AOSP implementation of PackageInstaller, users can even revoke the dangerous permissions of pre-installed apps, etc.).
Only activities can request permissions; services cannot directly request permissions.
The goal is to avoid confusing users with permission requests that appear out of context.
If desired, you can customize the Permissions UIthemeby updating the default device themes (Theme.DeviceDefault.SettingsandTheme.DeviceDefault.Light.Dialog.NoActionBar) used by PackageInstaller. However, because consistency is critical for app developers, you cannot customize the placement, position, and rules of when the Permissions UI appears.
To includestringsfor additional languages, contribute the strings to AOSP.
You can pre-grant permissions to applications that are default handlers or providers for core OS functionality using theDefaultPermissionGrantPolicy.javain PackageManager. Examples:
ACTION_CALL (Dialer) Default
SMS_DELIVER_ACTION (SMS/MMS) Default
You can define custom permissions and groups asnormalordangerousand add OEM/Carrier-specific permissions to existing permissions groups, just as you could in Android 5.x and earlier releases.
In Android 6.0, if you add a new dangerous permission, it must be handled in the same way as other dangerous permissions (requested during app runtime and revocable by users). Specifically:
Android 6.0 includes Compatibility Test Suite (CTS) tests that verify individual permissions are mapped to the correct Groups. Passing these tests is a requirement for Android 6.0 CTS compatibility.
文件下載在App應用中也用到很多,一般版本更新時多要用的文件下載來進行處理,以前也有看過很多大神有過該方面的博客,今天我也自己來實踐一下,寫的一般,還請大家多提意見,共同
前言 打造一款完整可用的Android播放器有許多功能和細節需要完成,也涉及到各種豐富的知識和內容,本章將結合Fragment、ViewPager來搭建播放器的
簡單的IM聊天程序由於項目需要做一個基於XMPP協議的Android通訊軟件。故開始研究XMPP。XMPP協議采用的是客戶端-服務器架構,所有從一個客戶端發到另一個客戶端
2014年6月26日的I/O 2014開發者大會上谷歌正式推出了Android L,它帶來了全新的設計語言Material Design,新的API也提供了這個類Vect