简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM