This source code provides example for taking pictures and for choosing images from the system's image library.