I'm still new to Phonegap, and now I'm working with the Android SDK. At least I wanted to do XMLHttpRequest to retrieve data from my server. I used to know about the same origin policy, and I asked myself how this should work with the “native application”.
I searched the Internet and found some topics where people told others that Phonegap doesn’t have a policy of the same origin, because it uses the file:// protocol and, in addition, it has a whitelist for the domain config.xml .
On the other hand, there were many topics of people having problems with XHR, while others told them that this was due to the same origin policy ...
Well, I was confused, but I used my regular websites - I worked out the XMLHttpRequest snippet and put it in the Phonegap application. I tried a virtual device, but my request is not working.
Now I asked myself a few questions:
- Who is right? Is there the same origin policy in Phonegap or not?
If yes:
Fabi
source share