1

When using XCode and phonegap, I usually edit the .plist file to whitelist the url of my AJAX requests. How is this done in Eclipse on an Android phonegap project? After Googling the issue, I did come across editing the .htaccess file and adding in

Access-Control-Allow-Origin *

I don't have permissions to modify the .htaccess file.

This works fine for iPhone when whitelisted. On Android, I get the

xmlhttprequest cannot load is not allowed by access-control-allow-origin

error, so being that it works with the iPhone with no issue after adding the url to the whitelist, do I have to modify the server for this to work? or can I whitelist the URL in this Android project in Eclipse using Phonegap? I do have access to the PHP files the ajax requests to, is there something I can do with those if whitelisting isn't an option?

user1053263
  • 722
  • 2
  • 16
  • 33

1 Answers1

3

For Read this Documentation and try to solve this issue

In my Conditions this is working with both device..(iPhone and Android)

for Android you edit this file "res/xml/cordova.xml" or "res/xml/phonegap.xml"

MRT
  • 1,610
  • 15
  • 41
  • Thanks for the replay MRT, I actually ended up figuring out that this problem is ONLY on JellyBean (Android 4.1). Trying to figure out what this guy did to get it working using the if() statement: http://stackoverflow.com/questions/11318703/access-control-allow-origin-error-at-android-4-1 – user1053263 Sep 28 '12 at 05:37
  • 1
    whatever, If your work is done. then enjoy developer life... Cheers..! – MRT Sep 28 '12 at 05:51