Tag Archives: android

How to read the official Android documentation

I worked on a few Android apps 3 years ago as a college student. Since then, I got into a full-time job in a different role, stopped working on those Android apps and went about learning other software stacks. About 2 months ago, I decided to experiment with Android again.

That is when I noticed that the Android world had changed considerably. The UI had got a lot more polished, developers had become more focused on writing great quality apps and almost every iOS development team had begun to port their apps to Android also ensuring that they weren’t sub-par to their iOS counterparts anymore.

This was widely because of the standards Google had adopted and I was tempted to read the official Android documentation at developers.android.com again, after so many years. This post is based on my experience with reading the documentation.


Design

It has become very important for Android developers to get a measure of how Android apps are supposed to look and feel, instead of throwing buttons and poorly-styled views all over the place, because Android users have high expectations from Android apps too.

The Design section will help you get started on the common patterns you should follow when designing your app. (The Videos section at the bottom might take a long time, so it’s better to skip them at the beginning and view them at a later point of time, if you are a developer.)

Develop

As you might notice, there are many sections under the Develop tab in the documentation. I would suggest the below order.

API Guides

Although this is not the first section, you would understand other sections better if you complete the Introduction and App Components sub-topics in this section, first.

Training

After completing the 2 sub-topics in API Guides, head over to the Training section and complete all the sub-topics here (this might take quite a while). Once you are done, head over to API Guides again and complete the remaining sub-topics over there.

Tools

There is a rather large list of first-party tools provided by Google and you can read about them in the Tools section.

Google Services

Google also provides a number of services like in-app purchase billing, Google Cloud Messaging, integration with Google Maps, Google+, etc. You can read about them in the Google Services section.

Samples

Once you are done reading, it is time to download the sample apps from the Samples section, play around with them and understand the code.

Reference

You would have completed most of the Android documentation by now, and the only part remaining would be to go through the References section whenever you’re using the respective Android API’s (or when you are bored).


Note that going through the complete documentation (excluding the Reference section, of course) is a long process and it might take a few weeks to complete it, if you’re reading it casually. Use this post as a companion guide for reading the documentation, until you’re done.

Understanding WordPress for Android – Part 2: How the app works

This post is Part 2 in a series of posts in trying to understand the source code of WordPress for Android. You can find the previous post here: Understanding WordPress for Android – Part 1

How the app works:

First, we need to get a high-level overview of how the app works. (Note that the screenshots were taken on a 10-inch tablet and have been scaled to a smaller size. The experience on a phone may differ slightly.)

As soon as you launch the app, you are presented with a login screen, asking for your username and password. You also have the option to create an account and add a self-hosted WordPress site.

Login Page

Once you login, you will notice a side pane with different items in a list. This is very similar to the side pane you see when you view your WordPress Dashboard in a desktop browser.

Dashboard pane

Clicking on an item in the list opens its corresponding view in the main pane on the right and the side pane disappears when in portrait mode. For example, when we click Stats in the side pane, this is how it appears:

Stats section

The app also is responsive to the orientation of the device. For example, when I hold the tablet in Landscape mode, this is how the Stats section appears.

Stats in Landscape

You can also find an Action Bar at the top with different buttons, which are context-sensitive to the item chosen in the side pane.

ActionBar

That brings us to the end of the high level overview. We will discuss how each component works, in detail, in upcoming blog posts.

Understanding WordPress for Android – Part 1

WordPress for Android is an Open Source project released under the GNU GPL. The app’s complexity lies somewhere between simple and advanced, which makes it interesting to contribute to. This makes the learning curve not very hard and at the same time, one can learn a lot on Android development when you peek under the hood. You can find the source of the WordPress for Android app here: https://github.com/wordpress-mobile/WordPress-Android WordPress for Android uses Gradle as its build system. If you are not familiar with Gradle or any build system at all, this link useful might help you: http://tools.android.com/tech-docs/new-build-system/user-guide

Android default files and directories:

Some of these directories and files are present in any Android project, by default. You would want to read this official documentation on Android projects before proceeding below. I will not be explaining them, unless necessary.

Releases:

There seems to be more than one release version of this app: main, release, debug and zbetagroup.

WordPress-Android

Let us look at the root level of the project in this blog post. I will try to explain (or point to links that explain) some basic Android concepts along the way, as well.

Directories:

Files:

  • .classpath – Tells the java compiler where to look for user-defined classes and packages
  • .gitattributes – A simple text file that gives attributes to pathnames
  • .gitignore – Files matching the pattern mentioned here are not tracked by Git
  • .project – Contains project description. Not sure of its significance, yet.
  • AndroidManifest.xml (Android default)
  • AndroidManifestBetaGroup.xml – Seems to be related to the zbetagroup version of the app.
  • AndroidManifestReleaseAndDebug.xml – Seems to be related to the release and debug version of the app.
  • build.gradle – Gradle build script. This is where the Gradle project is defined.
  • build.xml (Android default)
  • custom_rules.xml – Defines custom rules for Ant. Not sure why it is present here (maybe the project was migrated from Ant to Gradle).
  • default.properties – Some default properties. Not sure of its significance, yet.
  • gradlew – The Gradle Wrapper file for Unix-based systems
  • gradlew.bat – The Gradle Wrapper file for Windows systems
  • lint.xml – Improving your code with lint
  • local.properties-example – Rename this to local.properties (Android default) and add the SDK path as instructed in the README file
  • proguard-project.txt – ProGuard
  • project.properties (Android default)
  • readme.md – README files generally provide instructions on how to get started with the project. It is now very common for any project in Github, as Github displays the contents of the root-level readme.md at the project home page itself.

I will keep this post updated as I understand the significance of some files. Watch out for future posts in this series.


Update: The second post in this series is now available here: https://anirudh24seven.wordpress.com/2014/03/02/understanding-wordpress-for-android-part-2/