Search code examples
javajavascriptandroidcordovadwr

Connecting from phonegap android to java server


We have a server written in java, and an application written in phonegap for the android with javascript.

How can we transfer and receive information from the application to the server? We've tried using DWR to no avail, as the html file is on the android, so we can't call methods on the server.

Is there anyway around it so we can use DWR or another method to contact the server?

Thanks


Solution

  • We transfer and receive information by using AJAX calls and jQuery, and setting the server headers correctly (i.e., setting "Access-Control-Allow-Origin" to "*"). This allows any client to make cross-domain AJAX calls.