New Android releases are coming out, now, in the beginning its a good time to start thinking about compatibility between this releases. How do we know if our application will run in a 1.1 device, if we work with 1.5 SDK? With the new compatibility system, we can indicate the minimum version of the Android system required to run the application.
This new SDK version has been identified like the “Level 3 API”, we consider the 1.0 → Level 1, and the 1.1 → Level 2. With this nomenclature, we always know which API we are talking about.
How can we point an application as a API level compatible? You have to add a android:minSdKVersion attribute to the manifest file of your App.
This way, you are telling the application that its compatible only with the latest version, the 1.5.
We have to be very careful with the AVD we create to test the application, remember that we can create an Emulator with the SDK we want. Have a look to the first article of the series.
If we create a new 1.5 SDK project or if we migrate an older project to the new SDK, you will notice some changes in the architecture.
One of the changes is related to the location of the R.java file. If you remember this is the resource file, the bridge between the Android code and the resources (images, layouts, music…). In older SDKs this file was in the same folder as the main activity. Now, its in a separate folder called “gen” where all generated (and no modifiable) Java files is stored. Now, there is only the R.java file, but…who knows if in the future this changes and new stuff will be placed here.
We can see that a new file has appeared, in the project folder: default.properties. If we open it, we can see a text file. This file is used in Version systems to check system compatibility and also to configure different properties in the build system (If we are using Ant, for example).
We will delve deeper in this new SDK in further articles!
This post is part of the series: How-to develop Google Android applications: SDK 1.5 “Cupcake”
In this serie of articles, we will learn a bit more about the new Android SDK (1.5) alias “Cupcake”