Understanding WordPress for Android – Part 2

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.

AndroidManifest.xml

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 (android:targetSdkVersion="8").

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 res/values/styles.xml (http://android.trac.wordpress.org/browser/trunk/res/values/styles.xml)

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 <supports-screens>,<uses-permission> and <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: splashScreen.java !!


2 Comments on “Understanding WordPress for Android – Part 2”

  1. [...] the original: Understanding WordPress for Android – Part 2 « Anirudh's Tech Blog June 8th, 2011 | Tags: a-device-running, additional-permissions, also-best, api, cupcake, [...]

  2. Dan says:

    Well done, you’re getting a good handle on this!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,440 other followers