棉花糖 6.0 的关键变化的清晰度

Clarity on the key changes of marsh mallow 6.0

我想澄清 marsh mallow 6.0 的主要变化。

作为开发人员,我们是否需要注意任何更改,而不是仅供用户使用或 OS 不影响开发的功能。

如果是,我们如何管理这些变化?例如我们需要禁用一项功能,它会导致应用程序崩溃还是会打开设置页面并要求启用 该应用程序的功能。

我对最近的变化如何影响开发人员感到非常困惑,我正在寻找一些清晰的信息。

据我所知,无需启用或禁用功能,开发人员在创建或更新应用程序时需要注意他们正在开发的目标 sdk。

最新升级中对开发者最大的改变是运行时权限。

取自:
Everything every Android Developer must know about new Android's Runtime Permission

Although Android is being keep developed but the latest update to Android M is totally different since there is some major change that would change everything like new Runtime Permission. Surprisingly it is not much talked about in Android Developer community even though it is extremely important and may cause some big trouble in the near future.

.../...

You might already feel like there is some cold wind blowing through your arms ... If you are an Android Developer, you will suddenly know that programming logic is totally changed. You cannot just call a function to do the job like previous but you have to check for the permission for every single feature or your application will just simply crash !

Correct. I would not spoil you that it is easy. Although it is a great thing for user but it is truly nightmare for us developer. We have to take coding to the next level or it will surely have a problem in both short-term and long-term.

Anyway this new Runtime Permission will work like described only when we set the application's targetSdkVersion to 23 which mean it is declared that application has already been tested on API Level 23. And this feature will work only on Android 6.0 Marshmallow. The same app will run with same old behavior on pre-Marshmallow device.

这意味着用户权限不是在安装时请求的,而是在 运行 时请求的。这是使用权限请求完成的,并且可以由用户保存一个 运行 应用程序,或作为默认值 'always'。此权限始终可以在设备设置中撤销。

由于 api 向后兼容,任何目标 sdk < 23 的设备 运行 应用程序仍然可以。

但是,如果 运行time 权限未实现且用户未能提供,这些相同的应用将不会 运行 在 android 设备 >= 6.0 且目标 sdk 为 23需要管理权限以防止应用程序崩溃。

唯一需要 运行time 权限请求的清单权限是那些被视为危险权限级别的权限,因此访问个人信息、相机等

权限是分组的,一旦为组中的一项授予权限,则为该组的其余权限授予权限。

更多详情Sytem - Permissions