What is the purpose of both target API and minSDK
Posted
by Scott Ferguson
on Stack Overflow
See other posts from Stack Overflow
or by Scott Ferguson
Published on 2010-05-03T00:28:57Z
Indexed on
2010/05/03
0:38 UTC
Read the original article
Hit count: 698
android-sdk
|android
Can somebody explain to me the difference between the project target and the minimum SDK? I want my app to run on Donut devices, and the APK I built with a target of 7 worked just fine. When I set an explicit minimum SDK in the Android manifest of 4 (1.6) the compiler bitched at me that the target exceeded the minimum. I reset the target to 4 only to see what would happen, and now I've got compiler errors. An example is the START_NOT_STICKY constant in android.app.Service. It doesn't exist in API level 4, but does exist in API level 7. This is also the case with Service.onStartCommand(). In API level 7 you need to explicity override this method, whereas in API level 4 you don't.
So why does the app work in 1.6 despite all this? How could 1.6 know how to use SERVICE_NOT_STICKY when the associated API level doesn't know about it?
© Stack Overflow or respective owner