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
  • Operating mode
  • Specific features for iPhone/iPad
  • Android specific features
  • Application in the background: Specific case from Android 10
  • Required permissions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Retrieves a photo, an image or a video stored in the photo album of the mobile device.
Example
// Sélection de l'image
// syntaxe conseillée sous iOS et Android
// Attention : Sous Android 10 et supérieure, l'application ne doit pas être en arrière-plan. 
bRes is boolean
bRes = AlbumPicker(AlbumSélecteur_Callback)

	INTERNAL PROCEDURE AlbumSélecteur_Callback(sCheminImage = "")
		IMG_MonImage = sCheminImage
	END
AndroidAndroid Widget iPhone/iPad
// Sélection de l'image
// iOS et Android : Utilisez plutôt la syntaxe avec procédure
CheminImage is string 
CheminImage = AlbumPicker()
IF CheminImage = "" THEN
	Error(ErrorInfo())
	RETURN
END
IMG_MonImage = CheminImage
Syntax
IOS Widget Not available in iOS widget mode

Select an item in the album: path returned directly Hide the details

<Result> = AlbumPicker([<Type to retrieve>])
<Result>: Character string
  • Full path of the file where the photo or the image was saved,
  • Empty string ("") if an error occurred. To get more details on the error, use ErrorInfo.
<Type to retrieve>: Optional Integer constant
Type of element that will be retrieved in the album:
albumImage
(Default value)
Select an image in the album.
albumVideoSelect a video in the album.

Note: these constants cannot be combined. A single type can be selected during the call to the function.

Select an item in the album: path retrieved in a Procedure (recommended syntax) Hide the details

<Result> = AlbumPicker([<Type to retrieve>, ] <WLanguage procedure>)
<Result>: Boolean
  • True if the image or the video was selected,
  • False otherwise.
<Type to retrieve>: Integer constant
Type of element that will be retrieved in the album:
albumImage
(Default value)
Select an image in the album.
albumVideoSelect a video in the album.

Note: these constants cannot be combined. A single type can be selected during the call to the function.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure run during the selection in the album. For more details on this procedure, see Parameters of the procedure used by AlbumPicker.
Remarks

Operating mode

When AlbumPicker is called, the user selects the desired image from the images displayed in a specific window.
Once the choice is validated, the selected image is saved:
  • AlbumPicker returns the photo save path so that it can be handled (syntax 1).
  • the specified WLanguage procedure is used to find out the photo save path so that it can be handled (syntax 2).
iPhone/iPadIOS Widget

Specific features for iPhone/iPad

The images, photos and videos retrieved by this function are copied into the "temp" directory of the application. Don't forget to delete these copies if necessary.
Note: To avoid copying recovered items, use the URISelect function.
AndroidAndroid Widget

Android specific features

  • Image selection: the selected image is copied to the application's current directory, known by the fCurrentDir function.. The returned path corresponds to the path of this copy. Don't forget to delete this copy if necessary.
    Note: To avoid copying the selected image, use the URISelect function.
  • Video selection: the video is not copied to the application directory. The returned path corresponds to the initial location of the video.
AndroidAndroid Widget

Application in the background: Specific case from Android 10

Starting with Android 10, it is no longer possible to open a window when the application is in the background.
AlbumPicker can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
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
Error on this function
Very frustrating error when using this function in Windev Mobile 25. It is changing me the path to the datafiles. After using it, al files start to bein created at the path where i Uploaded the picture. Very anoying please a solution
Aldo Vargas
29 Jul. 2020

Last update: 06/12/2025

Send a report | Local help