PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
This content comes from an automatic translation.
  • Photos and videos saved
  • Backup directories
  • Required application feature
  • Application in the background: Android 10 specific case
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Starts the native camera application of device in order to record a video or to take a photo.
Remarks:
  • iPhone/iPad Remark: The syntax 2 that is using a non-locking call is recommended, especially from iOS 8.
  • Universal Windows 10 App VideoStartApp must be run in a thread.
  • In a WINDEV application, VideoCapture can be used to get a video or to take a photo by using the device camera.
  • Versions 22 and later
    This function is equivalent to CameraRunApp.
    New in version 22
    This function is equivalent to CameraRunApp.
    This function is equivalent to CameraRunApp.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
sPhoto is string
sPhoto = VideoStartApp(viPictureCapture)
IF sPhoto <> "" THEN
Info("Photo saved in the file " + sPhoto)
END
Versions 21 and later
nRecordingType is int
 
// Let the user choose the type of capture
IF Dialog( "Would you like to record a Image or a video?", ...
["One picture", "One video"], 1, 2, dlgIconQuestion) = 1 THEN
nRecordingType = viPictureCapture
ELSE
nRecordingType = viVideoCapture
END
 
// Starts the application
VideoStartApp(nRecordingType, CB_VideoStartApp)
 
INTERNAL PROCEDURE CB_VideoStartApp(sPath is string)
 
// If the return is an empty string vide (""), an error occurred
IF sPath ~= "" THEN
Error(ErrorInfo())
RETURN
END
 
// Message for end of recording
Info("The file was saved here: " + sPath)
New in version 21
nRecordingType is int
 
// Let the user choose the type of capture
IF Dialog( "Would you like to record a Image or a video?", ...
["One picture", "One video"], 1, 2, dlgIconQuestion) = 1 THEN
nRecordingType = viPictureCapture
ELSE
nRecordingType = viVideoCapture
END
 
// Starts the application
VideoStartApp(nRecordingType, CB_VideoStartApp)
 
INTERNAL PROCEDURE CB_VideoStartApp(sPath is string)
 
// If the return is an empty string vide (""), an error occurred
IF sPath ~= "" THEN
Error(ErrorInfo())
RETURN
END
 
// Message for end of recording
Info("The file was saved here: " + sPath)
nRecordingType is int
 
// Let the user choose the type of capture
IF Dialog( "Would you like to record a Image or a video?", ...
["One picture", "One video"], 1, 2, dlgIconQuestion) = 1 THEN
nRecordingType = viPictureCapture
ELSE
nRecordingType = viVideoCapture
END
 
// Starts the application
VideoStartApp(nRecordingType, CB_VideoStartApp)
 
INTERNAL PROCEDURE CB_VideoStartApp(sPath is string)
 
// If the return is an empty string vide (""), an error occurred
IF sPath ~= "" THEN
Error(ErrorInfo())
RETURN
END
 
// Message for end of recording
Info("The file was saved here: " + sPath)
Syntax

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

<Result> = VideoStartApp([<Type of capture>])
<Result>: Character string
  • Full path of file where the photo or the video was saved,
  • Empty string ("") if an error occurred. To find out the error details, use ErrorInfo.
<Type of capture>: Optional integer constant
Type of capture:
viPictureCaptureSave a photo.
viVideoCapture
(Default value)
Capture a video sequence.
Versions 21 and later

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

<Result> = VideoStartApp([<Type of capture> [, <WLanguage procedure>]])
<Result>: Boolean
  • True if the photo or video was saved.
  • False otherwise. To find out the error details, use ErrorInfo.
<Type of capture>: Optional integer constant
Type of capture:
viPictureCaptureSave a photo.
viVideoCapture
(Default value)
Capture a video sequence.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback" procedure) that will be called when saving the photo or the video.
This procedure has the following format:
PROCEDURE <Procedure name> (<Path>)

where <Path> corresponds to the backup path of image or video.
New in version 21

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

<Result> = VideoStartApp([<Type of capture> [, <WLanguage procedure>]])
<Result>: Boolean
  • True if the photo or video was saved.
  • False otherwise. To find out the error details, use ErrorInfo.
<Type of capture>: Optional integer constant
Type of capture:
viPictureCaptureSave a photo.
viVideoCapture
(Default value)
Capture a video sequence.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback" procedure) that will be called when saving the photo or the video.
This procedure has the following format:
PROCEDURE <Procedure name> (<Path>)

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

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

<Result> = VideoStartApp([<Type of capture> [, <WLanguage procedure>]])
<Result>: Boolean
  • True if the photo or video was saved.
  • False otherwise. To find out the error details, use ErrorInfo.
<Type of capture>: Optional integer constant
Type of capture:
viPictureCaptureSave a photo.
viVideoCapture
(Default value)
Capture a video sequence.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback" procedure) that will be called when saving the photo or the video.
This procedure has the following format:
PROCEDURE <Procedure name> (<Path>)

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

Photos and videos saved

The parameters of the photos and videos saved (format, resolution, size) are the ones defined in the setting of native application for taking photos.

Backup directories

AndroidAndroid Widget In the Android applications, the photo or the video is stored on the SDCard of the device and it is automatically added to the album.
Versions 17 and later
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.
New in version 17
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.
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 the iPhone/iPad applications:
By default:
  • the photos are saved in the "Documents" directory of application.
  • the videos are saved in the "tmp" directory of application.
For the images, you can also:
  • store the binary content of the image in a database, via a Memo item.
  • add the photo to the camera's photo album using the AlbumSave function. In this case, the image can be re-used via AlbumPicker.
The path returned by the function (syntax 1) or found in the procedure (syntax 2) has the following format:
/private/var/mobile/Containers/Data/Application/D235EF25-455B-4362-8941-0FD09C1D693D/Documents/photo504031018058.jpg
The directory (identified by "D235EF25-455B-4362-8941-0FD09C1D693D") can be renamed whenever the application is installed and updated.
In an iPhone/iPad application, you must only store the file name and extension in order to re-create the path by programming to access the photo.
Reminder: To rebuild the full path of photo, all you have to do is use fDataDir.
Versions 21 and later
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of several application features in the wizard for generating the application.
Required features:
  • Microphone: This feature allows the applications to perform audio recordings.
  • WebCam: This feature allows the applications to capture videos or photos.
New in version 21
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of several application features in the wizard for generating the application.
Required features:
  • Microphone: This feature allows the applications to perform audio recordings.
  • WebCam: This feature allows the applications to capture videos or photos.
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of several application features in the wizard for generating the application.
Required features:
  • Microphone: This feature allows the applications to perform audio recordings.
  • WebCam: This feature allows the applications to capture videos or photos.
Versions 25 and later
AndroidAndroid Widget

Application in the background: Android 10 specific case

From Android 10, it is no longer possible to open a window when the application is in the background.
VideoStartApp 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). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
New in version 25
AndroidAndroid Widget

Application in the background: Android 10 specific case

From Android 10, it is no longer possible to open a window when the application is in the background.
VideoStartApp 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). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
AndroidAndroid Widget

Application in the background: Android 10 specific case

From Android 10, it is no longer possible to open a window when the application is in the background.
VideoStartApp 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). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
Related Examples:
WM Expense Account Cross-platform examples (WINDEV Mobile): WM Expense Account
[ + ] This example allows you to manage your fees.

Let's see the main features of this application:
- The input of invoices
- Management of foreign currencies
- Inclusion of photo document for the invoices
- Ability to email the expense account
- Ability to track the expense accounts
- ...
Business / UI classification : UI Code
Component : wd250java.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment