D
Deleted User
Guest
I'm trying to make an android application that retrieves information from a sever and returns it in a list. The server has it's own api for retrieving information
I've seen the example provided by google:
And I somewhat understand it, however I'm having a hard time figuring out how to use the sites own get api with the example above, and also how to parse m result into a list
I'm sorry if I'm not making much sense, the only experience I have with this was writing a script for battle snake that had the following lines
with this I could access information like this
I'm looking for a way to do that with an android application. I have the data url and the api for the site, I just don't know how to access it. I'm coding in Java. Thank you in advance
Code:
GET /xxxx/xxx.json?xxx=0104529
I've seen the example provided by google:
Java:
RequestQueue queue = Volley.newRequestQueue(this);
String url ="http://www.google.com";
// Request a string response from the provided URL.
StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
// Display the first 500 characters of the response string.
mTextView.setText("Response is: "+ response.substring(0,500));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
mTextView.setText("That didn't work!");
}
});
// Add the request to the RequestQueue.
queue.add(stringRequest);
And I somewhat understand it, however I'm having a hard time figuring out how to use the sites own get api with the example above, and also how to parse m result into a list
I'm sorry if I'm not making much sense, the only experience I have with this was writing a script for battle snake that had the following lines
Code:
@bottle.post('/move')
def move(self):
data = bottle.request.json
with this I could access information like this
Code:
ourSnakeX = data['snakes'[0]['coords'][0][0]]
I'm looking for a way to do that with an android application. I have the data url and the api for the site, I just don't know how to access it. I'm coding in Java. Thank you in advance