Sometimes, the best way to learn how things are done is to just look at some code. So here we've provided links to let you browse the source of some sample Android applications included in the Android SDK.
The SDK includes a full set of sample applications for each Android platform version in the SDK. You can find the sample applications for each platform version in this location:
<sdk>/platforms/android-<version>/samples/
You can easily add these applications as projects in your development environment, so that you can modify them and watch them execute.