ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Mobile specific functions / Album functions
  • Adding an image to the photo album
  • Photos found on an external memory
  • Required permissions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
AlbumSave (Function)
In french: AlbumSauve
Saves an image, a photo or a video in the photo album of the mobile device. This image can be re-used by AlbumPicker.
Example
// Save an image found in an image variable
MyImage is Image = "Test.png"
AlbumSave(MyImage)
// Save a photo
IF AlbumSave(VideoStartApp(viPictureCapture)) = False THEN
	Info("Image not saved")
END
AndroidAndroid Widget
// Save a video
IF AlbumSave(VideoStartApp(viVideoCapture)) = False THEN
	Info("Video not saved")
END
Syntax

Saves an image found in an Image variable Hide the details

<Result> = AlbumSave(<Image>)
<Result>: Boolean
  • True if the image was successfully saved,
  • False otherwise.
<Image>: Image variable
Name of the Image variable that corresponds to the image to be added to the album.

Saving an image displayed in an Image or Chart control Hide the details

<Result> = AlbumSave(<Control name>)
<Result>: Boolean
  • True if the image was successfully saved,
  • False otherwise.
<Control name>: Character string
Name of the Image control or name of the Chart control containing the image to add into the album.

Saves an image found in a file Hide the details

<Result> = AlbumSave(<Image file name>)
<Result>: Boolean
  • True if the image was successfully saved,
  • False otherwise.
<Image file name>: Character string
Full name or relative name of the image or video file that will be added into the album (name of the file returned by VideoStartApp for example).
iPhone/iPad Videos that can be added to the photo album are files with the following extensions: ".mp4", ".mov", ".avi" and ".mpg"..
Remarks
AndroidAndroid Widget

Adding an image to the photo album

When adding an image to the photo album, the image is saved in the public image or video directory, then it is referenced in the albums of the device.
The public image directory corresponds to an external memory (SD Card for example). The function will fail if this directory is not available.
AndroidAndroid Widget

Photos found on an external memory

In Android, the images and the videos found on the external memory (SDCard for example) of the device are automatically scanned by the system in order to be added to the albums.
When adding an image found in a file (syntax 3):
  • if the specified file is found on the external memory, the function will have no effect.
  • if the file is found in another directory, the file will be copied into the public directory for storing images or videos and referenced in the albums of the device.
AndroidAndroid Widget

Required permissions

Using this function automatically changes the permissions required by the application.
Required permissions:
  • READ_EXTERNAL_STORAGE: This permission allows an application to read from external storage (memory card, etc.).
  • WRITE_EXTERNAL_STORAGE: This permission allows an application to write to external storage (memory card, etc.).
  • New in version 2025
    READ_MEDIA_VIDEO: This permission allows an application to read video files from external storage.
  • New in version 2025
    READ_MEDIA_IMAGES: This permission allows an application to read image files from external storage.
New in version 2025
Note: From Android 13, when publishing to Google Play Store, READ_MEDIA_VIDEO, READ_MEDIA_IMAGES and READ_MEDIA_AUDIO permissions require a justification in the Google Play console. If necessary, you can remove permissions from the generation wizard. For more details, see Storing files in Android.
Note: This feature is only available from version 2025 Update 1.
Component: wd300android.aar
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/01/2025

Send a report | Local help