Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android - Send a simple notification
Forum Updated to NodeBB v4.3 + New Features

Android - Send a simple notification

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 944 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    Xasin
    wrote on last edited by
    #1

    Hello everyone!
    I recently started working on an app that should have a simple user interface - its main task is to regularly synchronize data between a personal server and a small, Bluetooth-connected wearable device.

    I recently wanted to send a simple, standard Android notification to indicate connection problems or a low battery of the device.
    From what I could gather, building the QtApplicationManager was necessary.

    I have built and properly installed the QtApplicationManager (or at the very least, qmake, make and make install returned no errors, and left files in the Qt/5.11.1 dirs for both gcc_64 and android).

    However, when trying to include the newly installed module in the .pro file, nothing seems to work. I've tried applicationmanager with or without hyphen, with or without qt, capitalization, etc.
    So either I haven't hit the right module name yet, or it simply isn't working.

    My question is now:

    • Is there a way to send standard notifications on Android without building an entirely separate module? One would think sending system notifications should be doable by default.
    • If not, how do I properly install and include the QtApplicationManager QML type in my project in order to use its Notification type?

    I am running Debian 9, Qt 5.11.1 for gcc_64 and android_armeabi-v7a (with gcc 4.9 and Qt 5.11.1 also)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you thinking about something like the Qt Notifier example ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • X Offline
        X Offline
        Xasin
        wrote on last edited by
        #3

        Hi!
        That looks like it could fulfill my needs too, but I'll have to play around with the class a bit.
        Thanks for pointing it out!
        I probably saw the "QtApplicationManager" QML "Notification" type and got side-tracked by that.

        How come Qt does not offer a native way of sending system notifications though, independent of the platform the application is being run on?

        raven-worxR 1 Reply Last reply
        0
        • X Xasin

          Hi!
          That looks like it could fulfill my needs too, but I'll have to play around with the class a bit.
          Thanks for pointing it out!
          I probably saw the "QtApplicationManager" QML "Notification" type and got side-tracked by that.

          How come Qt does not offer a native way of sending system notifications though, independent of the platform the application is being run on?

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Xasin said in Android - Send a simple notification:

          How come Qt does not offer a native way of sending system notifications though, independent of the platform the application is being run on?

          Because its hard to get a common base for notifications (which actually helps in most use cases)
          Not every notification looks the same, nor is the origin which triggers the notification the same.
          For example on android normally an app doesn't need to trigger a notification, since it's only guaranteed that your app is running when the user has currently opened it. If the user switches away from your app, the android system might close your app for the sake of resources. So then there is no code to run to trigger the notification. You would need to create a background service to make sure your notification will be shown.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved