java - Android更改目标sdk

标签 java android sdk android-manifest

我开发了一个 Android 应用程序,并在 4 个月前进行了编码,当时我没有 Google Play 帐户。现在我注册了 Google Play,我想在 Play 商店中发布我的应用程序。当我检查时,我看到目标 SDK 是 17,我认为现在是 19。

我是否需要将其更改为 19 才能在最新手机上正常工作?我需要在哪里更改它?

我在 Android Manifest 文件中看到有一处:

<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

如果我将此行更改为 19,是否可以解决问题?如果有人知道请帮忙。

最佳答案

没有必要迁移到新版本的 API,您的应用程序在较新版本的 Android 中运行良好,但如果您想使用新的 SDK,则必须了解可能在您的应用程序中发生的更改
AlarmManager

中发生类似的变化

Note: Beginning in API 19, the trigger time passed to this method is treated as inexact: the alarm will not be delivered before this time, but may be deferred and delivered some time later. The OS will use this policy in order to "batch" alarms together across the entire system, minimizing the number of times the device needs to "wake up" and minimizing battery use. In general, alarms scheduled in the near future will not be deferred as long as alarms scheduled far in the future.

With the new batching policy, delivery ordering guarantees are not as strong as they were previously. If the application sets multiple alarms, it is possible that these alarms' actual delivery ordering may not match the order of their requested delivery times. If your application has strong ordering requirements there are other APIs that you can use to get the necessary behavior; see setWindow(int, long, long, PendingIntent) and setExact(int, long, PendingIntent).

Applications whose targetSdkVersion is before API 19 will continue to get the previous alarm behavior: all of their scheduled alarms will be treated as exact.

REFERENCE

关于java - Android更改目标sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22422504/

相关文章:

java - 使用 AffineTransform 从四边形变换为四边形?

Android SDK 下载没有开始

ios - 如何使用 IOS、Xcode 和 Swift 将 Moltin 更新到 v2?

java - 空指针异常apache poi

Java数组顺序反转

java - LibGDX v3.0.0 (connection error) 设置过程中,不出现第三方库

android - 在Android Studio中安装哪些SDK平台工具?

java - 离线读取和删除加密文件,无需使用 Activity 结果

android - 使用 getAllResponseHeaders 获取 HTTP 响应 header

android - Firestore 获取 DocumentSnapshot 字段的值