datajs phonegap (android emulator)

May 4, 2012 at 8:36 AM

Hi all,

I am currently developing a mobile app using datajs to consume the Odata Rest service.

When I test the application on Google Chrome it works with the following are done --allow-file-access-from-files --disable-web-security.

However, when i tried it on an android emulator, I have problem with authentication most probably because of the same origin policy problem.

Is there anyway to get around this?

Thank you.

Amanda

May 7, 2012 at 8:11 PM

Hi Amanda,

    I believe you are right and the same origing policy is being the culprit here.  You can try some iframe based techniques (search fro "Cross Domain Authentication" and some helpful articles might pop up. ) to get the authentication token and then let datajs use JSONP to make the cross domain requests.  Bear in mind that JSONP requests are read only and  you will not be able to make any updates to the OData Endpoint.

Regards,

Alex Trigo.

May 8, 2012 at 3:26 AM

Hi Alex,

Thanks for the reply =)

I cannot use JSONP because I would eventually need to POST back and update data back to the server. Do you think reverse proxy will be able to solve this?

Thanks

Amanda

May 11, 2012 at 10:41 PM

Hi Amanda,

   I see, in that case yes a reverse proxy is probably what you need :)

Regards,

Alex Trigo.