android – 2 app versions for different API levels

| | August 6, 2015

I’m currently developing an app (minimum SDK 14) using many of the new APIs. Looking at some Google statistics made me think things over – about 35% of devices still run Android versions less than 4 (2.3 Gingerbread in most cases). Since I don’t want to lose customers, I started to think about adding android 4- support, but I’d need to completely re-work the app for that.

So I thought about creating an extra version, fully optimized for SDK 9-10, whilst the other will be fully optimized for android 4.0 and above. Since I have minSDK and maxSDK options available in the Manifest, I can ensure that any user will only see the appropriate version on the Play Store. What do you think about such approach, any disadvantages (except for investing more time) that I didn’t see?

2 Responses to “android – 2 app versions for different API levels”

  1. Do not create two seperate apps. Create one app which supports multiple OS versions. Using the Android Support Library and ActionBarSherlock allows you to support Android 2.3 without too much difficulty.

    Most developers, including Google, support Android 2.3 this way in their apps.

  2. When the user upgrades their version of Android, how do they know to look for a new version of your app?

    It’s possible to adapt at runtime to the android version on the device.

    switch(Build.VERSION.SDK_INT)
    {
       case Build.VERSION_CODES.HONEYCOMB: 
    ...
    }
    

    And you can use Android Version as one of the criteria for selecting resources.

    res/layout-v12
      ...
    

    Also you may need to annotate some methods to avoid compiler warnings/errors:

    @TargetApi(Build.VERSION_CODES.FROYO)
    

    In my opinion using these techniques is easier and more reliable than supporting separate source trees.

Leave a Reply