dependencies { implementation 'com.squareup.retrofit:retrofit:1.9.0' //butter knife implementation 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'}<uses-permission android:name="android.permission.INTERNET"/><RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/tv_result" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="22sp"/></RelativeLayout>public interface AppConstants { String BASE_URL = "https://api.github.com/";}import com.google.gson.JsonObject;public interface ApiRequests { @GET("/users/{userName}") void getUserDetails(@Path("userName") String name, Callback<JsonObject> callback);}public class ApiConnector { public static ApiRequests getApiConnector(String baseUrl) { RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint(baseUrl).build(); return restAdapter.create(ApiRequests.class); }}public class MainActivity extends AppCompatActivity { @BindView(R.id.tv_result) TextView mTVResult; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); ApiRequests apiRequests = ApiConnector.getApiConnector(AppConstants.BASE_URL); //todo; apiRequests.getUserDetails("lokeshkondaparthi", new Callback<JsonObject>() { @Override public void success(JsonObject jsonObject, Response response) { String location = jsonObject.get("location").getAsString(); mTVResult.setText(location); } @Override public void failure(RetrofitError error) { mTVResult.setText(error.getMessage()); } }); }}