How to send variable from php to an android app?

后端 未结 2 1398
庸人自扰
庸人自扰 2021-01-15 12:51

Hi guys there is an activity on my current android app that has a webview in it. I was wondering how I could take and store a variable from the php on that website (yes I co

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-15 13:21

    Your android app needs to make a request to your PHP app, at a URL where you setup a PHP script to return the data you need.

    You could either return straight HTML, or if you just want to return data and let your Android app, JSON is an excellent data transfer format. XML is also popular but JSON is leaner and has good support these days.

提交回复
热议问题