Android JSON to PHP Server and back

后端 未结 2 1934
悲&欢浪女
悲&欢浪女 2020-12-15 14:41

Can anybody offer a solution to the above?

For now, all i want to do is send a JSON request to my server (for example: {picture:jpg, color:green}), have the PHP acce

2条回答
  •  死守一世寂寞
    2020-12-15 15:11

    On the PHP side, all you need is the built-in json_decode, which will deserialize your json and return an object (or an associative array if you pass true as the second argument).

    On the Android side, you'll probably use the HTTP Libraries to execute your HTTP request and process the response. (But someone who's actually developed for Android might correct me)

提交回复
热议问题