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. Qt Notifier example app does not work
Qt 6.11 is out! See what's new in the release blog

Qt Notifier example app does not work

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 508 Views
  • 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.
  • N Offline
    N Offline
    NobodySpecial
    wrote on last edited by
    #1

    I am using Qt 5.15.16.

    To run this on my android device with a higher sdk version, I had to comment out the following in AndroidManifest.xml:

    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/>
    

    But then the application failed to compile with this error in AndroidManifest.xml Error:

    android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
    

    I fixed the above error by adding android:exported="true" to the activity node in AndroidManifest.xml.

    Now the compilation succeeded.

    Next, I deployed and ran the application on my android arm64-v8a device.

    It runs okay but does not do what the example is intended to do, i.e. display andorid notification when you click on the icons :-(

    In summary, I think Qt need to upgrade this example application so that it works with the later versions of android.

    btw, I use notifications in my own app. I based my implementation on this example. It used to work. But it does not work any longer.

    Any advice would be appreciated.

    N 1 Reply Last reply
    1
    • N NobodySpecial

      I am using Qt 5.15.16.

      To run this on my android device with a higher sdk version, I had to comment out the following in AndroidManifest.xml:

      <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/>
      

      But then the application failed to compile with this error in AndroidManifest.xml Error:

      android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
      

      I fixed the above error by adding android:exported="true" to the activity node in AndroidManifest.xml.

      Now the compilation succeeded.

      Next, I deployed and ran the application on my android arm64-v8a device.

      It runs okay but does not do what the example is intended to do, i.e. display andorid notification when you click on the icons :-(

      In summary, I think Qt need to upgrade this example application so that it works with the later versions of android.

      btw, I use notifications in my own app. I based my implementation on this example. It used to work. But it does not work any longer.

      Any advice would be appreciated.

      N Offline
      N Offline
      NobodySpecial
      wrote on last edited by
      #2

      I found the solution.
      Add android.permission.POST_NOTIFICATIONS to AndroidManifest.xml.
      This is a requirement as of Android 13.

      1 Reply Last reply
      1
      • SGaistS SGaist has marked this topic as solved on

      • Login

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