什么"这个方法是去precated"意味着应用程序开发人员开发人员、应用程序、方法、QUOT

2023-09-13 00:04:57 作者:魚與胸罩不可兼得

我看到不少good 甚至是整个类是德precated和过时的老有用的方法。

I see quite a few good old useful methods or even entire classes being "deprecated and obsolete".

不过,code,它用来调用这些方法继续工作。那么,这是什么意思对我来说,作为一个Android应用程序开发者?

But code that used to call those methods continues to work. So, what does this mean to me, as an Android applications developer?

在使用这种方法继续下去,只要我想,是因为新的软件开发工具包 会的总是的保持向后兼容。 它将只要我建立了较旧的目标(如API 8)工作,但 如果我从14 API建立起来,编译器将拒绝完成 构建。 两者(1)和(2) 其他? Continue using this method as long as I want, because newer SDKs will always remain backward compatible. It will work as long as I build for older targets (e.g. API 8), but if I build from API 14 up, the compiler will refuse to complete the build. Both (1) and (2) Other?

这是特别没有提供替代品时混乱,在WebView.PictureListener.html#onNewPicture.

This is especially confusing when no alternatives are provided, as in the case of WebView.PictureListener.html#onNewPicture.

推荐答案

这通常意味着有任何一个更好的做事方式,或者去precated功能有一些无法弥补的缺陷,应予以避免。你可以的一般的继续使用德precated方法,但建议您要么切换到一些新的API(在第一种情况下)或者发现做你想要的东西(在第二的其他方式)。

It usually means that there's either a better way of doing things or that the deprecated functionality had some irreparable flaw and should be avoided. You can usually keep using deprecated methods, but you are advised to either switch to some new API (in the first case) or find some other way of doing what you want (in the second).

关于 onNewPicture 特别,整个 PictureListener 界面去precated。还有什么,如果有的话,应该更换的迹象。通过@CommonsWare注释在这个线程是深思:

Regarding onNewPicture in particular, the entire PictureListener interface is deprecated. There's no sign of what, if anything, is supposed to replace it. A comment by @CommonsWare in this thread is food for thought:

可以想见,在WebKit中上游的变化正在推动德precation和PictureListener的支持可能会在将来的版本中完全失去了。

It is conceivable that upstream changes in WebKit are driving the deprecation and that support for PictureListener might be totally lost in some future release.