Questions tagged [qandroidjniobject]

This Qt object helps executing pure Android Java code using a C++ syntax.

When deploying Qt applications on Android, use QAndroidJniObject to create and manipulate objects from Android Java SDK.

29 questions
8
votes
0 answers

How to use the Qt Jni class "QAndroidJniObject"

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…
user3353801
  • 81
  • 1
  • 4
6
votes
1 answer

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

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…
3
votes
1 answer

Can't make the phone play sound nor vibrate using Qt for Android

I'm deploying an Android application using QtCreator. I'd like to play a sound and make the phone vibrate to notify the user that something bad happened. I use QAndroidJniObject to call SDK functions. I could not make anyone work. For "vibrate": //…
jpo38
  • 20,821
  • 10
  • 70
  • 151
3
votes
1 answer

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

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,…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
2
votes
3 answers

QT/QML Android: How to keep an app running when the last windows is closed?

I am developing a work order app for team works on the field. This app listens to server for work order. I want this particular processing : When I close the last window, my app must run in background. Then, if my app catches a work order, it…
2
votes
1 answer

Android force OpenCV 3.0 to load as a 32-bit library

I'm trying to make my 64-bit Android device compile local 32-Bit jniLibs which so far is going OK but I sort of ran into a snag. I have been researching exactly what went wrong for a couple days and puttering around here and there but this is the…
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
1
vote
0 answers

My application crashes on Oreo 8.1 version but works fine for lower OS versions

my Android application is working fine for Android versions under 8.1 ( an application based on Mupdf ) , when testing on Android 8.1 it keeps crashing with this error : /xxx.xxx.xxx.xxxx A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr…
1
vote
1 answer

qt androidextras getMemoryInfo MemoryInfo availMem object field crash from c++

How to call getMemoryInfo from c++ qt 5.6 android? Im not sure about casting from java/lang/Object to android/app/ActivityManager when calling getSystemService api, but I get valid QAndroidJniObject btw. Here is my code so…
user3453753
  • 357
  • 4
  • 15
1
vote
1 answer

qt android ClassNotFoundException

I'm using Qt (qml) to make an android app but I'm getting errors trying to register native methods to be called from java. In one section on my native code I'm calling java static functions with no problems: void NotificationClient::powerOff() { …
ryan0270
  • 1,135
  • 11
  • 33
1
vote
0 answers

Issue : Generating header file with JNI Android NDK begineer

My projectPath : C:\Users\harsh.bhavsar\Downloads\Android-NDK-Sample-Test-master\NDKexe SDK path android jar path: D:\ANDROID-SDK\Sdk\platforms\android-23 Java is set in Environment path. I didn't make c file right now as show in this tutorial …
1
vote
1 answer

Accessing Android Calendar Provider from QT / C++ Project

Preferable way would be using Android Calendar Provider (http://developer.android.com/guide/topics/providers/calendar-provider.html). But this API is Java only. I didnt found anything for the Android NDK Api to access Android Calendar. Also QT 5…
C. Seidel
  • 45
  • 6
1
vote
1 answer

Getting Android account manager from qt in c++

Using this code: QAndroidJniObject activity = QtAndroid::androidActivity(); QAndroidJniObject accountManager =…
Nathan
  • 7,099
  • 14
  • 61
  • 125
1
vote
1 answer

Unable to call PowerManager.WakeLock.newWakeLock using QAndroidJniObject

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…
jpo38
  • 20,821
  • 10
  • 70
  • 151
1
vote
1 answer

Unable to create WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON object using QAndroidJniObject

Here is my code, trying to create a QAndroidJniObject to access WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON value. So I do this: QAndroidJniObject activity = QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative",…
jpo38
  • 20,821
  • 10
  • 70
  • 151
1
2