Understanding WordPress for Android – Part 2Posted: June 8, 2011
You have set up the development environment, downloaded the source code and created a new project. Now, we can start going through the source code. I hope you are familiar with developing Android Apps. If not, it is ok. You can refer to http://developer.android.com/ in case you are not able to understand something that has been explained here. I will also be providing links to the official documentation wherever necessary.
As with every application, the WordPress app has an AndroidManifest.xml file. It is the first piece of information that describes the different activities, services, broadcast receivers, content providers, user permissions and all other important details. (To know more, have a look at http://developer.android.com/guide/topics/manifest/manifest-intro.html )
To view the manifest file, open it in Eclipse. If you don’t want to develop but just want to view it, you can view it here: http://android.trac.wordpress.org/browser/trunk/AndroidManifest.xml
Line 2. The attributes of the
<manifest> tag specify the version name, package details, etc.
Line 3. As you can see in the
<uses-sdk> tag, you can develop this app for devices that run on Android, right from Cupcake (
android:minSdkVersion="3") and is also best viewed in a device running Froyo (
Line 4 and 5: They describe the details of how the app looks before it is launched, in your android device. It specifies the logo image, label and the style. You can find the logo in your project at
res/drawable/app_icon.png and the theme it uses from Line 61 of
I will be discussing each Activity and its corresponding xml later. (Same with the service and receiver tags)
It is obvious what the remaining xml code describes. Understanding what the
<uses-feature> tags describe, shouldn’t be a problem.
Before moving on, we need to find out which activity is called first. If you have a quick look at http://developer.android.com/guide/topics/intents/intents-filters.html#ccases, the activity with the
android.intent.action.MAIN action and the
android.intent.category.LAUNCHER is started at first. A quick scan through the AndroidManifest.xml file reveals that the activity with the
android:name="splashScreen" is the one that is launched, when the application starts.
So, next stop: