qtandroidextras

Camera Not saving the captured image

£可爱£侵袭症+ 提交于 2020-02-06 08:22:47
问题 I Use Qt 5.12.5 and I have qt quick controls 2 project that I run it on my Android Device. Now I have a problem,the signal imageSaved of Camera Not trigger? In below when I click button Camera should capture Button{ onClicked: { camera.imageCapture.capture(); } } After Clicking the Button imageCaptured signal runs, the photoPrevew shows the captured image ,But onImageSaved Not running and I don't see any captured image in my Gallery! Camera { id: camera position: Camera.BackFace

Qt does not compile callStaticObjectMethod()

≯℡__Kan透↙ 提交于 2020-01-05 13:14:29
问题 I wrote the following code from this question and it was compiled and worked perfectly: QAndroidJniObject str = QAndroidJniObject::callStaticObjectMethod<jstring>( "org/.../TestClass" ,"staticMethod"); Now I have changed the java method and it needs an input parameter of type string. The Java code : public class TestClass{ public string str; public TestClass() { str = "Test From Java"; } public static String staticMethod(String str) { return "Test From Java, "+str; } } But adding the method

Changing orientation of a particular page in android

会有一股神秘感。 提交于 2019-12-19 10:14:20
问题 I am working on an android app in Qt and c++. My whole application has portrait orientation.But when i play a video i want to change the orientation to landscape, and after video ends it should again change to portrait. So the question is How is it possible to set the screen to landscape or portrait modes in a Qt/C++ application for Android. 回答1: Screen orientation on Android can be changed using setRequestedOrientation Java function so you should call a Java function from your app. To run

Qt android Can't listen to os intents ex.RECEIVE_BOOT_COMPLETED

痴心易碎 提交于 2019-12-12 03:45:03
问题 I have an android service that runs when i open my app, now I want my android service to run at boot time. I tried the bellow code, but the service is not running automatically when i reboot my device. I cannot see it running as a service on my phone! Is there something wrong in my code? I added these permissions to the manifest: <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.RECEIVE_HEADSET_PLUG"/> Here's my

Calling simple java static method via JNI does not work, though c++ compiles and run it

自作多情 提交于 2019-12-11 10:50:06
问题 Considering this Java class with the static method: public class TestClass{ public string str; public TestClass() { str = "Test From Java"; } public static String staticMethod() { return "Test From Java"; } } I have written these lines of code in c++ file: QAndroidJniObject str = QAndroidJniObject::callStaticObjectMethod( "org/.../TestClass" ,"staticMethod" ,"(V)Ljava/lang/String;"); It seems everything is working but I don't know how can I use the str Object. I tried to convert it to a

Qt with android 5.9.0 installation erorr

拈花ヽ惹草 提交于 2019-12-11 04:37:41
问题 I am trying to install Qt with android , but i am facing issues while adding AVD, sdk location : D:\android-sdk ndk location : D:\android\android-ndk-r15c-windows-x86_64\android-ndk-r15c creator showing it found 10 tool chains for this ndk ant location : D:\Apache-ant-1.9.6\src\script\ant.bat whenever i try to start avd manager i am getting a pop message like as below AVD manager tool is not available in the installed SDK tools(version 26.0.2). use the command line tool "avdmanager" for

open android settings from QT app(com.android.settings)

你说的曾经没有我的故事 提交于 2019-12-06 00:51:23
问题 I have an android application in QT. I would like to call android settings from a button. I used this code in Java : public void usb(View v){ Intent intent = new Intent(); intent.setClassName("com.android.settings", "com.android.settings.DevelopmentSettings"); startActivity(intent); } Is there a way to call android settings using QT C++? 回答1: QAndroidJniObject makes it possible to create JNI objects from Qt C++ code. For example: to get the activity: QAndroidJniObject activity =

open android settings from QT app(com.android.settings)

痞子三分冷 提交于 2019-12-04 07:37:53
I have an android application in QT. I would like to call android settings from a button. I used this code in Java : public void usb(View v){ Intent intent = new Intent(); intent.setClassName("com.android.settings", "com.android.settings.DevelopmentSettings"); startActivity(intent); } Is there a way to call android settings using QT C++? QAndroidJniObject makes it possible to create JNI objects from Qt C++ code. For example: to get the activity: QAndroidJniObject activity = QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;");

How to keep the screen on in Qt for android?

眉间皱痕 提交于 2019-12-01 16:45:43
I found a couple of solutions how to do that in Java, but did not find how can I do it in QML or Qt. I know that first I should set the WAKE_LOCK permission in AndroidManifest.xml . What should I do to make it possible to turn on and off the screen locking from Qt in runtime? You can use the Qt Android Extras module and use JNI to call the relevant Java function from C++. Something like : void keepScreenOn() { QAndroidJniObject activity = QtAndroid::androidActivity(); if (activity.isValid()) { QAndroidJniObject window = activity.callObjectMethod("getWindow", "()Landroid/view/Window;"); if

How to keep the screen on in Qt for android?

与世无争的帅哥 提交于 2019-12-01 15:58:59
问题 I found a couple of solutions how to do that in Java, but did not find how can I do it in QML or Qt. I know that first I should set the WAKE_LOCK permission in AndroidManifest.xml . What should I do to make it possible to turn on and off the screen locking from Qt in runtime? 回答1: You can use the Qt Android Extras module and use JNI to call the relevant Java function from C++. Something like : void keepScreenOn() { QAndroidJniObject activity = QtAndroid::androidActivity(); if (activity