Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QAndroidServiceConnection Class Referenceabstract

\inheaderfile QtCore/private/qandroidextras_p.h \preliminary \inmodule QtCorePrivate More...

#include <qandroidextras_p.h>

+ Collaboration diagram for QAndroidServiceConnection:

Public Member Functions

 QAndroidServiceConnection ()
 Creates a new object.
 
 QAndroidServiceConnection (const QJniObject &serviceConnection)
 Creates a new object from an existing serviceConnection.
 
virtual ~QAndroidServiceConnection ()
 
virtual void onServiceConnected (const QString &name, const QAndroidBinder &serviceBinder)=0
 This notification is called when the client managed to connect to the service.
 
virtual void onServiceDisconnected (const QString &name)=0
 Called when a connection to the Service has been lost.
 
QJniObject handle () const
 returns the underline QJniObject
 

Detailed Description

\inheaderfile QtCore/private/qandroidextras_p.h \preliminary \inmodule QtCorePrivate

Wraps the most important methods of Android ServiceConnection class.

The QAndroidServiceConnection is a convenience abstract class which wraps the \l {https://developer.android.com/reference/android/content/ServiceConnection.html}{AndroidServiceConnection} interface.

It is useful when you perform a QtAndroidPrivate::bindService operation.

qtcoreprivate-usage

Since
6.2

Definition at line 109 of file qandroidextras_p.h.

Constructor & Destructor Documentation

◆ QAndroidServiceConnection() [1/2]

QAndroidServiceConnection::QAndroidServiceConnection ( )

Creates a new object.

Definition at line 398 of file qandroidextras.cpp.

◆ QAndroidServiceConnection() [2/2]

QAndroidServiceConnection::QAndroidServiceConnection ( const QJniObject & serviceConnection)
explicit

Creates a new object from an existing serviceConnection.

It's useful when you have your own Java implementation. Of course onServiceConnected()/onServiceDisconnected() will not be called anymore.

Definition at line 410 of file qandroidextras.cpp.

◆ ~QAndroidServiceConnection()

QAndroidServiceConnection::~QAndroidServiceConnection ( )
virtual

Definition at line 415 of file qandroidextras.cpp.

Member Function Documentation

◆ handle()

QJniObject QAndroidServiceConnection::handle ( ) const

returns the underline QJniObject

Definition at line 423 of file qandroidextras.cpp.

◆ onServiceConnected()

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

This notification is called when the client managed to connect to the service.

The name contains the server name, the serviceBinder is the binder that the client uses to perform IPC operations.

Warning
This method is called from Binder's thread which is different from the thread that this object was created.

returns the underline QJniObject

◆ onServiceDisconnected()

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

Called when a connection to the Service has been lost.

The name parameter specifies which connectioen was lost.

Warning
This method is called from Binder's thread which is different from the thread that this object was created.

returns the underline QJniObject


The documentation for this class was generated from the following files: