Tutorials and Sample Code

Lists

This section lists, in alphabetical order, separately-housed collections of tutorials and sample code

  • anddev.org: large collection of tutorials, grouped by level of experience required (novice vs. advanced)
  • Android Snippets: collection of source code snippets, with comments
  • Hello Views: from the official Android site, a collection of samples for major GUI widgets and containers
  • Learning Android: A site dedicated to creating code tutorials that are both useful and up to date with the current SDK
  • SDK Sample Code: online edition of the sample code that accompanies the Android SDK
  • A blog on Android Beginner's Tutorials: a step-by-step introduction to android development concepts along with sample code to illustrate each concept separately, in a very simple way

Individual Tutorials and Samples

This section provides links to specific tutorials or sample code snippets, housed on this wiki or elsewhere, grouped into categories for easier navigation.

Complete Applications

  • Hello World: from the official Android site, the canonical "hello, world" application for Android
  • Notepad Tutorial: from the official Android site, demonstrates GUI and database access

GUI

Database

Services

  • Local Service in Android: How to create a local service, invoke a method and stop the service?
  • Remote Service: How to create a Remote Service, bind to it, invoke a method on the remote service, unbind and stop the service.

Content Providers

Miscellaneous APIs

Third-Party Code

Other Tutorials


Latest Code from Android Snippets

Create Image with Reflection

1267378500|%e %b %Y, %H:%M %Z|agohover

This takes an existing bitmap and adds a reflection to the bottom. The code is courtesy of Neil Davies at http://www.inter-fuser.com from his awesome Coverflow code (http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html).

GPS Avaiable?

1265665800|%e %b %Y, %H:%M %Z|agohover

This little snippet check, if any Location-Services are avaiable. I also tried:

LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); return manager.isProviderEnabled(LocationManager.GPS_PROVIDER)

But it failed, if GPS is turned off. Maybe it helps someone :)

GPS Avaiable?

1265665740|%e %b %Y, %H:%M %Z|agohover

This little snippet check, if any Location-Services are avaiable. I also tried: LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); return manager.isProviderEnabled(LocationManager.GPS_PROVIDER) But it failed, if GPS is turned off. Maybe it helps someone :)

send email without user intervention

1265377320|%e %b %Y, %H:%M %Z|agohover

Program to send emails from Android (works on emulator too) without user intervention. I'm looking for people to help me add attachments, and also to improve this code. Should be faster than HTTP uploads of jpeg files.

QT on Android Emulator

1264855200|%e %b %Y, %H:%M %Z|agohover

QT example on Android Emulator

Camera capturing

1264806000|%e %b %Y, %H:%M %Z|agohover

Code use simple layout with menu. When you click on option in menu, you get in preview mode of camera. With dpad button you can take picture and image will be saved on location on sd card.

NOTICE: camera preview has strange lines on phones with sytem 1.5. Looking ...

Camera capturing

1264805940|%e %b %Y, %H:%M %Z|agohover

Code use simple layout with menu. When you click on option in menu, you get in preview mode of camera. With dpad button you can take picture and image will be saved on location on sd card.

NOTICE: camera preview has strange lines on phones with sytem 1.5. Looking ...

Drwaing an image from file

1264227540|%e %b %Y, %H:%M %Z|agohover

this app actually decodes the image source and draw onto the view

Drwaing an image from file using decode resource onto a view

1264227420|%e %b %Y, %H:%M %Z|agohover

this app actually decodes the image source and draw onto the view

Drwaing an image from file using decode resource onto a view

1264227240|%e %b %Y, %H:%M %Z|agohover

this app actually decodes the image source and draw onto the view

Page tags: samples tutorials
page_revision: 18, last_edited: 1255328822|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License