Call C++ function from android BroadcastReceiver
-
wrote on 8 Aug 2016, 01:49 last edited by
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
-
wrote on 22 Aug 2016, 21:59 last edited by
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 -
wrote on 23 Aug 2016, 17:16 last edited by
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. -
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.wrote on 30 Aug 2016, 13:15 last edited byHi,
have you found a solution for this one? I am trying to do something similar.
Have a nice day,
Bernhard -
wrote on 30 Aug 2016, 13:24 last edited by
Hello.
See example:
Qt\Examples\Qt-5.7\androidextras\notificationQt\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.QtActivityIn 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 .