QAndroidParcel Class

Header: #include <QAndroidParcel>
qmake: QT += androidextras
Since: Qt 5.10

Public Functions

QAndroidParcel()
QAndroidParcel(const QAndroidJniObject &parcel)
virtual ~QAndroidParcel()
QAndroidJniObject handle() const
QAndroidBinder readBinder() const
QByteArray readData() const
int readFileDescriptor() const
QVariant readVariant() const
void writeBinder(const QAndroidBinder &binder) const
void writeData(const QByteArray &data) const
void writeFileDescriptor(int fd) const
void writeVariant(const QVariant &value) const

Detailed Description

The QAndroidParcel is a convenience class that wraps the most important Android Parcel methods.

Member Function Documentation

QAndroidParcel::QAndroidParcel()

Creates a new object.

QAndroidParcel::QAndroidParcel(const QAndroidJniObject &parcel)

Wraps the parcel object.

[virtual] QAndroidParcel::~QAndroidParcel()

Destroys the instance of QAndroidParcel. The destructor is virtual.

QAndroidJniObject QAndroidParcel::handle() const

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

QAndroidBinder QAndroidParcel::readBinder() const

Returns the binder as a QAndroidBinder

QByteArray QAndroidParcel::readData() const

Returns the data as a QByteArray

int QAndroidParcel::readFileDescriptor() const

Returns the file descriptor

QVariant QAndroidParcel::readVariant() const

Returns the data as a QVariant

void QAndroidParcel::writeBinder(const QAndroidBinder &binder) const

Writes a binder object. This is useful for a client to send to a server a binder which can be used by the server callback the client.

void QAndroidParcel::writeData(const QByteArray &data) const

Writes the provided data as a byte array

void QAndroidParcel::writeFileDescriptor(int fd) const

Writes the provided fd.

void QAndroidParcel::writeVariant(const QVariant &value) const

Writes the provided value. The value is converted into a QByteArray before is written.

© 2021 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.