O'Reilly logo

Pro Android Media: Developing Graphics, Music, Video, and Rich Media Apps for Smartphones and Tablets by Shawn Van Every

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

Selecting Images Using the Built-In Gallery Application

As we know, using an intent is often the quickest way to harness a capability that already exists in a pre-installed Android application. For the purposes of the examples in this chapter, let's look at how we can harness the built-in Gallery application to select an image that we might want to work with.

The intent that we'll want to use is a generic Intent.ACTION_PICK that signals to Android that we want to select a piece of data. We also supply a URI for the data that we want to pick from. In this case, we are using android.provier.MediaStore.Images.Media.EXTERNAL_CONTENT_URI, which means that we'll be selecting images that are stored using the MediaStore on the SD card.

Intent choosePictureIntent ...

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