问题
I have a php script stored in Wamp server, and want that my application execute it to perform some image treatement from server then the server send the result to the Android phone. Is that possible to perform ? And please if so can you give some hints?
Thank you very much.
回答1:
Simply perform HTTP get request:
String url = "http://your.domain.com/path/to/file.php";
HttpClient client = new DefaultHttpClient();
try {
client.execute(new HttpGet(url));
} catch(IOException e) {
//do something here
}
回答2:
There are various ways to do that 1. You can call the script using webrequest.create from your application Or you can use CURL in case of php application 2. You can execute the script using cron job and schedule it to run according to your need
Link 1
Link 2
来源:https://stackoverflow.com/questions/8358967/run-php-script-stored-in-the-server