7.2.7. Saving the Drawing to the Device’s Gallery

The app provides a Save option that allows the user to save a drawing into the device’s gallery—the default location in which photos taken with the device are stored. A ContentResolver (package android.content) enables the app to read data from and store data on a device. You’ll use a ContentResolver (Section 7.6) and the method insertImage of class MediaStore.Images.Media to save an image into the device’s Gallery. The MediaStore manages media files (images, audio and video) stored on a device.

Get Android™ How to Program, Second Edition 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.