Answer the question
In order to leave comments, you need to log in
Http request on android?
I have a php server.
header("Content-Type: json/application; charset=UTF-8");
...
http_response_code(200);
echo json_encode($locations);
[
{
"id": "1",
"name": "Банкомат 1",
"x": "55.9624304",
"y": "34.0317051"
},
{
"id": "2",
"name": "Банкомат 2",
"x": "56.9624304",
"y": "34.0317051"
},
{
"id": "3",
"name": "Банкомат 3",
"x": "57.9624304",
"y": "34.0317051"
}
]
Answer the question
In order to leave comments, you need to log in
You need to use some HTTP library like Volley .
An example of a simple request to a web server: https://developer.android.com/training/volley/simple .
You can parse the received response yourself or use ready-made libraries, such as GSON .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question