kikurself
kikurself

Reputation: 153

Android programming and compatability between different versions

Hello I just had a question about compatibility between the different versions of Android and how it works. I have recently started Android programming and have been developing an app for Ice Cream Sandwich 4.0.2 is the source I am working with. Now halfway to completion of this project I started to wonder if this would work at all with lower versions of Android such as Gingerbread. From what I am guessing I don't think it will work. How can I make this compatible with Gingerbread and still use features that have come with Ice Cream Sandwich, like Action Overflow or whatever that is called and the Holo themes. Do I make 2 versions of my app or is there a certain way that will put the app through conditions to determine what version of Android the phone or tablet is running and go from there? Thank you in advance!

Upvotes: 1

Views: 1369

Answers (3)

Scott W
Scott W

Reputation: 9872

Yes, you can absolutely create a single app that runs on many versions of Android. As you might imagine, you have to write most of your code to the oldest version of Android that you want to support. Any features you want to use from newer versions will have to be more carefully thought out. For some features, you may choose to support them only on the newer versions of the OS (e.g. when they really only make sense or are really only possible with the latest hardware). For other features, you will want to look into ways to replicate the behavior you need on older platforms (e.g. ActionBar, Fragments, Animators).

There are lots of resources available for helping with backward compatibility. In particular, you probably want to take a look at these:

  1. Support Library
  2. ActionBarSherlock
  3. NineOldAndroids

Upvotes: 1

telkins
telkins

Reputation: 10540

You can still include everything in your one app. You might not necessarily be able to use the Holo theme on Gingerbread unless you custom skin it yourself. As for handling different features I would read this:

http://developer.android.com/training/basics/supporting-devices/platforms.html

Also, compatibility libraries will be your friend. I would look into the V4 support library as well as ActionBarSherlock.

Upvotes: 1

MAC
MAC

Reputation: 15847

You can make your app compatible with Gingerbread it will work on both Gingerbread as well as Ice Cream Sandwich

Android provides forward compatibility.

If you have developed your app in lower version then it will work on above version sure.

To detect current version see this

Upvotes: 1

Related Questions