Most voted "retrofit" questions
Retrofit is a secure type HTTP client for Android and Java developed by Square, Inc.
Learn more…85 questions
Sort by count of
-
7
votes2
answers1075
viewsSend camera image to server by Retrofit
I learned how to send a picture of the folder drawable to my network server using lib Retrofit, but I’m not getting it from a ImageView, received from camera capture. I create a class that converts…
-
6
votes2
answers1773
viewsWhat is the Retrofit?
I am using the retrofit in an application to consume a Java Web Service and I am in doubt: Retrofit is a library or API?
-
5
votes1
answer1057
viewsHow to get the result of the Retrofit 2.0 Request
Well, I’m starting to study Android, I’ve already requested with Volley but a friend indicated me Retrofit for being much faster and "simple". But I still don’t understand much. I have a Webservice…
-
5
votes0
answers1238
viewsError: Trust Anchor for Certification path not found
I have an app Android, using the library Retrofit to manipulate requests, while trying to make any request in a android 5.0 or less, I receive the following log: I/call:…
-
4
votes1
answer836
viewsHow to read a local json file using retrofit 2.0?
For API testing purposes, I need to read json files that would be my answer in API requests. Well, with Retrofit 1.9 it was possible to implement a "Client" and overwrite the "execute()" method to…
-
4
votes2
answers5541
viewsExpected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 Com Webservice JAX-RS e Android Retrofit
I’m studying Webservice and consumption on Android with Retrofit2. I’ve done tests with public Apis like Viacep and FIPE and I can use the retrofit quietly, very easy but when I set up my own…
-
4
votes0
answers222
viewsTreating JSON Response with Retrofit in Android Studio
To be clear, I am developing a simple application test, where my user type the Cpf of a registered customer and their data as customers appear on the screen. My server returns me a json with a…
-
3
votes2
answers103
viewsString deserialization
I caught the Retrofit Drivers field from the following json: { "Drivers": [ { "DriverID": 0, "Latitude": -23.642276336, "Longitude": -46.634615118 }, { "DriverID": 1, "Latitude": -23.64227916,…
-
3
votes1
answer4234
viewsretrofit - How to send a JSON via POST
Talk guys, I’m using Retrofit 2 and I’m not getting JSON to WS. I have here my class that tidies up the json the way I need it: Customgsonadapter public class CustomGsonAdapter { public static class…
-
3
votes1
answer238
viewsIgnore attribute in POST using Retrofit
I would like to know how to ignore a model attribute in a request POST with Retrofit. In requests GET I want to bring all attributes, but in requests POST I need to send the object without the id…
-
3
votes2
answers260
viewsRetrieve json object
I have the following object: { codigo : "1", nome : "Carlos" } Java class (POJO) public class usuario{ @SerializedName("codigo") private int codigo; @SerializedName("nome") private String nome; /*…
-
3
votes1
answer121
viewsHow to make two Retrofit chain calls with Rxjava?
I make a call to recover some data and the second call - which should be made inside the first one - uses one of the fields of the previous call. val restApi = retrofit.create(RestAPI::class.java)…
-
2
votes3
answers664
viewsRequest within a defined time interval
My application should update a list of data coming from the server every 5 minutes. Using Retrofit for Request HTTP, what’s the best way to do that?
-
2
votes0
answers121
viewsRetrofit response coming in as null
I am trying to make a retrofit call from a list of objects (Registrations) and in Httploggininterceptor the answer is appearing normally. What might be going on? My call: CadastroApi cadastroApi =…
-
2
votes1
answer112
viewsSelected Item Listview Retrofit
I have an application that uses retrofit for connection, and in it I have a listview where I want to do a long click on it and select the position item and do a post on the webservice with this…
-
2
votes1
answer489
viewsHow can I browse this JSON and recover the Movies list?
I am having difficulty going through this JSON and extracting the data from the "Movies Array". Follows JSON: (https://yts.ag/api/v2/list_movies.json) The mistake is this:…
-
2
votes0
answers48
viewsJaxb converting abstract class with Retrofit
I have a Core project where there is a User class @XmlSeeAlso(value = {UserClient.class, UserProfessional.class}) public abstract class User implements Serializable { Userprofessional class @Getter…
-
2
votes1
answer112
viewsHow to make a method wait for the java server response using Retrofit2?
Hello friends I have the following method that requests to the server: public MetaDataR metodo1(final String m) { Call<MetaDataR> call2 = new RetrofitConfig().getMetasService().getMetas(m);…
-
2
votes1
answer357
viewsPass parameters in the Retrofit2 GET method for Android
Talk to me, baby? I’m trying to pass a parameter in the retrofit, but I’m not getting it. I confess that I’m very beginner in Android. I did a little research, but what I tried didn’t work out so…
-
1
votes1
answer176
viewsWhy does Retrofit make an exception when the status code is 204?
After a consultation GET only to check if a content exists on the server, the return is 200 (exists) or 204 (there is no). Why does Retrofit trigger the exception below when the server returns the…
-
1
votes0
answers130
viewsError: Content-Length and stream length disagree
If you use a Log thus rescuing the body of the sponse: Log.wtf(TAG,""+response.body().string()); Correctly prints the JSON value. Something in this format: {"error":true,"message":"Login failed.…
-
1
votes1
answer267
viewsError sending Arraylist via POST in Retrofit 2: java.lang.Illegalstateexception: Expected BEGIN_ARRAY but was STRING
When I try to send an Arraylist via @POST to be saved to my webserver with Retrofit2, Arraylist is saved, but I am getting the following error: java.lang.Illegalstateexception: Expected BEGIN_ARRAY…
-
1
votes1
answer90
viewsAndroid Load JSON
I need to get the information from a JSON, I created a php code that transforms the database into mysql in JSON https://portfoliounopar.000webhostapp.com/index.php, Now I need to take this…
-
1
votes1
answer83
viewsHow to know when a retrofit call is completed in order to start an Activity?
I have two calls (Call) from Retrofit 2, one that downloads a Config object, and one that downloads a list of Entries. I need to know when those two calls are finished, so I can call a new one…
-
1
votes1
answer427
viewsProblems making call using Retrofit on Android
I’m a student and I’m having a hard time understanding where I’m going wrong in a job that the teacher went through. Briefly describing, the teacher provided an API on Github, which after the…
-
1
votes2
answers131
viewsError closing Progressidialog
public UserRest login(Usuario usuario, final Context context){ try { showProgress(context, "Aguarde", "Validando usuário..."); UserService service =…
-
1
votes1
answer216
viewsError with retrofit
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $ public interface RestApi { @GET("/posts")…
-
1
votes0
answers1251
viewsPost request with retrofit + android
I’m studying android, and I’m trying to use the retrofit library with android. After reading the documentation and seeing several examples in responses here at stackoverflow I was able to send data…
-
1
votes1
answer303
viewsRetrofit, Response body always null but on the server is status 200
I am implementing an Android application using Retrofit 2, the service is generic the server side is working. The problem is: Response.body() is always null, I can never catch json, even if I can…
-
1
votes1
answer79
viewsPicture arrives null on the server
I am sending data using the retrofit, I observe all the request until the end and I get the code 200 more on the server side the image arrives null, as I am sending the image and text arrives…
-
1
votes1
answer169
viewsPopular Listview with Retrofit2 Data
I’m trying to pupate a listview with information I get from WS through Retrofit2. But error somewhere and nothing is presented, neither error nor listview. can give me a strength for kindness.…
-
1
votes1
answer1752
viewsNetworkerror: 400 Bad Request
When sending a post I received by retrofit in the log the message Networkerror: 400 Bad Request. In Development Environment no error occurs, data is synchronized from device to Server ( Tomcat )…
-
1
votes1
answer648
viewsExtract data from JSON within JSON that they see from a Web Service serving an Android APP
Good night, guys, how are you? I am developing an Android APP and it consumes data from a webservice, but I’m having trouble bringing some information to the APP. This is the JSON I return to my…
-
1
votes1
answer285
views -
1
votes0
answers198
viewsAndroid Retrofit 2 Simple XML Converter Response
I am using Retrofit 2.2.0 and Retrofit Simplexml Converter 2.2.0. I added the simplexmlconverter at the time of the retrofit with the addConverterFactory method. The problem is that when I get the…
-
1
votes1
answer349
viewsRetrofit always returning null in Response
The answer comes with code 200, IE, correct, but the body is null. Follows the model: public class MovieModel { @SerializedName("imdbID") @Expose public String idMovie; @SerializedName("Title")…
-
1
votes0
answers244
viewsDoes not access the Onresponse() retrofit android method
I’m making a call to a post method that returns an id generated through retrofit 2, however, in return, never access the method onResponse, I’ve tried to use other objects and formats, but none…
-
1
votes0
answers66
viewsJson Retrofit Badly Formed
I’m with my return in json like this: { "success": 1, "email": "[email protected]" } But the retrofit is saying it’s poorly formed: Gives the following message: use Jsonreader.setLenien(true) to…
-
1
votes1
answer34
viewsAndroid: Error using Retrofit with XML converter
I’m making a simple example of Retrofit on Android with an XML converter, but every time I run I get the following exception: java.lang.RuntimeException:…
-
1
votes1
answer161
viewsSpinner Android Retrofit
Good morning I’m creating an app, and I need it to have a spinner, which pull all the data from a database column. But it turns out that when I pull it brings the dice, but only that it makes the…
-
1
votes1
answer17
viewsRun call in retrofit 2
I am having trouble creating the call with retrofit 2 to the following url: https://api.themoviedb.org/3/movie/2310?api_key=MINHA_API_KEY&language=pt-BR On android, the call I’m making is…
-
1
votes1
answer144
viewsRetrofit Answer returning null with code 406 Not Acceptable
Talk personal, I’m using Retrofit2 with Kotlin and I’m trying to perform a POST request where a Json will be returned. The request is made and the server part works (register the user), however when…
-
1
votes0
answers78
viewsHow to wait for the request to finish to get the data?
I need to take the data that comes inside a Sponse, but when I get a get on the Sponse object it gives error saying it is null. I think it has something to do with my get being done before Sponse…
-
0
votes1
answer407
viewsError using Retrofit 2
t={movieName}&apikey=11111" must not have replace block. For Dynamic query Parameters use @Query. This error happens when trying to fetch a movie by name, I have the codes below, but the error…
-
0
votes1
answer2105
viewsPass more than one parameter through the URL
I have the following code: public interface service { @GET("?acao=R&tipo_refeicao={tipo}&data={data}") public void getCardapio( Callback<List<Cardapio>>…
-
0
votes2
answers452
viewsConsume Webservices with Android - Retrofit or Volley?
The question is just this: to consume Webservices with Android - Retrofit or Volley? I found the two complicated at first, but reading the documentation it seemed to me that retrofit can be…
-
0
votes0
answers41
viewsHow to know when the Sqlite query ended?
In my app I have a synchronization method, this method downloads several entries from my webservice and inserts them into the local Sqlite database through a for loop. I need to know when the Sqlite…
-
0
votes1
answer539
viewsHow to make a post using Retrofit
I need to create a post in the retrofit to which sending follows this pattern, I have each class separately and a class IDVerification that count all together, and I don’t know which way to mount…
-
0
votes2
answers268
viewsHow to make a list from a GET request in Retrofit 2?
My question is how to take the request JSON and put it in an Arraylist so I can inflate the Recyclerview. Thanks in advance.
-
0
votes0
answers61
viewsBackfit URL Encounter
How do I get my url that contains a "+" to be sent by retrofit with "Encode" but currently the result url is: http://api.xxxx.com.br/aluno?campo=220+2d+ And hence my backend entede this + as a…