Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. XMLHttpRequest on Android Device (ARM)
Forum Updated to NodeBB v4.3 + New Features

XMLHttpRequest on Android Device (ARM)

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
15 Posts 4 Posters 3.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • carles.sole.grauC Offline
    carles.sole.grauC Offline
    carles.sole.grau
    wrote on last edited by carles.sole.grau
    #1

    Hi everybody,
    When I do an XMLHtttp request in a QML app that I'm designing on my Desktop everything works as expected. If I run this app through an Android Emulator too.
    But, when I run the app through my Android Device (armeabi) my XMLHttp request does not work.
    The state is always 0 (not 200 as expected) and my rsp is empty.
    I 've found this:
    http://doc.qt.io/qt-5/opensslsupport.html
    https://bugreports.qt.io/browse/QTBUG-32758
    But I don't understand at all how to implement the steps they said in the page.
    Anyone could help me?
    Thank you very much.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Schluchti
      wrote on last edited by Schluchti
      #2

      Are you sure it's related to OpenSSL? You could verify that by making a request to a non-https url. If that doesn't work either, it's unlikely that it's due to OpenSSL.
      Another possibility would be that you are missing the Internet permission in your AndroidManifest

      <uses-permission android:name="android.permission.INTERNET"/>
      

      If it's related to OpenSSL, you probably need to let us know what you already did and where the problems are.

      Want to read more about Qt?

      https://gympulsr.com/blog/qt/

      Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

      carles.sole.grauC 1 Reply Last reply
      0
      • S Schluchti

        Are you sure it's related to OpenSSL? You could verify that by making a request to a non-https url. If that doesn't work either, it's unlikely that it's due to OpenSSL.
        Another possibility would be that you are missing the Internet permission in your AndroidManifest

        <uses-permission android:name="android.permission.INTERNET"/>
        

        If it's related to OpenSSL, you probably need to let us know what you already did and where the problems are.

        carles.sole.grauC Offline
        carles.sole.grauC Offline
        carles.sole.grau
        wrote on last edited by
        #3

        @Schluchti
        I'm pretty sure it is.
        Because when I do the request to this server:
        http://re.jrc.ec.europa.eu/pvgis/apps4/MRcalc.php erverything is working fine.
        And I've already have permissions to Internet.

        I'm just trying to make a POST request to a PHP file inside a server located in:
        https://www.000webhost.com/
        This PHP file has to return a RSP (and when I do it on the Laptop it works fine) but on my Android Device it not returns anything and my Status of the request is 0.
        Thanks

        S 1 Reply Last reply
        0
        • carles.sole.grauC carles.sole.grau

          @Schluchti
          I'm pretty sure it is.
          Because when I do the request to this server:
          http://re.jrc.ec.europa.eu/pvgis/apps4/MRcalc.php erverything is working fine.
          And I've already have permissions to Internet.

          I'm just trying to make a POST request to a PHP file inside a server located in:
          https://www.000webhost.com/
          This PHP file has to return a RSP (and when I do it on the Laptop it works fine) but on my Android Device it not returns anything and my Status of the request is 0.
          Thanks

          S Offline
          S Offline
          Schluchti
          wrote on last edited by
          #4

          @carles.sole.grau Ok, then it's probably due to OpenSSL. ;-)
          Compiling OpenSSL isn't that hard, when you know how to do it. In order to help you, you need to provide us more informations about you problem.

          Want to read more about Qt?

          https://gympulsr.com/blog/qt/

          Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

          carles.sole.grauC 1 Reply Last reply
          0
          • S Schluchti

            @carles.sole.grau Ok, then it's probably due to OpenSSL. ;-)
            Compiling OpenSSL isn't that hard, when you know how to do it. In order to help you, you need to provide us more informations about you problem.

            carles.sole.grauC Offline
            carles.sole.grauC Offline
            carles.sole.grau
            wrote on last edited by
            #5

            @Schluchti
            Which informations do you need?
            I write my problem above, I don't know what's more I have to tell.
            If you said what you need to know, I will write it.
            Thanks

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Schluchti
              wrote on last edited by Schluchti
              #6

              The steps at http://doc.qt.io/qt-5/opensslsupport.html are actually pretty detailed. So in order to help you we need to know at which step we need to assist you.

              Which operating system are you using to cross-compile OpenSSL? (I can recommend you linux, as it's slightly easier in my opinion)
              Have you already downloaded the Android NDK and OpenSSL?
              Do you know how to deal with Makefiles?
              Do you know how to set the environmental variables?

              Want to read more about Qt?

              https://gympulsr.com/blog/qt/

              Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

              carles.sole.grauC 1 Reply Last reply
              0
              • S Schluchti

                The steps at http://doc.qt.io/qt-5/opensslsupport.html are actually pretty detailed. So in order to help you we need to know at which step we need to assist you.

                Which operating system are you using to cross-compile OpenSSL? (I can recommend you linux, as it's slightly easier in my opinion)
                Have you already downloaded the Android NDK and OpenSSL?
                Do you know how to deal with Makefiles?
                Do you know how to set the environmental variables?

                carles.sole.grauC Offline
                carles.sole.grauC Offline
                carles.sole.grau
                wrote on last edited by
                #7

                @Schluchti
                I'm stucked at step 3
                I'm using Ubuntu Desktop, and I have Android NDK and OpenSSL
                Do you know how to deal with Makefiles? - No
                Do you know how to set the environmental variables? -No

                Thank you.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi,

                  In this case, dealing with the Makefile is just following the documentation: open the file with your favorite editor and modify its content. WARNING do NOT do any tab conversion when editing the file.

                  As for number 2, if you are on a *nix like environment put export in front of each variable you have to export.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  carles.sole.grauC 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Hi,

                    In this case, dealing with the Makefile is just following the documentation: open the file with your favorite editor and modify its content. WARNING do NOT do any tab conversion when editing the file.

                    As for number 2, if you are on a *nix like environment put export in front of each variable you have to export.

                    carles.sole.grauC Offline
                    carles.sole.grauC Offline
                    carles.sole.grau
                    wrote on last edited by
                    #9

                    @SGaist
                    Sorry, but I don't understand

                    As for number 2, if you are on a *nix like environment put export in front of each variable you have to export.
                    

                    And I don't the things I have to change in the MakeFile

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      What OS are you running ?

                      The lines to replace in the Makefile are written in the documentation.

                      In any case there's @ekkescorner repository that provides helper scripts to build OpenSSL for Android.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      carles.sole.grauC 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        What OS are you running ?

                        The lines to replace in the Makefile are written in the documentation.

                        In any case there's @ekkescorner repository that provides helper scripts to build OpenSSL for Android.

                        carles.sole.grauC Offline
                        carles.sole.grauC Offline
                        carles.sole.grau
                        wrote on last edited by
                        #11

                        @SGaist
                        https://forum.qt.io/topic/77525/xmlhttprequest-on-android-device-arm/7
                        As I said, Ubuntu Desktop.
                        And those lines?, where they are to be used?:

                        CC=<ANDROID_NDK_PATH>/toolchains/arm-linux-androideabi-<VER>/prebuilt/<NDK_HOST>/bin/arm-linux-androideabi-gcc
                        AR=<ANDROID_NDK_PATH>/toolchains/arm-linux-androideabi-<VER>/prebuilt/<NDK_HOST>/bin/arm-linux-androideabi-ar
                        ANDROID_DEV=<ANDROID_NDK_PATH>/platforms/<ANDROID-PLATFORM>/arch-arm/usr
                        
                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          In your console. And don't forget to replace the <XXX> variables with the correct values.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          carles.sole.grauC 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            In your console. And don't forget to replace the <XXX> variables with the correct values.

                            carles.sole.grauC Offline
                            carles.sole.grauC Offline
                            carles.sole.grau
                            wrote on last edited by carles.sole.grau
                            #13

                            @SGaist
                            Ok, thankyou.
                            I don't understant this <XXX> value =>ANDROID-PLATFORM, what does it means?
                            If it's Android18,19,20...
                            But then, my App could only run properly in this platform?

                            Thanks

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              The name of the folder of the android platform you want to target.

                              You really should consider using @ekkescorner scripts, that would make your life simpler.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • GTDevG Offline
                                GTDevG Offline
                                GTDev
                                wrote on last edited by
                                #15

                                Hi @carles.sole.grau,

                                You can also have a look at V-Play Engine if you want to avoid having to build and provide the SSL library for Android. V-Play comes with already bundled SSL libs since version 2.10.0.

                                Best,
                                GT

                                Senior Developer at Felgo - https://felgo.com/qt

                                Develop mobile Apps for iOS & Android with Qt
                                Felgo is an official Qt Technology Partner

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved