Support for Android 1.5, features from Android 2.1 and lack of reflection?

I currently have an application on the market that supports Android 1.5 (SDK level 3) and higher. It also uses several features that are only present in Android 2.0 (level 5 SDK) and higher. I do this with Reflection.

I read a post on the Android developer blog that talks about how to support these new features when using no Reflection, which would be surprising. http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />

I checked this, and while it is working, there is one huge drop. Currently, if I try to add SDK level 5 class, but I do not know that this is SDK level 5 class, there is no problem. Eclipse will not find the class, and I cannot add it.

Using the Google recommended method allows me to add classes and does not give me a notification that this code is intended only for users of level 5 SDK. This opens up too much opportunity to add code that can break some users without knowing.

Does anyone know of any plugins, options, etc. that would warn me in places where I aimed at level 5 of the SDK to prevent this from happening?

+3
source share
1 answer

, , - Android android:targetSdkVersion SDK . , SDK.

+1

Source: https://habr.com/ru/post/1757332/


All Articles