Deprecated
- As Android Versions keep being updated, many APIs and their methods are being revised.
- Even though those API’s methods get deprecated, developers can still use the methods. (but they will see compiler’s warning)
- However, developers are discouraged to keep using these methods because it is dangerous or there is better alternatives.
Example
- android.widget.TimePicker
- Method name changed more simple
- Android.support.v4.view.PagerAdapter
- View in parameter changed to ViewGroup
- Reason: This makes it more obvious what the parameter refers to, improves the readability of the code and removes the need to constantly cast the Views to ViewGroups.
- https://android-developers.googleblog.com/2011/08/horizontal-view-swiping-with-viewpager.html
- android.content.res.Resources
- In Android 21(Lollipop) introduced some new theme attributes.
- So if I use deprecated getDrawable() to obtain a drawable with them attributes, logcat gives a warning.
- http://techcalibrator.com/android-getdrawable-deprecated-api-22-alternative/