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?

1 Answer 1

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"

Sign up to request clarification or add additional context in comments.

2 Comments

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: stackoverflow.com/questions/11318703/…
whatever, If your work is done. then enjoy developer life... Cheers..!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.