QAndroidService Class

Android Serviceクラスの最も重要なメソッドをラップします。詳細...

ヘッダー #include <QtCore/private/qandroidextras_p.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::CorePrivate)
qmake: QT += core-private
以来:Qt 6.2
継承: QCoreApplication
ステータス予備

このクラスは開発中であり、変更される可能性があります。

パブリック関数

QAndroidService(int &argc, char **argv)
QAndroidService(int &argc, char **argv, const std::function<QAndroidBinder *(const QAndroidIntent &)> &binder)
virtual QAndroidBinder *onBind(const QAndroidIntent &intent)

詳細説明

QAndroidServiceは、Android Serviceの最も重要なメソッドをラップした便利なクラスです。

メンバー関数の説明

QAndroidService::QAndroidService(int &argc, char **argv)

argcargv をパラメータとして、新しいAndroidサービスを作成します。

QCoreApplicationも参照してください

QAndroidService::QAndroidService(int &argc, char **argv, const std::function<QAndroidBinder *(const QAndroidIntent &)> &binder)

argcargv をパラメータとして、新しいAndroidサービスを作成する。

binder は、必要に応じて を作成するために使用されます。binder

QCoreApplicationも参照してください

[virtual] QAndroidBinder *QAndroidService::onBind(const QAndroidIntent &intent)

ユーザーはこのメソッドをオーバーライドし、バインダーを返すようにしなければならない。

intent パラメータには、すべての呼び出し元情報が含まれる。

返されたバインダは、呼び出し元が IPC 呼び出しを実行するために使用されます。

警告 このメソッドは、このオブジェクトが作成されたスレッドとは異なるバインダーのスレッドから呼び出されます。

QAndroidBinder::onTransact およびQAndroidBinder::transactも参照してください

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