Important: Please read the Qt Code of Conduct -

Call C++ function from android BroadcastReceiver

  • 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.


  • You can call C++/Qt to native code with JNI, here is link to start
    and this is good example to start with Qt Android :

  • 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.

  • @MajidKamali


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

    Have a nice day,

  • Hello.

    See example:


    This class extends
    public class NotificationClient extends

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

    Check that there is a change in AndroidManifest.xml


    Where this class becomes its main activity.

    I have helped .

Log in to reply