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
  • Photos saved
  • Backup directories
  • Required permissions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Starts the native camera application of the device in order to take a photo.
Example
sPhoto is string = PhotoRunApp()
IF sPhoto <> "" THEN
	Info("Photo sauvegardée dans le fichier : " + sPhoto)
END
// Lance l'application
PhotoRunApp(CB_PhotoLanceAppli)

	INTERNAL PROCEDURE CB_PhotoLanceAppli(sChemin is string)
		// Si le retour vaut chaîne vide (""), une erreur a eu lieu
		IF sChemin ~= "" THEN
			Error(ErrorInfo())
			RETURN
		END
		// Message de fin d'enregistrement
		Info("La photo a été enregistrée ici : " + sChemin)
	END
Syntax

Starting the native camera application (locking call) Hide the details

<Result> = PhotoRunApp()
<Result>: Character string
  • Full path of the file where the photo was saved,
  • Empty string ("") if an error occurred. To get more details on the error, use ErrorInfo.

Starting the native camera application (non-locking call) Hide the details

<Result> = PhotoRunApp([<WLanguage procedure>])
<Result>: Character string
  • Full path of the file where the photo was saved,
  • Empty string ("") if an error occurred. To get more details on the error, use ErrorInfo.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called when the photo is saved.
This procedure has the following format:
PROCEDURE <Procedure name> (<Path>)

where <Path> corresponds to the backup path of the image.
Remarks

Photos saved

The photo settings (format, resolution, size) are the ones defined in the native camera application.

Backup directories

AndroidAndroid Widget In Android applications:
  • The photo is stored on the device's SDCard and is automatically added to the album.
    From Android 11, the photo is stored in the public image directory on the external storage. This location is returned by the SysDirExternalStorage function with the ssePublicPhoto constant.
    For more details on allowed locations from Android 11, see Android 11: Changes in the behavior of applications.
  • If photos must be used in your Android applications, we advise you to work with thumbnails and not with the initial photos taken by the device. To generate the thumbnails, use VideoGenerateThumbnail.
iPhone/iPad In iPhone/iPad applications:
By default, the photos are saved in the "Documents" directory of the application.
You can also:
  • store the binary content of the image in a database, via a Memo item.
  • add the photo to the photo album of the device with AlbumSave. In this case, the image can be re-used via AlbumPicker.
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.
Business / UI classification: UI Code
Component: wd300android.aar
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/02/2025

Send a report | Local help