The Camera

Now that you know all about using existing pictures from the device, let’s make some new ones. The Camera component activates the camera in the phone and lets the user take a picture using the phone’s camera app. After the picture is taken, it returns to your App Inventor app and provides the name of the new picture for you to use.

The Camera component is simple to use, with only one procedure block and one event handler block. The procedure, TakePicture, launches the camera application. That’s all it does. Any blocks connected beneath it will run immediately. The TakePicture block does not wait for the picture to be completed—that could take whole minutes because humans take time to do things. When the user takes and is satisfied ...

Get Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.