このページでは

QAndroidService Class

AndroidのServiceクラスの最も重要なメソッドをまとめています。詳細...

ヘッダー: #include <QtCore/private/qandroidextras_p.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS CorePrivate)
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)

argc およびargv をパラメータとして渡し、新しい Android サービスを作成します。

「QCoreApplication」も参照してください 。

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

argc およびargv をパラメータとして渡し、新しい Android サービスを作成します。

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

「QCoreApplication」も参照してください 。

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

ユーザーはこのメソッドをオーバーライドし、バインダーを返さなければなりません。

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

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

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

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

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