Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
438 views
in Technique[技术] by (71.8m points)

android - What does "This method is deprecated" mean for application developers

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

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

  1. Continue using this method as long as I want, because newer SDKs will always remain backward compatible.
  2. 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.
  3. Both (1) and (2)
  4. Other?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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).

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:

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...