将 Android minSdkVersion 15 更改为 19 的后果
Consquences of changing Android minSdkVersion 15 to 19
我的项目有minSdkVersion 15
,但是我需要使用AlarmManager.setExact()
功能,需要minSdkVersion 19
。
我的问题是:从 15 改为 19 会产生什么后果?
我会失去可能的应用用户吗?
如果是,那么有多少?
有什么解决方法吗?
是:不要转换(您不想失去潜在客户)。
只需检查 OS 版本是否 <19,然后使用 set()
.
否则,使用 setExact()
。就这些了。
你需要使用setExact()
的原因是
Note: Beginning with API 19 (KITKAT) alarm delivery is inexact: the OS will shift alarms in order to minimize wakeups and battery use.
There are new APIs to support applications which need strict delivery guarantees; see setWindow(int, long, long, PendingIntent) and setExact(int, long, PendingIntent).
Applications whose targetSdkVersion is earlier than API 19 will continue to see the previous behavior in which all alarms are delivered exactly when requested.
我的项目有minSdkVersion 15
,但是我需要使用AlarmManager.setExact()
功能,需要minSdkVersion 19
。
我的问题是:从 15 改为 19 会产生什么后果?
我会失去可能的应用用户吗?
如果是,那么有多少?
有什么解决方法吗?
是:不要转换(您不想失去潜在客户)。
只需检查 OS 版本是否 <19,然后使用 set()
.
否则,使用 setExact()
。就这些了。
你需要使用setExact()
的原因是
Note: Beginning with API 19 (KITKAT) alarm delivery is inexact: the OS will shift alarms in order to minimize wakeups and battery use.
There are new APIs to support applications which need strict delivery guarantees; see setWindow(int, long, long, PendingIntent) and setExact(int, long, PendingIntent).
Applications whose targetSdkVersion is earlier than API 19 will continue to see the previous behavior in which all alarms are delivered exactly when requested.