Questions tagged [qtandroidextras]

The QtAndroidExtras module provides classes to make the programming easier for additional functionality on Android.

This add-on was introduced in the Qt 5.2 to aid the development for the Android platform.

The official documentation of the module can be found here.

77 questions
2
votes
0 answers

Qt Android : how can I use logcat in Qt?

Is there a way to see logcat in Qt, so I can debug easier? Specially, that my code uses android service, which runs on a separate process and I can't see any QDebug or QWarning or Log.
Mena
  • 3,019
  • 1
  • 25
  • 54
2
votes
1 answer

QT Android: Can't create android service in separate .so

I was able to find a code that creates a service for android using Qt in this link: https://github.com/bbernhard/qtandroidservices_example However, when i tried to put the service code in another .so file using this…
Mena
  • 3,019
  • 1
  • 25
  • 54
2
votes
0 answers

How do i fix this error that occurs whenever i try to deploy a qt quick 2 program on an android arm emulator?

Whenever i try running a qt quick application called andTest on an android emulator, i always get the following error I have used the same settings (namely the android manifest) with a Qt widgets application project and it successfully runs on the…
kugar
  • 51
  • 5
2
votes
1 answer

Java code with QtAndroidExtras

PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); I want implement that in C++ via JNI (using QtAndroidExtras), but I don't understand what the code (PowerManager) does. Is that type conversion? I wondering is it possible…
morte
  • 325
  • 1
  • 10
2
votes
3 answers

Qt android screen lock java issue

I have Qt application and need to keep screen from dimming while application is running. I placed following code in the beginning of main() in main.cpp: #ifdef ANDROID // disable screen lock on android devices QAndroidJniObject activity =…
Ivan
  • 81
  • 4
2
votes
2 answers

Passing long value to Java with JNI

I'm trying to pass object pointer as long from C++ code to java method through JNI to convert it back to pointer in callback later. void Client::process() { long thisAddress = (long)this; QAndroidJniObject res =…
gmlt.A
  • 327
  • 5
  • 16
2
votes
1 answer

How to use QAndroidJniEnvironment pointer in a Qthread?

In the qt main thread I successfully can run this: jbyteArray jBuffer = _env->NewByteArray(bufferSize); The _env is a QAndroidJniEnvironment. but If I try to use _env in the run function of a QRunnable, the application crashes and this error…
a.toraby
  • 3,232
  • 5
  • 41
  • 73
2
votes
1 answer

what are the usage of callStaticObjectMethod callStaticMethod

The qt documentation is poor in QAndroidJniObject object. Could you possibly tell me what the difference between callStaticObjectMethod and callStaticMethod is and when should I use them? If you have any working example, It would be appreciated if…
a.toraby
  • 3,232
  • 5
  • 41
  • 73
2
votes
2 answers

Changing orientation of a particular page in android

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…
Eljay
  • 941
  • 5
  • 15
  • 30
2
votes
1 answer

QWebView for Android target on Qt5.3 on windows pc, ERROR: Unknown module(s) in QT: webkitwidgets

I am writing a code for android from Windows pc. I have Qt 5.3 and I added the following line to my .pro file for to use QWebView, as suggested: QT += webkitwidgets however, when I run qmake, I get the this error: Project ERROR: Unknown module(s)…
user3589887
  • 139
  • 2
  • 13
2
votes
1 answer

QML on android - will C++ work for business logic?

Doing some investigation on the feasibility of using QT/QML for an upcoming project. Client wants it initially on Windows and Mac desktops, with the possibility of iOS and Android down the road. They would like to know that what we build will move…
CargoMeister
  • 4,199
  • 6
  • 27
  • 44
2
votes
1 answer

could not load qml file on Deployment on Android Device

I have issue related to loading 1-2 qml files at the time of deployment. I have a code that runs well on emulator but does not load few qml file at the time of delpoyment. For example this is my model and on itemClick want to load new qml ListModel…
JNI_OnLoad
  • 5,472
  • 4
  • 35
  • 60
2
votes
1 answer

How to call non-static Java method in QtActivity from C++/Qt

Eskil Abrahamsen Blomfeldt has a post on his blog showing how to call QtActivity/(HangmanActivity) static Java methods from C++ here. He mentions that he only uses static methods because this is easier (indeed) and nothing more is needed in his…
uniquenamehere
  • 1,869
  • 3
  • 31
  • 60
1
vote
1 answer

error: cannot find symbol import android.app.ActivityTaskManager;

I am trying to use ActivityTaskManager in Qt for Android, but I cannot import the package as below: import android.app.ActivityTaskManager; Error message: TestJava.java:5: error: cannot find symbol import android.app.ActivityTaskManager; …
JustWe
  • 4,250
  • 3
  • 39
  • 90
1
vote
2 answers

Requesting Android permissions in Qt 6

I am trying to convert a Qt 5 app to Qt 6. In Qt 5 we can request Android permissions as follows: QStringList permissions; //... QtAndroid::PermissionResultMap resultHash = QtAndroid::requestPermissionsSync(permissions); for (const auto &perm :…
Hyndrix
  • 4,282
  • 7
  • 41
  • 82