• How to Save Images to the Device Photo Gallery

How to Save Images to the Device Photo Gallery

Environment

Service Code (AppBuilder)
Feature Run on Device
Mobile development type Hybrid (Apache Cordova app)
Mobile OS iOS, Android

Description

When your app downloads an image on the user device, the image does not appear in the device photo gallery. This happens because the image is usually stored in the app sandbox or another private directory. Also, on Android, the app needs to trigger the OS media scanner in order to index the images in the gallery.

Solution

You can use a custom plugin to save the image in the device photo gallery. One such plugin is SaveImage. To use this plugin in your app, follow the steps below:

  1. Import the plugin in your AppBuilder project.
  2. Download your image, using the File Transfer core plugin.
  3. Use the saveImageToGallery method of the SaveImage plugin to copy the image to the device photo gallery.

You can find a fully functional sample project, demonstrating this approach here: ImageToGallery Sample.

See Also

Some plugins that deal with the same problem are listed below:

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.