Posts Tagged ‘twitternator-tutorial’

Ground-Up Android, Part 5: Tweeting and Debugging

Wednesday, October 7th, 2009

This is part 5 of a 5-part series on introductory Android development. If you’re just arriving, you should head on over to Part 1. Warning: While the general ideas and Android-specific code contained here still apply, the Twitter-specific portions are now outdated thanks to the so-called “OAuthocalypse,” Twitter’s phasing out of HTTP basic auth.

In Part 4, we dug into accessing our Views from our Activity’s code, and registered an OnClickListener to handle the user’s interactions with our button. In the final part (a big one!) we’ll cover using J2SE libraries, debugging, and Android permissions.

So far we’ve gotten a lot done without too much “boilerplate” coding, and that’s great. But what we don’t have (yet) is an application that leaves its mark on the world. After all, what’s a Twitter application if people can’t benefit from your 140 characters of deep, meaningful insight into the state of the world (or what you ate for breakfast)?

(more…)

Ground-Up Android, Part 4: Writing the Code

Wednesday, October 7th, 2009

This is part 4 of a 5-part series on introductory Android development. If you’re just arriving, you should head on over to Part 1.

In Part 3, we defined our layout and prettied up our app’s main screen. Now let’s get to the business of real coding – the stuff that makes the app tick behind the scenes.

(more…)

Ground-Up Android, Part 3: Describing Your Layout

Wednesday, October 7th, 2009

This is part 3 of a 5-part series on introductory Android development. If you’re just arriving, you should head on over to Part 1.

In Part 2, we started an Android project, poked around it a little, and launched an emulator. Now we’ll move on to making the app look like what we want.

You’ll notice I titled this part “Describing Your Layout,” not “Coding Your Layout” or “Programming Your Views.” This is because Android gives you the tools to define most of the characteristics of your Activity’s visuals in descriptive, not procedural terms. This helps speed up development, thanks to the nice GUI-based tools for layout, and helps you keep your programming logic out of the places you define your application’s outward appearances (and vice versa). It’s important to know that you could create your entire app in Java, writing the descriptive code for your layout procedurally in your Activity instead, but it’s a much better idea to keep things separate wherever possible.

The resources

We’re going to build a basic Twitter client, so let’s make it look like one. Let’s switch back into Eclipse and poke around at what we have so far. You’ll recall that besides our Activity’s Java file, we have layout and strings files in the res/layout and res/values folders. Let’s go check them out.

Here’s the basic layout the wizard created for us in res/layout/main.xml:

the main layout xml

The main layout xml

(more…)

Ground-Up Android, Part 2: Our First Project

Wednesday, October 7th, 2009

This is part 2 of a 5-part series on introductory Android development. If you’re just arriving, you should head on over to Part 1.

In the first part of the tutorial, we got Eclipse, the Android SDK, and the ADT set up. In this part, we’ll get into our environment, create our first project and poke around in it, and test out the Android emulator.

Fire It Up

Go ahead and fire up Eclipse, and if it asks, choose a workspace (the default’s probably fine for now). Click on the “new android project” button or go to File -> New -> Android Project.

Click the New Android Project button.

Click the New Android Project button.


(more…)

Ground-Up Android: Getting Started with App Development

Wednesday, October 7th, 2009

This is part 1 of a 5-part series on introductory Android development. Warning: While the general ideas and Android-specific code contained here still apply, the Twitter-specific portions are now outdated thanks to the so-called “OAuthocalypse,” Twitter’s phasing out of HTTP basic auth.

Thinking about testing the waters with Android development? Jump right in. We’ll build a neat little application that interacts with a web service.

Yup.

Yup.

Which one? Twitter, of course.

This is a web form of a talk I gave with Henry Cipolla, CTO of Localytics, at BarCamp Boston 4 and in a longer form at FITC Mobile 2009, updated to cover the 1.6 (“Donut”) release of the Android SDK. The slideshow portion of that talk covers the basic concepts of the platform and slides are available online. I recommend checking it out.

(more…)