En esta página

QAndroidServiceConnection Class

Envuelve los métodos más importantes de la clase Android ServiceConnection. Más...

Cabecera: #include <QtCore/private/qandroidextras_p.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS CorePrivate)
target_link_libraries(mytarget PRIVATE Qt6::CorePrivate)
qmake: QT += core-private
Desde: Qt 6.2
Estado: Preliminar

Esta clase está en desarrollo y está sujeta a cambios.

Funciones Públicas

QAndroidServiceConnection()
QAndroidServiceConnection(const QJniObject &serviceConnection)
QJniObject handle() const
virtual void onServiceConnected(const QString &name, const QAndroidBinder &serviceBinder) = 0
virtual void onServiceDisconnected(const QString &name) = 0

Descripción Detallada

QAndroidServiceConnection es una clase abstracta que envuelve la interfaz AndroidServiceConnection.

Es útil cuando se realiza una operación QtAndroidPrivate::bindService.

Documentación de Funciones Miembro

QAndroidServiceConnection::QAndroidServiceConnection()

Crea un nuevo objeto

[explicit] QAndroidServiceConnection::QAndroidServiceConnection(const QJniObject &serviceConnection)

Crea un nuevo objeto a partir de uno existente serviceConnection.

Es útil cuando tienes tu propia implementación Java. Por supuesto onServiceConnected()/onServiceDisconnected() ya no será llamado.

QJniObject QAndroidServiceConnection::handle() const

devuelve el subrayado QJniObject

[pure virtual] void QAndroidServiceConnection::onServiceConnected(const QString &name, const QAndroidBinder &serviceBinder)

Esta notificación es llamada cuando el cliente logra conectarse al servicio. El name contiene el nombre del servidor, el serviceBinder es el binder que el cliente utiliza para realizar operaciones IPC.

Advertencia: Este método es llamado desde el thread del Binder que es diferente del thread en el que este objeto fue creado.

devuelve el subrayado QJniObject

[pure virtual] void QAndroidServiceConnection::onServiceDisconnected(const QString &name)

Llamada cuando se ha perdido una conexión con el Servicio. El parámetro name especifica qué conexión se ha perdido.

Advertencia: Este método es llamado desde el hilo de Binder que es diferente del hilo en el que este objeto fue creado.

devuelve el subrayado QJniObject

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.