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
  • Background application: Specific to Android 10 and higher
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
// Select the image
// recommended syntax on iOS and Android
// Warning: On Android 10 and higher, the application must not be running in the background.. 
bRes is boolean
bRes = AlbumPicker(AlbumPicker_Callback)

INTERNAL PROCEDURE AlbumPicker_Callback(sImagePath = "")
	IMG_MyImage = sImagePath
END
AndroidAndroid Widget iPhone/iPad
// Select the image
// iOS and Android: Use procedure syntax instead
ImagePath is string 
ImagePath = AlbumPicker()
IF ImagePath = "" THEN
	Error(ErrorInfo())
	RETURN
END
IMG_MyImage = ImagePath
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.
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.
  • Video selection: the video is not copied to the application directory. The returned path corresponds to the initial location of the video.
AndroidAndroid Widget

Background application: Specific to Android 10 and higher

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.
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: 09/30/2024

Send a report | Local help