AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones específicas para móviles / Funciones URI
  • Miscellaneous
  • Aplicación en segundo plano: Caso concreto de Android 10
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Opens a system window to select or create a resource from:
  • the device file system,
  • the Cloud (Google Drive, Microsoft OneDrive, etc.)
  • one of the content managers installed on the device.
Ejemplo
AndroidWidget Android
// Open the system window to select an image or a pdf
UriResource is URI = URISelect(uriImage + TAB + "application/pdf")
IF NOT ErrorOccurred THEN
	// Displays the name of the selected resource
	Info(URIGetInfo(UriResource, uriInfoName))
END
iPhone/iPad
// Open the system window to select an image or a pdf
URISelect(MyProcURISelect, uriImage + TAB + "application/pdf")

INTERNAL PROCEDURE MyProcURISelect(Success is boolean, Result1 is URI)
	IF Success = True THEN
		// Displays the name of the selected resource
		ToastDisplay(URIGetInfo(Result1, uriInfoName))
	END
END
Sintaxis
AndroidWidget Android

Selecting or creating a resource (synchronous code) Ocultar los detalles

<Result> = URISelect([<MIME types> [, <Mode> [, <Document name>]]])
<Result>: URI variable
  • URI that corresponds to the selected resource.
  • If an error occurs, the ErrorOccurred variable is set to True. To get more details on the error, use ErrorInfo.
<MIME types>: Optional character string or constant
  • List of MIME types of selectable files, separated by TAB.
  • One of the following constants:
    uriAudioAllows all types of audio files.
    uriImageAllows all types of image files.
    uriVideoAllows all types of video files.

    Note: Constants can be concatenated by separating them with TAB.
If a specified MIME type is not known by the system, it will be ignored.
If this parameter is not specified, all files will be selectable.
AndroidWidget Android On Android, files that do not match the specified MIME types will be visible but users will not be able to select them.
<Mode>: Optional Integer constant
Selection mode:
uriCreateOpens the picker in "Creation" mode to create a new document. The default name of this document can be specified in <Document name>.
uriOpen
(Default value)
Opens the picker in "Open" mode to open an existing document.
<Document name>: Optional character string
Default name of the document to be created when the picker is open in creation mode. This parameter is taken into account only if <Mode> corresponds to the uriCreate constant.
AndroidWidget Android iPhone/iPadIOS WidgetMac Catalyst

Selecting or creating a resource (asynchronous code) Ocultar los detalles

URISelect(<WLanguage procedure> [, <MIME types> [, <Mode> [, <Document name>]]])
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called for the selected file. This procedure is called when the user closes the URI selection window. For more details on this procedure, see Parameters of the procedure used by URISelect.
<MIME types>: Optional character string or constant
  • List of MIME types of selectable files, separated by TAB.
  • One of the following constants:
    uriAudioAllows all types of audio files.
    uriImageAllows all types of image files.
    uriVideoAllows all types of video files.

    Note: Constants can be concatenated by separating them with TAB.
If a specified MIME type is not known by the system, it will be ignored.
If this parameter is not specified, all files will be selectable.
AndroidWidget Android On Android, files that do not match the specified MIME types will still be visible but the user will not be able to select them.
<Mode>: Optional Integer constant
AndroidWidget Android Selection mode:
uriCreateOpens the picker in "Creation" mode to create a new document. The default name of this document can be specified in <Document name>.
uriOpen
(Default value)
Opens the picker in "Open" mode to open an existing document.
<Document name>: Optional character string
AndroidWidget Android Default name of the document to be created when the picker is open in creation mode. This parameter is taken into account only if <Mode> corresponds to the uriCreate constant.
Observaciones

Miscellaneous

  • To manage the URI returned by URISelect, use the URIxxx functions.
  • To retrieve additional information (name, size, MIME type) on the selected resource, use URIGetInfo.
  • AndroidWidget Android URISelect is only available on devices running Android 4.4 or later (API level 19).
    A fatal error occurs if the function is used with an earlier system version.
    To determine the version of Android the application is running on, use SysAndroidVersion.
AndroidWidget Android

Aplicación en segundo plano: Caso concreto de Android 10

A partir de Android 10, no se puede abrir una ventana si la aplicación está en segundo plano.
La función URISelect puede abrir una ventana. Si se utiliza esta función cuando la aplicación está en segundo plano, se producirá un error fatal.
Consejos:
  • Para saber si la aplicación está en segundo plano, utilice la función InBackgroundMode.
  • Si una aplicación necesita interactuar con el usuario cuando está en segundo plano, se puede mostrar una notificación (con el tipo Notification). La aplicación volverá al primer plano cuando se haga clic en la notificación, si la propiedad ActivateApplication se establece en True. También es posible abrir una ventana desde el procedimiento pasado a la propiedad ActionClick.
Para obtener más información, consulte Android 10: Comportamiento de las aplicaciones en segundo plano.
Clasificación Lógica de negocio / UI: Código UI
Componente: wd300java.dll
Versión mínima requerida
  • Versión 24
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local