Android Market now supports multiple APKs

In Android developer's blog dated 21st July 2011, Google announced Android market supporting multiple APKs. (link to the blog post). I think, this is a very positive change and the developer community will welcome it.

The developer always had a choice of creating individual APK files for specific API levels but previous to this change, it was not practical for publishing such an application on the Android market. Android market accepted only one APK per application and therefore treated individual APK files as separate applications. This did not work well for the application, as success of one APK file (user ratings and comments) could not be translated into increased downloads for a different APK file of the same application. Also it was difficult to market an application with multiple APK files (as it was impossible to create back-links to correct APK file in the Android Market based on viewer's API level).

The only choice was to create a single APK file per application and this was not a trivial task. To support different API levels in the same APK file, tricks like using reflection to make correct API calls was required. (link to the article). The "res" (resources) folder became bloated with numerous layout files, drawable resources supporting each screen size / density, landscape and portrait mode etc... and testing such an application became painstaking.The biggest drawback was that updates to an application automatically became universal. Bug fixes and updates targeting a specific API level meant that entire user base got an update, irrespective of whether it was applicable or not.

This change in the Android market will bring in several benefits for the developer.

  • Cleaner code: Each API level can have it's own APK file. This will help developer concentrate on the application logic and not worry about platform support, deprecated methods etc...
  • Easier Testing: Individual APK files will be easier to test and will hopefully improve quality of the application as a whole.
  • Targeted updates: Bug fixes and updates can be targeted per APK file, improving user experience.

For the user it hopefully means better quality applications and freedom from unnecessary updates.

As with any change, along with new opportunities, this change brings in a few challenges as well. For me the most important challenge will be to maintain code which will remain common across all APK files. A mechanism of creating symbolic links in each project to all the common files (java source, files in "res/values" folder, "res/menu" folder etc...) will have to be created.

Hopefully I will blog about it in a separate post.

Hello World

Welcome to Savitr Services' blog.

About

I am founder of Savitr Services. Savitr Services is a software development company and specializes in Android platform, CakePHP and Java.