retrofit

Retrofit illegalargumentexception, no annotation found

五迷三道 提交于 2020-01-17 09:03:45
问题 So when running my app I'm getting this error: 06-17 12:56:08.547 E/AndroidRuntime(23432): Caused by: java.lang.IllegalArgumentException: XapoService.credit: No Retrofit annotation found. (parameter #1) I have Google searches and found it may be caused by ProGuard. I added the following lines to my ProGuard: -keep class com.google.gson.** { *; } -keep class com.google.inject.** { *; } -keep class org.apache.http.** { *; } -keep class org.apache.james.mime4j.** { *; } -keep class javax.inject.

Retrofit illegalargumentexception, no annotation found

爱⌒轻易说出口 提交于 2020-01-17 09:02:20
问题 So when running my app I'm getting this error: 06-17 12:56:08.547 E/AndroidRuntime(23432): Caused by: java.lang.IllegalArgumentException: XapoService.credit: No Retrofit annotation found. (parameter #1) I have Google searches and found it may be caused by ProGuard. I added the following lines to my ProGuard: -keep class com.google.gson.** { *; } -keep class com.google.inject.** { *; } -keep class org.apache.http.** { *; } -keep class org.apache.james.mime4j.** { *; } -keep class javax.inject.

NoSuchMethodError When Trying to Log Retrofit JSON Response [duplicate]

此生再无相见时 提交于 2020-01-17 06:29:05
问题 This question already has answers here : Retrofit logging interceptor exception (4 answers) Closed 3 years ago . I am taking my first stab at logging a Retrofit response, and I understand that OKHttp is automatically included in releases of Retrofit 2.x. I have created my code and am receiving the included error: Activity: public class MainActivity extends AppCompatActivity { private EditText mSearchTerm; private Button mRequestButton; private String mQuery; @Override protected void onCreate

Retrofit Query Annotation Without Ampersand

风格不统一 提交于 2020-01-17 05:28:10
问题 I am trying to make an API call to a mobile backend with Retrofit 2.0. In my API call, i have to make necessary call to this URL https://api.backendless.com/v1/data/Users?where=followings.objectId=%270B3BA7F9-260F-B378-FF9A-3C2448B8A700%27 To form this URL in Retrofit i have been using below interface @GET("Users?where=") Call<List<User>> getFollowers(@Query("followings.objectId") String objectId); This interface call puts an ampersand before the query parameters and generates a URL like

data is not getting displayed in retrofit

狂风中的少年 提交于 2020-01-16 09:06:35
问题 I using retrofit to display data but data is not getting displayed.i don't know where am I getting wrong.in logcat im getting response as: 2019-12-26 20:34:39.847 28305-28305/com.example.androidtutorial E/helloash: [com.example.androidtutorial.GetAheadFolder.JavaDatum@36ebcd9] I need help..thanks GetAHeadModelsnext: public class GetAHeadModelsnext{ @SerializedName("id") @Expose private String id; @SerializedName("title") @Expose private String title; @SerializedName("java_data") @Expose

data is not getting displayed in retrofit

故事扮演 提交于 2020-01-16 09:06:09
问题 I using retrofit to display data but data is not getting displayed.i don't know where am I getting wrong.in logcat im getting response as: 2019-12-26 20:34:39.847 28305-28305/com.example.androidtutorial E/helloash: [com.example.androidtutorial.GetAheadFolder.JavaDatum@36ebcd9] I need help..thanks GetAHeadModelsnext: public class GetAHeadModelsnext{ @SerializedName("id") @Expose private String id; @SerializedName("title") @Expose private String title; @SerializedName("java_data") @Expose

Capturing List response for a Retrofit Call with Json body

一个人想着一个人 提交于 2020-01-16 08:46:10
问题 All. I am trying to use Retrofit to send raw json as a body in a POST Request to the server. @POST("api/apps") Call<List<GetApps>> getApp(@Body GetApps body); I have built the model using jsontopojo for the responses that are coming back. Inside my call, I have put the constructors and the getters and setters and also toString(). This is my retrofit call. Retrofit retrofit = new Retrofit.Builder() .baseUrl(APIUrl.BASEURL) .addConverterFactory(GsonConverterFactory.create()) .build();

Posting Retrofit to Rest server in Android

房东的猫 提交于 2020-01-16 06:14:52
问题 As part of a group university project, we're using a PHP rest server to send data to an Oracle server. So far, all of the get methods work fine, but I'm having trouble understanding how to post data, as it's not working. This is the PHP $app->post('/room', function () use ($app) { $request = $app->getInstance()->request(); $room = json_decode($request->getBody(), true); $sql = 'INSERT INTO rooms VALUES(null, :room_pcm, :property_id)'; $query = oci_parse(getConnection(), $sql); $room_pcm =

Posting Retrofit to Rest server in Android

蹲街弑〆低调 提交于 2020-01-16 06:14:18
问题 As part of a group university project, we're using a PHP rest server to send data to an Oracle server. So far, all of the get methods work fine, but I'm having trouble understanding how to post data, as it's not working. This is the PHP $app->post('/room', function () use ($app) { $request = $app->getInstance()->request(); $room = json_decode($request->getBody(), true); $sql = 'INSERT INTO rooms VALUES(null, :room_pcm, :property_id)'; $query = oci_parse(getConnection(), $sql); $room_pcm =

How to display image in a listview from json response in android

别说谁变了你拦得住时间么 提交于 2020-01-15 15:55:46
问题 Hi in the below code am displaying data from json response using retrofit library. using recylerview am displaying title,id,albumid as well as image.all are displaying except image . But how to display image from url. can any one please help me this is my adapter class. .java public class RecyclerViewAdapterForAlbum extends RecyclerView.Adapter<RecyclerViewAdapterForAlbum.ViewHolder> { private List<UserAlbum> item; Context context ; public RecyclerViewAdapterForAlbum(Context context, List