PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
  • Google Cloud Print
  • Operating mode on the phone
  • Required permissions
  • 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
GglPrintDocument (Function)
In french: GglImprimeDocument
Prints a document (text or PDF file, images, Word or Excel document, ...) by using the Cloud Print service of Google.
Example
sPath is string = CompleteDir(SysDirStorageCard()) + "invoice.pdf"
IF NOT GglPrintDocument(sPath)
Error("The document was not printed.")
END
Syntax
<Result> = GglPrintDocument(<Path>)
<Result>: Boolean
  • True if the request for printing was performed (which means if the window for printer selection was displayed),
  • False otherwise. To find out the error details, use ErrorInfo.
Remark: You cannot find out whether the beginning of the print was validated by the user.
<Path>: Character string (with quotes)
Name and full (or relative) path of the document to print. This parameter can correspond to :
  • a file found in the application directory.
  • a file found on the external memory (SDCard).
  • a file included in the application from the generation wizard. In this case, only the name of the file and its extension are required. The file does not have to be extracted beforehand.
  • an online resource. In this case, the URL of the resource must be prefixed by "http" (or "https").
Remarks

Google Cloud Print

Google Cloud Print is a free service that is used to send, on the Google servers, the files that will be printed on the preset printers. Therefore, the print is performed via Internet.
To use the Google Cloud Print service:
  1. Configure the printers on the site of Google Cloud Print.
  2. In the application, use GglPrintDocument.
See the site for more details about the use conditions of Google Cloud Print service : http://www.google.com/cloudprint.

Operating mode on the phone

GglPrintDocument opens several pages in the current application.
  • If the user is not connected, a page for connecting to Google is displayed. In this page, you must type the login and password of the Google account that was used to define the printers.
  • A page proposes the different available printers. All you have to do is select the requested printer to define the print options and to start the final print.

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: INTERNET: this permission allows the applications to open the network sockets.
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.
GglPrintDocument 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.
GglPrintDocument 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.
GglPrintDocument 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
- ...
Component : wd250android.jar
Minimum version required
  • Version 18
Comments
Click [Add] to post a comment