O'Reilly logo

Appcelerator Titanium Smartphone App Development Cookbook - Second Edition by Jason Kneen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Capturing photos from the camera

To use the device camera, we need to access the Ti.Media namespace, and specifically the showCamera method. This will display the native operating system interface for taking photographs, and expose the three events that we need to decide what to do with the capture image. We will also check whether the user's device is capable of taking camera shots before we attempt to do all this, as some devices (including iPod Touch and simulators) don't have this capability.

Note

Note that if you're testing on iOS, this recipe will work only if you use a physical device! For Android, you should use the Genymotion simulator (https://www.genymotion.com/) and not the stock Android emulator. Genymotion is faster, integrates with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required