Reputation: 1657
I have been programming in Android for going on 2 years and I still do not know the hazards (if there are any) of using deprecated API. Most of the time I write the code I see the warning against using the deprecated code. However the latest stable version of android is 4.4 at which my app works perfectly fine using the deprecated code. What are the cons of using the deprecated code if there are any? Will the code one day stop working or is it just good practice to stay up to date?
Upvotes: 1
Views: 160
Reputation: 144
What deprecated means is that a specific part of alangauge is no longer supported =, and may or may not be removed in a later update. It is generally, then, not a good idea to absolutely rely on a deprecated class or method, in any language, not just Android. Also, it is worth noting that there is generally some sort of more efficient or safe version of the deprecated feature provided, so there is most likely a better way to write your app, albeit possibly with a fair bit of refactoring.
Upvotes: 1
Reputation: 12766
Deprecated code may be removed in future versions of the platform -- so your app may stop working on newer versions of Android for non-obvious reasons.
Generally, there's also a reason an API was deprecated in the first place -- it was often used incorrectly, it wasn't thread-safe, it had irreconcilable design flaws or something.
Upvotes: 3