Question: I am working on a huge android project with tons of classes. Until now we are compiling with Android 3.2 and giving support to Android 2.3.

Now I am testing to compile with Android 5.1.1, but still giving support to Android 2.3. My surprise was that a lot of code is deprecated now... (`getWith(), getDrawable(), setBackgroundDrawable(), HttpRequest, ActivityGroup`, etc...). Those deprecated functions does not give compile error, but it gives deprecated warning.

I know that I can duplicate code and make special calls to deprecated methods if SDK\_INT is lower than XX and calls to new methods if SDK\_INT is newer than XX, but this is a huge patch, that will need a lot of duplicate code in a lot of functions in a ton of classes and packages, so, if it is possible, we prefeer to wait until we don't need to give support to oldest versions of android. It means to continue using deprecated methods until for example we only need to give support from 4.4, that will means munch less duplicated code and functions will be needed.

**The question is:** If i compile with Android 5.1.1 but still use those deprecated functions, this huge project will continue to work on all devices (from 2.3 to 5.1.1)? Now it's working compiling with Android 3.2. 

I understand that Deprecated means that they are likely to be removed in a future version of the platform and so you should begin looking at replacing their use in your code, but if it is still supported and does not give a compile error, it will work well as until now. It is what I understand of deprecation. **It is right?**

Thanks.

Answer: 
Deprecated means two things:

1. There is another (maybe better) solution
2. It isn't fully support anymore

That means that your code `could` be run fine. But Google/Android don't guarantee that.

According to [Java documentation](https://docs.oracle.com/javase/tutorial/java/annotations/predefined.html) the `@Deprecated` annotation says:

> 
> @Deprecated annotation indicates that the marked element is deprecated and **should no longer be used**. The compiler generates a warning whenever a program uses a method, class, or field with the @Deprecated annotation. [...]
> 
> 
> 

So please stop using deprecated methods. :)

Have you looked or do you know that there are [support-libraries](https://developer.android.com/tools/support-library/index.html) to help you with backward compatibility?
Yes it should work fine. But you really should use the latest methods instead of deprecated ones and use support libraries to make it compatible to the previous versions. 
All the deprecated methods that I have used have worked fine, but Google does not guarantee that they will.