Run php script stored in the server?

前端 未结 2 1331
独厮守ぢ
独厮守ぢ 2021-02-06 17:30

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 ph

相关标签:
2条回答
  • 2021-02-06 18:02

    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
    }
    
    0 讨论(0)
  • 2021-02-06 18:15

    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

    0 讨论(0)
提交回复
热议问题