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
Forum Updated to NodeBB v4.3 + New Features

Qt Notifier example app does not work

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 260 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 17 Mar 2024, 09:32 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 17 Mar 2024, 21:19
    1
    • N NobodySpecial
      17 Mar 2024, 09:32

      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 17 Mar 2024, 21:19 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
      • S SGaist has marked this topic as solved on 18 Mar 2024, 19:50

      1/2

      17 Mar 2024, 09:32

      • Login

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