Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Android: QtService and NotificationListenerService



  • Currently, QtService extends Service but I would like to subclass NotificationListenerService.

    What is the best approach? I see two possible approaches and I would appreciate input on which path is preferred.

    • Option 1: I started with the example on https://www.kdab.com/qt-android-create-android-service-using-qt/ and I modified the org.qtproject.qt5.android.bindings.QtService and let it inherit from NotificationListenerService instead of Service. I couldn't get this to work (yet) but I'm also not sure whether this is conceptually OK and whether I should also change the onBind implementation to call eg the NotificationListenerService.onBind etc
    • Option 2: create two services: one pure Java NotificationListenerService that sends messages (via a BroadcastReceiver I guess) to a QtService

Log in to reply