XMLHttpRequest on Android Device (ARM)
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:
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.
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
If it's related to OpenSSL, you probably need to let us know what you already did and where the problems are.
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:
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.
@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.
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.
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?
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
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
exportin front of each variable you have to export.
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
What OS are you running ?
The lines to replace in the Makefile are written in the documentation.
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.
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?
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.