Skip to content
  • 0 Votes
    2 Posts
    813 Views
    raven-worxR

    @Qjay said in QtAndroid local notifications , notifications poping up immediately:

    the notifications are popping up almost instantly ( despite me providing time for it ).

    you pass the time you want it to be triggered from now on. The API expects a time since EPOCH (as your comment in the code also states) which are the milliseconds from 1970/01/01 on.
    So in your JAVA code add new Date().getTime() milliseconds to your current timeout.

    So far i am able to get the notifications ( but not on Android O )

    did you read this already?
    Alos chekc the Qt debugger console and/or LogCat for suspicious messages regarding notifications.

  • 0 Votes
    4 Posts
    1k Views
    SGaistS

    Hi,

    No it's not. Your application becomes a library loaded by Android's runtime which requires a small amount of Java but you are writing and using C++. You can access Android's Java functionalities through JNI if needed.

  • 0 Votes
    8 Posts
    3k Views
    JKSHJ

    Hi @Geeva,

    @Geeva said in JSON with multi tasking:

    @JKSH Thanks for solving basic confusion. I have one more doubt also. Here, I have attached program for verification. I hope you can provide a proper solution

    You're welcome. I'm happy to teach you basics. However, verifying your program is too difficult to do on a forum.

    You need to do 2 things:

    Take C++ lessons Practice writing and debugging simple programs for your hardware
  • QtJambi memory leak

    Moved Unsolved Language Bindings
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi and welcome to devnet,

    That version of QtJambi is not part of Qt. In fact QtJambi has been deprecated a long time ago and the version you are using is a community edition. You should ask the authors of it directly.

  • 0 Votes
    5 Posts
    3k Views
    FerniF

    @benlau

    Thanks for answering my question!!! I could solve it :D

  • Using JOGL with QtJambi

    Unsolved Language Bindings
    5
    0 Votes
    5 Posts
    2k Views
    S

    Thanks for the information.
    I tested on a Windows 7 virtual machine and it works. So I suppose you are right about a compatibility problem with Sierra.
    I'll contact the current dev team of QtJambi.

  • 1 Votes
    5 Posts
    4k Views
    R

    @Zakaria Thanks! Still working in 5.9.2.

  • 0 Votes
    6 Posts
    2k Views
    R

    @Charles-Cai I know this thread is very old but do you got any solution? I am stuck in same problem. I want to load HTML page containing java applet using QWebEngineView. Can't find any way out. Your input can help me. Thanks

  • 0 Votes
    7 Posts
    3k Views
    W

    @SGaist
    Alright. I have installed Android Studio and will be testing. And something more?

  • 0 Votes
    5 Posts
    7k Views
    TheNetT

    @raven-worx

    I can't thank you enough. Really appreciate your response :)

    Best regards :)

  • 0 Votes
    9 Posts
    4k Views
    R

    Everything in Java is an object

    @benlau Okay, thanks for the information. Good to know :)

  • 0 Votes
    1 Posts
    696 Views
    No one has replied
  • 0 Votes
    4 Posts
    3k Views
    guidupasG

    Thanks for the help @Vi67

    I have done my code in Qt using QAndroidJniObject to write a equivalent java code.

    Register the caminhoimages.h as a QML type in the main.cpp and call the method buscaImagem()

    caminhoimagens.h

    #ifndef CAMINHOIMAGENS_H #define CAMINHOIMAGENS_H #include <QObject> #include "imagepickerandroid.h" #include <QDebug> class caminhoImagens : public QObject { Q_OBJECT Q_PROPERTY(QString imagemCaminho READ imagemCaminho NOTIFY imagemCaminhoChanged) public slots: void buscaImagem(); void retornaImagem(QString path); public: caminhoImagens(); QString imagemCaminho(); private: QString m_imagemCaminho = ""; signals: void imagemCaminhoChanged(); }; #endif //CAMINHOIMAGENS_H

    caminhoimagens.cpp

    #include "caminhoimagens.h" caminhoImagens::caminhoImagens() { } void caminhoImagens::buscaImagem() { imagePickerAndroid *imagePicker = new imagePickerAndroid(); connect(imagePicker, SIGNAL(imagemCaminhoSignal(QString)), this, SLOT(retornaImagem(QString))); imagePicker->buscaImagem(); } void caminhoImagens::retornaImagem(QString path) { qDebug() << path; m_imagemCaminho = path; emit imagemCaminhoChanged(); } QString caminhoImagens::imagemCaminho() { return m_imagemCaminho; }

    imagepickerandroid.h

    #ifndef IMAGEPICKERANDROID_H #define IMAGEPICKERANDROID_H #include <QObject> #include <QtAndroidExtras> #include <QDebug> class imagePickerAndroid : public QObject, public QAndroidActivityResultReceiver { Q_OBJECT public: imagePickerAndroid(); void buscaImagem(); virtual void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject & data); signals: void imagemCaminhoSignal(QString); }; #endif // IMAGEPICKERANDROID_H

    imagepickerandroid.cpp

    #include "imagepickerandroid.h" imagePickerAndroid::imagePickerAndroid() { } void imagePickerAndroid::buscaImagem() { QAndroidJniObject ACTION_PICK = QAndroidJniObject::fromString("android.intent.action.GET_CONTENT"); QAndroidJniObject intent("android/content/Intent"); if (ACTION_PICK.isValid() && intent.isValid()) { intent.callObjectMethod("setAction", "(Ljava/lang/String;)Landroid/content/Intent;", ACTION_PICK.object<jstring>()); intent.callObjectMethod("setType", "(Ljava/lang/String;)Landroid/content/Intent;", QAndroidJniObject::fromString("image/*").object<jstring>()); QtAndroid::startActivity(intent.object<jobject>(), 101, this); qDebug() << "OK"; } else { qDebug() << "ERRO"; } } void imagePickerAndroid::handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data) { qDebug() << "Trabalha com os dados"; jint RESULT_OK = QAndroidJniObject::getStaticField<jint>("android/app/Activity", "RESULT_OK"); if (receiverRequestCode == 101 && resultCode == RESULT_OK) { QString imagemCaminho = data.callObjectMethod("getData", "()Landroid/net/Uri;").callObjectMethod("getPath", "()Ljava/lang/String;").toString(); emit imagemCaminhoSignal(imagemCaminho); qDebug() << imagemCaminho; } else { qDebug() << "Caminho errado"; } }
  • 0 Votes
    3 Posts
    1k Views
    M

    @kolegs Thanks a lot dear kolegs. Very good reply ;)

  • 0 Votes
    2 Posts
    1k Views
    R

    For anyone else stumbling upon this issue. This is marked as fixed for release in 5.9:

    https://bugreports.qt.io/browse/QTBUG-43223

  • 0 Votes
    2 Posts
    1k Views
    yeckelY

    Popatrz na www.kdab.com/qt-android-episode-7 BogDan tam wyjasznia, jak tego zrobic.