2

If an app is written for Android 2.3 will it run on 2.1?

3
  • @Matthew: This question would be fine, I agree. I'm not sure if the OP's question was the same as this one, though. By "compile an app for 2.3" he could mean "If I set the minSDK to 2.3 will it run on 2.1?" or "If I set the targetSDK to 2.3 will it run on 2.1?" Those have different answers, and would be both dev related IMHO. Your edited version is definitely more generic and could be an end-user question, which I totally agree makes it valid here. I'm just personally not sure exactly what the OP meant and if this version is equivalent. May 11, 2011 at 19:14
  • @eldarerathis That's a fair point. Setting the minSDK to 2.3 is equivalent to telling it not to run on anything lower though, right? Hopefully the OP would not being doing that and then hoping it worked on 2.1 :P May 11, 2011 at 19:17
  • @Matthew: Correct, you can't run on a version lower than your minSDK but you can run on a version lower than your targetSDK. Like I said, I just found the original question to be a kind of vague since "compile for 2.3" could really have a couple of meanings. May 11, 2011 at 19:22

2 Answers 2

6

It depends. If an application uses features present in Android 2.3, then it will not work on 2.2 or lower. If it only uses features present in older versions, then it will work on those older versions.

For example, an app written for 2.1 (i.e., an app that only uses features from 2.1 or lower) will work on 2.1, 2.2, 2.3, 3.0, and 3.1 (and any future versions, unless Google changes how things work).

2
  • The only caveat to this being sometimes the app will technically "work" because it runs without error, but if an app is not optimized for use across different devices (like when an app designed for a phone is run on a tablet) scaling issues and other subtle differences make the app less usable or sometimes completely unusable. This is more of a problem with the developer not coding their app properly, though, not an underlying compatibility issue between versions of Android.
    – newuser
    May 11, 2011 at 21:11
  • 2
    Almost correct: Some features are optional and an application that uses them may still work on a OS version which does not have the feature. For example "install to SD card". You can target 2.2 with your application and use that feature but still declare it to be working on e.g 2.1 and up. The application will work on 2.1 in this case, but without the install to SD feature.
    – user4188
    May 11, 2011 at 23:45
3

Internally Android uses so called API levels to distinguish between the various Android versions. An app records two (actually three, but this doesn't matter here) API levels within it's manifest:

  • minSdkVersion
  • targetSdkVersion

These levels can differ when, for example, the App uses a feature of a higher API level only optionally. E.g. the access to the front facing camera came with 2.3.3. If the App runs on a older version (API level) it can only access the rear camera. But the app will be installable and runnable.

So yes, if a app is written for a higher Android version it could run on a lower, but only if the app developer took care of that.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .