I wanted to know whether an app developed in Android 3.0 runs on Android 2.1. If so, how can I do that?
If I develop the app using the libraries from 3.0 such as fragments, will it work in 2.1?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is possible to write an app targeted for 3.0 that also runs under 2.1. However, it requires careful use of libraries and the Compatibility library.
The first step is to set appropriate
android:minSdkVersionandandroid:targetSdkVersionvalues in your manifest file. This will define which range of devices will allow your app to run.The second is to ensure you do not use any API functions from later SDKs on platforms with lower versions – attempts (such as trying to use ActionBar on a 2.2 device) will cause your app to crash.
I’d strongly recommend reading Reto Meier’s articles on maintaining backwards compatibility:
http://blog.radioactiveyak.com/2011/01/how-to-use-gyroscope-api-and-remain.html
http://blog.radioactiveyak.com/2011/02/strategies-for-honeycomb-and-backwards.html
In addition, the source for Googles I/O app is definitely worth examining to see how they handle running on a wide range of devices, whilst still utilising features of Honeycomb (and later) releases.