Hello I have a json structure and I need to get the datas from url. How can I do that? What are classes and functions. Please help me. Thanks.
here is my json.
http://www.jsonschema2pojo.org/
Put your JSON response here and download java code from this website . Then put this java code into your project and use it . This website will make all required classes with all required fields which will be perfect fit for your response of JSON. I have used it many time this will surely work.
http://square.github.io/retrofit/ here you can get detailed information about how to use retrofit to POST or GET data .
Retrofit turns your HTTP API into a Java interface.
public interface YourService {
@GET("users/{user}/repos")
Call> listRepos(@Path("user") String user);
}
The Retrofit class generates an implementation of the interface.
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://api.yourAPI.com/")
.build();
YourService service = retrofit.create(YourService .class);
Call> repos = service.listRepos("myrepository");
Use annotations to describe the HTTP request: