简体   繁体   中英

Android App to WAMP Server Connection

I have a html form that is submitting data. The data is given to a php file through jquery post. The php changes values to a mysql database on the wamp server. I have put the app on android through phonegap. When I download the app to the device (through eclipse) and try to submit the form nothing happens. However if I run the same code on the android browser the code works.

How do I make the code work on the app like it does on the browser?

a few things.

1: make sure your app has internet permissions

<uses-permission android:name="android.permission.INTERNET" />

2: make sure your webview has javascript enabled

WebView m_webview = (WebView)findViewById(R.id.webMain);
WebSettings webSettings = m_webview.getSettings();
webSettings.setJavaScriptEnabled(true);

javascript is disabled by default for security reasons. as your posting with jquery, this seems like the most likely possibility.

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