Skip to content

Mobile and Embedded

The forum for developing everything embedded: Linux, WinCE, Symbian, MeeGo... you name it.
14.2k Topics 62.7k Posts
  • Raspberry pi 4 rotate touchscreen 90 degrees

    Unsolved
    3
    0 Votes
    3 Posts
    586 Views
    W
    Thank you. I'll give this a try.
  • How to figure out what's killing Android app after about a minute?

    Solved
    4
    0 Votes
    4 Posts
    551 Views
    timdayT
    Think I've got some insight into this one now. It really only seems to be on OS8... the app works absolutely fine on OS7, 9 & 10. I added (to app's QML) a Timer spitting out a console.info message at a 10Hz rate. This let me identify what else the system was doing in a 0.1s window around the time the app died... and it invariably seemed to be some "dex2oat" thing on some bit of the app. Apparently dex2oat is something which precompiles bytecode into native code (so-called "Ahead Of Time" compilation). There's obviously something about my Qt5.7 app which causes some trouble on OS8. It works fine on OS7, 9 & 10. A minimal Qt5.7 app also worked fine on OS8. But my app recompiled with other Qts up to 5.10 also broke on OS8. However.... my understanding (after reading up on it) is that dex2oat only processes an app while it's running when the apk has been installed "developer style" (e.g over USB). If you install via an installer, all the dex2oat processing happens during the "Installing..." stage, before the app runs. However, for development, apparently the system allows apps to be run (presumably interpreting byte code) before having been fully dex2oat processed, in the name of developer productivity and not making people wait. So, I tested the app installed by the appstore (we use Amazon's, due to a monstrous app size) on OS8. Sure enough, it worked fine. (Before that, all my OS8 testing had been via Amazon Device Farm where you just get to upload an apk to be tested, which is less hassle, and faster than jumping through appstore hoops on a fresh device). Why the dex2oat thing should be toxic to my particular app when it's installed "developer style" on OS8 alone remains a mystery, but I can live with it when 9&10 are fine and normal users installing via the appstore should never see the issue. Did find some mention of an app manifest attribute android:vmSafeMode="true". It seemed to make some difference on OS7 (dex2oat command being applied the app changes to include --compiler-filter=interpret-only)... but seems to make no difference on OS8 (the problem one) or later. (I'm going to interpret that as something significant changed in OS8, broke something enough to cause my app some trouble, and then got fixed in OS9+. But who knows really.) Be interested in any comments from someone who understands more about what's going on!
  • Difference between Build and Run

    Unsolved qt creator
    5
    0 Votes
    5 Posts
    3k Views
    B
    Hello @mcleary Thank you for your response It really cleared up things to me I am gonna check the directories, but, the way you explained makes a lot o sense to me. It saved a lot o time. Regards
  • QT5.14.x config TSLIB failed

    Unsolved
    1
    0 Votes
    1 Posts
    451 Views
    No one has replied
  • Cross-Compiling modules in Yocto on IMX6

    Unsolved
    1
    1 Votes
    1 Posts
    289 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Qt Creator can't find ANDROID_NDK_ROOT environment variable

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    jsulmJ
    @istlota101 In QtCreator you can actually define where NDK is on the "Devices" tab in Options
  • How to add dylib to iOS App?? ( added ScreenShots )

    Unsolved
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Can we use QLibrary in android and IOS?

    Solved
    6
    0 Votes
    6 Posts
    712 Views
    jsulmJ
    @Advanced I don't know whether they accept your software as it is going to download libs from internet after installation. QLibrary should work, just try.
  • How do I boot beaglebone to work with a QT program?

    Unsolved
    2
    0 Votes
    2 Posts
    265 Views
    jsulmJ
    @subrat1234 said in How do I boot beaglebone to work with a QT program?: boot qt Do you mean you use Boot to Qt?
  • QSound no voice

    Unsolved
    1
    0 Votes
    1 Posts
    370 Views
    No one has replied
  • QT for Android on windows 10

    Unsolved
    2
    0 Votes
    2 Posts
    316 Views
    M
    I suggest that before posting here you search for similar topics, in this case e. g. https://forum.qt.io/topic/111997/how-to-set-android-target-architecture-in-qt
  • How to cross compile QT5.14.1 in Ubuntu18.04 with OpenGL ES2

    Unsolved
    1
    0 Votes
    1 Posts
    213 Views
    No one has replied
  • qsqlite driver not loaded but available drivers: QSQLITE

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    MihanM
    @jsulm I have no idea too :( , now I reinstall a new ubuntu 32bit for rebuilding them
  • How to add custom library to Android application?

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    sierdzioS
    I don't know.
  • QZXing can't decode some vague images.

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    jsulmJ
    @Zhangs Did you ask the project alread (https://www.kdab.com/efficient-barcode-scanning-qzxing/)? QZXing isn't part of Qt.
  • Japanese characters(Kanji) is not displayed correctly in TextArea

    Unsolved
    1
    0 Votes
    1 Posts
    273 Views
    No one has replied
  • QT Creator Device Test fails

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    aha_1980A
    @Noushad SFTP will be used for deployment, because rsync is not available.** I read that as, you can fully deploy to that device with SFTP. It seems to be the second option, maybe it is a bit slower. **rsync failed with exit code 12: command-line: line 0: Bad configuration option: \stricthostkeychecking For some reason rsync fails. stricthostkeychecking looks like a ssh configuration, but that's just a guess. Anyway, I think this setup should work. Regards
  • Callback from Android to QML

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    SyntaXS
    thanks for your reply, this was indeed very helpful :D I declared my "callback" function in the .java file with the native keyword: public class MyJavaClass { // callback handler to send notifications back to c++ public static native void StringChanged(String mystring); public void doSomeStuff () { // do stuff, then emit changes back to c++ StringChanged("my new string"); } } Then I registered those functions in my implementation void StringChangeReceived(JNIEnv *env, jobject obj, jstring newstring) { Q_UNUSED(obj) QString qString(env->GetStringUTFChars(newstring, 0)); qDebug().noquote().nospace() << "callback from Android received: " << qString; // to be able to emit the changes I either need an instance or (what I decided) a classic singleton if (nullptr != instance) { instance->myStringChanged(qString); } } void init () { // install callback for notifications received QAndroidJniEnvironment env; JNINativeMethod methods[] = { { "StringChanged", "(Ljava/lang/String;)V", reinterpret_cast<void*>(StringChangeReceived) } }; QAndroidJniObject javaClass("path/to/my/JavaClass"); jclass objectClass = env->GetObjectClass(javaClass.object<jobject>()); env->RegisterNatives(objectClass, methods, sizeof(methods) / sizeof(methods[0])); env->DeleteLocalRef(objectClass); } With this I realised at least a most basic full roundtrip, from my qml -> over the c++ class -> to the native java class on the android device -> and back over c++ -> to qml. :DDD Is it common practice to use that in combination with singletons? (Because I think I need them everywhere because of the static call?) Are there best practices or key values to that kind of implementation? best regards an thank you very much, SyntaX
  • Exchanging data between Android Activity and Qt cpp

    Unsolved
    2
    0 Votes
    2 Posts
    314 Views
    KroMignonK
    @mrdebug said in Exchanging data between Android Activity and Qt cpp: void OnNFCState(jstring Value) { Environment->GetStringUTFChars(Value, nullptr); } I know this post is old, but just see it today for the first time. To resolve your issue, simply use QAndroidJniObject::toString(), like this: void OnNFCState(jstring Value) { qDebug() << "Value is" << QAndroidJniObject(Value).toString(); }