gpt4 book ai didi

java - Android更改目标sdk

转载 作者:行者123 更新时间:2023-12-01 18:34:55 25 4
gpt4 key购买 nike

我开发了一个 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com