Answers for "how to implement retrofit in android example"

8

add retrofit dependency android

implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
Posted by: Guest on October-27-2020
0

retrofit

// Trailing slash is needed
public static final String BASE_URL = "http://api.myservice.com/";
Retrofit retrofit = new Retrofit.Builder()
    .baseUrl(BASE_URL)
    .addConverterFactory(GsonConverterFactory.create())
    .build();
Posted by: Guest on October-11-2021

Code answers related to "how to implement retrofit in android example"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language