关于Android API中的新方法和不建议使用的方法 [英] About new methods and deprecated methods in Android APIs

查看:169
本文介绍了关于Android API中的新方法和不建议使用的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是android开发的新手。

I'm new to android development.

我正在研究过时的书籍,因此我对新方法感到非常困惑。

I'm studying with outdated books, so I'm really confused about new methods.

我要制作一个既简单又轻便的应用程序,甚至可以在旧设备上运行。

I'm going to make a simple and light app which can be run even on old devices.

因此,当我创建一个新的android项目,我将 Minimum Required SDK设置为API 8,将 Target SDK设置为API 22,将 Compile With设置为API 22。

So when I created a new android project, I set "Minimum Required SDK" to API 8, "Target SDK" to API 22 and "Compile With" to API 22.

该应用程序可以在API 8的设备上运行,即使我使用了API 22的方法?

Does this setting mean the app can work on the devices of API 8, even though I use the methods of API 22?

由于不推荐使用的方法,我在问这个问题。

I'm asking this question due to deprecated methods.

我已使用弃用的应用程序完成了将近一半的开发。

I completed almost a half of my app developing using deprecated ones.

我能用新的替换掉它们吗?

Can I just replace them all with new ones?

还是我必须使用不同的方法准备多个代码以支持不同的平台版本?

Or do I have to prepare multiple codes using different methods to support different platform versions?

(不推荐使用的方法

推荐答案


Doe s这个设置意味着即使我使用API​​ 22的方法,该应用也可以在API 8的设备上运行?

Does this setting mean the app can work on the devices of API 8, even though I use the methods of API 22?

是。 min sdk版本用于限制运行操作系统的API级别<使用应用程序的minsdk。您的应用不会在这些设备的Play商店中显示。

Yes. min sdk version is used to restrict the devices running OS with API level < minsdk from using app. Your app won't be shown in the play store for those devices.


由于不推荐使用的方法,我问的是这个问题。

I'm asking this question due to deprecated methods.

由于折旧的方法,到目前为止我还没有遇到任何问题。但是,我建议使用min sdk版本作为14,因为Google引入了许多UI调整和增强功能。如果您进行了一些市场研究,则使用minsdk版本= 14可以覆盖大约85%的Android市场。

I haven't faced any issues till now due to depreciated methods. However, I would suggest to use min sdk version as 14 as Google has introduced many UI tweaks and enhancements. If you do some market research, using minsdk version = 14 would cover around 85% android market.


我可以将它们全部替换为新的吗?

Can I just replace them all with new ones?

是的,可以。


还是我必须使用不同的方法准备多个代码以支持不同的平台版本?
(旧版本已弃用的方法,新版本是否已使用新的方法?)

Or do I have to prepare multiple codes using different methods to support different platform versions? (deprecated methods for older versions, and new ones for newer versions?)

您也可以这样做。较旧的版本不支持包含片段。碎片会极大地改善平板电脑的用户体验。同样,Lollypop设备的材料设计也很棒。这是一些示例,您可以在其中选择特定于API级别的实现。但是,最好将API级别切换为> = 14

You can do it also. Older versions do not have support have fragments. Fragments improve user experience drastically for tablets. Similarly, material design for Lollypop devices is awesome. Thee are few examples where you can opt for API level specific implementation. However, it is better to switch for api level >= 14

这篇关于关于Android API中的新方法和不建议使用的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆