IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QAndroidBinder Class

This class was introduced in Qt 5.10.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QAndroidBinder Class

  • Header: QAndroidBinder

  • Since: Qt 5.10

  • qmake: QT += androidextras

Detailed Description

The QAndroidBinder is a convenience class that wraps the most important Android Binder methods.

Member Type Documentation

 

enum QAndroidBinder::CallType

This enum is used with QAndroidBinder::transact() to describe the mode in which the IPC call is performed.

Constant

Value

Description

QAndroidBinder::CallType::Normal

0

normal IPC, meaning that the caller waits the result from the callee

QAndroidBinder::CallType::OneWay

1

one-way IPC, meaning that the caller returns immediately, without waiting for a result from the callee

Member Function Documentation

 

[explicit] QAndroidBinder::QAndroidBinder()

Creates a new object which can be used to perform IPC.

See Also

See also onTransact, transact

QAndroidBinder::QAndroidBinder(const QAndroidJniObject &binder)

Creates a new object from the binder Java object.

See Also

See also transact

QAndroidJniObject QAndroidBinder::handle() const

The return value is useful to call other Java API which are not covered by this wrapper

[virtual] bool QAndroidBinder::onTransact(int code, const QAndroidParcel &data, const QAndroidParcel &reply, QAndroidBinder::CallType flags)

Default implementation is a stub that returns false. The user should override this method to get the transact data from the caller.

The code is the action to perform. The data is the marshaled data sent by the caller. The reply is the marshaled data to be sent to the caller. The flags are the additional operation flags.

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

See Also

See also transact

bool QAndroidBinder::transact(int code, const QAndroidParcel &data, QAndroidParcel *reply = nullptr, QAndroidBinder::CallType flags = CallType::Normal) const

Performs an IPC call

The code is the action to perform. Should be between FIRST_CALL_TRANSACTION and LAST_CALL_TRANSACTION. The data is the marshaled data to send to the target. The reply (if specified) is the marshaled data to be received from the target. May be nullptr if you are not interested in the return value. The flags are the additional operation flags.

Returns true on success

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+