qandroidjniobject

QT/QML Android App, open app when click notification bar

我怕爱的太早我们不能终老 提交于 2021-02-07 14:17:47
问题 I make an QT for Android apps. When I click button notify bar seen above in tablet. But if click notify, my apps open/focus(don' know) with black window. How to do it simply. My code is: package org.ays.operation; import android.app.Notification; import android.app.NotificationManager; import android.content.Context; import android.app.PendingIntent; import android.content.Intent; public class NotificationClient extends org.qtproject.qt5.android.bindings.QtActivity { private static

How to use QAndroidJniObject to call Java code from inside Qt?

橙三吉。 提交于 2019-12-12 07:20:19
问题 Starting from an empty Qt for Android project, created with Qt Creator, how do I execute native Java code? For example, if I have this java method: class HelloJava { public static String sayHello(int a, int b) { return "Hello from Java, a+b=" + (a+b); } } And I have this Qt method which should call the HelloJava.sayHello() method: QString call_HelloJava_sayHello(int a, int b) { // What goes in here? } Where do I put the Java code in my project, and what goes inside the call_HelloJava_sayHello

Unable to call PowerManager.WakeLock.newWakeLock using QAndroidJniObject

只谈情不闲聊 提交于 2019-12-11 13:56:57
问题 I'm trying to execute this Java code: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag"); wl.acquire(); using Qt QAndroidJniObject (I'm deploying a Qt app on Android). I did that: QAndroidJniObject activity = QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;"); if ( activity.isValid() ) { QAndroidJniObject serviceName

How to use the Qt Jni class “QAndroidJniObject”

╄→尐↘猪︶ㄣ 提交于 2019-12-08 17:07:51
问题 I'm a beginner of "Qt for Android" and now I'm using it to develop a communication oftware based on mobile.I hava developed java functions that call android's api as a class in a .java document.In order to Simplify UI development,the UI is based on Qt Widget program.Then I use the Qt-JNI class "QAndroidJniObject" to call these java functions according to Qt5.2 API document.Android resource file is stored in the directory:./android/src/com/comm/sipcall/SipCallSend.java.Since the less

How to use QAndroidJniObject to call Java code from inside Qt?

99封情书 提交于 2019-12-01 00:21:34
Starting from an empty Qt for Android project, created with Qt Creator, how do I execute native Java code? For example, if I have this java method: class HelloJava { public static String sayHello(int a, int b) { return "Hello from Java, a+b=" + (a+b); } } And I have this Qt method which should call the HelloJava.sayHello() method: QString call_HelloJava_sayHello(int a, int b) { // What goes in here? } Where do I put the Java code in my project, and what goes inside the call_HelloJava_sayHello() method? dtech The Qt doc is pretty verbose on the subject: // Java class package org.qtproject.qt5;