6

While I'm making an Android app, Eclipse will strike out some things. More specifically, Gallery. Here is a screen shot:

enter image description here

When I hover my mouse over the warnings, it says The type Gallery is deprecated. I don't know what Deprecated means, but I do know that it's a Java term. Any help would be appreciated. Thanks!

Pshemo
  • 122,468
  • 25
  • 185
  • 269
Rob Avery IV
  • 3,562
  • 10
  • 48
  • 72
  • possible duplicate of [What does "This method is deprecated" mean for application developers](http://stackoverflow.com/questions/8449210/what-does-this-method-is-deprecated-mean-for-application-developers) – Matthieu Dec 27 '12 at 01:34

3 Answers3

14

(From the question before editing: The term is deprecated, not depreciated. It's a common typo, but worth being aware of for searching purposes :)

It's basically a bit like "obsolete" - you're encouraged not to use classes or methods which are deprecated. Typically the documentation will explain why you're not meant to use them, and give you a better alternative. The deprecated version is only present for backward compatibility, usually.

It's worth taking this seriously - a lot of the time if you're using a deprecated API, you're coming at something from a fundamentally flawed approach. Date is the clearest example of this, where the Java 1.0 API was almost entirely deprecated in 1.1, when Calendar was introduced. Using the deprecated methods in Date is a sure way of storing up problems for yourself.

See the Oracle "How and when to deprecate APIs" page for more information.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
1

Deprecated means it used to support older SDK, but not anymore. Thats why you get the warning.
It is just a warning most of the times it works, but you most be careful because it could cause problem with newer versions.

Lazy Ninja
  • 22,342
  • 9
  • 83
  • 103
1

Deprecated isn't a Java term. It is used in many other things but a lot in programming. It simply means that it is no longer supported...normally replaced with something else. The Android Docs will help you adapt it to what you need depending on what you're doing

codeMagic
  • 44,549
  • 13
  • 77
  • 93