ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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 application feature
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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
// Caution: On Android 10 and higher, applications must not run in the background.
bRes is boolean
bRes = AlbumPicker(AlbumPicker_Callback)
 
INTERNAL PROCEDURE AlbumPicker_Callback(sImagePath = "")
IMG_MyImage = sImagePath
END
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPad
// Select the image
// iOS and Android: Use the syntax with procedure
ImagePath is string
ImagePath = AlbumPicker()
IF ImagePath = "" THEN
Error(ErrorInfo())
RETURN
END
IMG_MyImage = ImagePath
Syntax
IOS Widget Not available in iOS widget mode

Selecting an element 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.

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

Selecting an element 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.

Remark: 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

  • Selecting an image: the selected image is copied to the current directory of the application, returned by fCurrentDir. The returned path corresponds to the path of this copy. Don't forget to delete this copy if necessary.
  • Selecting a video: the video is not copied into the directory of the application. The returned path corresponds to the initial location of the video.
AndroidAndroid Widget

Application in the background: Specific case from Android 10

From 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.
Universal Windows 10 App

Required application feature

When this function is used, an application feature is declared in the application generation wizard.
Required features:
  • Video library.
  • Image library.
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: 05/26/2022

Send a report | Local help