Training Class Recap - Building your first Android App for Drupal - SandCamp 2013


Recently, I had the opportunity to provide training on building Android apps at SandCamp in San Diego! I was excited to teach my first training class at a Drupal camp, because I like to teach, and I like Drupal. We built this app from scratch:

SandCampAndroidApp

Why Android apps? First, Android is open source, and the developer tools run on Windows, Mac, or Linux. Second, you can run the app you create in the class on your Android phone or tablet just by plugging it in, changing a simple setting on the phone, and then clicking “Play” in the Android Developer Tools. Third, a lot of the concepts for native mobile app development with Drupal (asynchronous networking, threads, list views, JSON/REST) are shared between the Android, iPhone/iPad, BlackBerry 10, and Windows Phone platforms.

I chose to teach how to build a Android 2.x style of application for this class - it was an intro class, with no expectations of knowing anything about app development or Java. Android 4 (Ice Cream Sandwich) has many new components, including the Action Bar, and Fragments, but they don’t work out of the box on Android 2.x, which is still running about 50% of Android devices.

We covered a lot of interesting topics - including Android layouts, Java classes, methods and exceptions, Android’s AsyncTask, Drupal’s Services and REST Server, Android ListViews, parsing JSON with Android, Android’s permissions, and last, loading an image off the web into an Android app.

I haven’t given a training class for a Drupal Camp before, but I found it to be very useful to me to create a training guide for the students that basically covered everything I spoke about, with lots of screenshots of how the app should look when you add this code, code listings, and discussion. It ended up being about 80 pages for a four-hour class, so it’s about half of a decent book right now.

The biggest request at the end of the class was - where should we go from here? There aren’t a lot of specific resources for building Android apps that talk to Drupal, but I can definitely recommend the Android Design web site:

http://developer.android.com/design/index.html

Before getting too deep into Android, it’s definitely important to understand how Google wants you to design apps. It’s definitely different from iOS app design, which is what you will usually find in when mobile design is discussed. Beyond that, I also highly recommend this book on Android development:

Android UI Fundamentals: Develop & Design by Jason Ostrander.

Google has an Android Developers web site, but I feel that it’s not well suited to beginning app development.

If you’re interested in Android or iOS mobile app development for Drupal, and you have any questions, feel free to contact me here through the Contact Form at the top.