Unsolved XMLHttpRequest on Android Device (ARM)
-
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.
-
@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 -
@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. -
@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 -
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? -
@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? -NoThank you.
-
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. -
@SGaist
Sorry, but I don't understandAs 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
-
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.
-
@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
-
In your console. And don't forget to replace the
<XXX>
variables with the correct values. -
@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
-
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.
-
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