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. Call C++ function from android BroadcastReceiver
Forum Updated to NodeBB v4.3 + New Features

Call C++ function from android BroadcastReceiver

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 4 Posters 3.5k Views 1 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.
  • M Offline
    M Offline
    MajidKamali
    wrote on 8 Aug 2016, 01:49 last edited by
    #1

    Hi.
    I have an android application written in Qt. It has a BroadcastReceiver which receives incoming calls and shows a custom activity written in java.
    Is it possible to call C++/Qt function and run native code, in that activity? How? (I want to access ciphered database from Qt)
    Qt program may not be running while receiving BroadcastReceiver.

    Thanks

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kd_wala
      wrote on 22 Aug 2016, 21:59 last edited by
      #2

      You can call C++/Qt to native code with JNI, here is link to start
      http://doc.qt.io/qt-5/android-support.html
      and this is good example to start with Qt Android : http://doc.qt.io/qt-5/qtandroidextras-notification-example.html

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MajidKamali
        wrote on 23 Aug 2016, 17:16 last edited by
        #3

        I know how to call C++/Qt function from android.
        But In this case Qt application is not running, while broadcast receiver receives signal from Android.

        S 1 Reply Last reply 30 Aug 2016, 13:15
        0
        • M MajidKamali
          23 Aug 2016, 17:16

          I know how to call C++/Qt function from android.
          But In this case Qt application is not running, while broadcast receiver receives signal from Android.

          S Offline
          S Offline
          Schluchti
          wrote on 30 Aug 2016, 13:15 last edited by
          #4

          @MajidKamali

          Hi,

          have you found a solution for this one? I am trying to do something similar.

          Have a nice day,
          Bernhard

          Want to read more about Qt?

          https://gympulsr.com/blog/qt/

          Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

          1 Reply Last reply
          0
          • J Offline
            J Offline
            joaopagotto
            wrote on 30 Aug 2016, 13:24 last edited by
            #5

            Hello.

            See example:
            Qt\Examples\Qt-5.7\androidextras\notification

            Qt\Examples\Qt-5.7\androidextras\notification\android-sources\src\org\qtproject\example\notification\NotificationClient.java

            This class extends
            public class NotificationClient extends org.qtproject.qt5.android.bindings.QtActivity

            In other words this is your activity , add BroadcastReceiver there.

            Check that there is a change in AndroidManifest.xml

            android:name="org.qtproject.example.notification.NotificationClient"

            Where this class becomes its main activity.

            I have helped .

            1 Reply Last reply
            0

            • Login

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