h1

Android: Week 1

November 29, 2007

Getting Started

Over the long Thanksgiving weekend, I downloaded the Android SDK and spent some time playing around. Here are a few recommendations for getting started, and my first take on understanding the Android development environment:

  1. Read everything on the official Android site.
  2. Did you read everything yet? No? Repeat Step 1. Seriously, it’s pretty easy reading, and incredibly useful.
  3. Join the Google Android groups and see what people have to say.
  4. Download and install the SDK. Need instructions on installing the SDK? It’s just a jar file, not much to know. That said, if you still have questions, Repeat Step 1.
  5. Get Eclipse and the Android plug-in. Now I’m no Eclipse zealot. I’m old and cranky, and my first inclination is to do everything by hand (that’s the way we did it in my day, and that’s the way we likesed it). So I set out to build everything with my old friends Gvim and Ant. After an hour so of punching myself in the face, I decided the docs weren’t lying, so I gave up and installed the plug-in. So you use IntelliJ, Netbeans, etc….tough shit! For the time being at least, just consider it a requirement to do your development in Eclipse.
  6. Install the run the samples. If you can follow directions, you can get them running. Simple, and kind of cool. I’m only of average intelligence, and total time from start of SDK download to seeing “Hello, World” in the Android emulator was less than 20 minutes.
  7. Update some of the samples. Yeah, it’s lame, but you know you want to put your name in “Hello, World”.

android1

* – This screencap was captured using Jing, a lovely tool. Go support them; everything is free, you can do screencaps or screencasts, and it’s all completely intuitive.

My Understanding So Far

OK, I have to admit, the following is more for me than it is for you. It’s helps me to understand new concepts when I have to write them out. So here’s how I understand Android so far. Read at your own risk….

What is Android?
Like almost everything else, Android is a layer of abstraction. An interface to build applications for mobile phones in a device-independent manner.

Why should anybody care?
Platform independence and a standard API will encourage the development community to innovate. The ability to offer location-based services is a huge deal. When everyone’s carrying a cell phone, and they can opt to share info. on their where-abouts, a whole new world of possibilities opens up. I suppose there are ethical big-brother like questions to consider here, but…meh, somebody else will worry about that.

What are the common components of an Android program?

  • Activities – These are just screens. Each activity/screen in your application is backed by a Java class.
  • Views – The GUI components of your application. Can be created in code, in good MVC form, Android allows you to model your views in xml. Activities get tied to views by calling the setContentView(myView) method. The map between Activities and their xml views is maintiained in an auto-generated (By Eclipse Plug-in) file named R.java. I have no idea why the file is named “R.java”. You can take action on views (i.e. set focus), and you can register event listeners (i.e. on focus) on them.
  • Intents – Actions. Intents are used to transition between Activities, and can also be broadcast to other applications in the background.
  • Intent Receiver – An intent listener. Listens for asynchronous Intent messages, possibly from external applications.
  • Intent Filter – Used to define what Intents an Activity or Intent Receiver can handle. For instance, if you’re just displaying a picture in MyPictureActivity, you’d add an Intent Receiver in AndroidManifest.xml declaring MyPictureActivity’s ability to VIEW.
  • Services – Just like a desktop or server service, a long-running, background, Android process.
  • Content Provider – A wrapper for sharing arbitrary data (i.e. text, video, audio, etc) between applications.

Wow, I don’t know much, but what can you do? Maybe tomorrow I’ll have a better handle on things as I’m off to go through the Notepad Tutorials now. Until later…take care.

One comment

  1. You lost me at “GUI components” but I like the way you write.



Leave a Comment