retrofit 1.9 basics 2

build.gradle(Module: app)

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'
}

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET"/>

activity_main.xml

<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>

AppConstants

public interface AppConstants {
    String BASE_URL = "https://api.github.com/";
}

ApiRequests

import com.google.gson.JsonObject;
public interface ApiRequests {
    @GET("/users/{userName}")
    void getUserDetails(@Path("userName") String name, Callback<JsonObject> callback);
}

ApiConnector

public class ApiConnector {
    public static ApiRequests getApiConnector(String baseUrl) {
        RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint(baseUrl).build();
        return restAdapter.create(ApiRequests.class);
    }
}

MainActivity

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());
            }
        });
    }
}

Learn JSON parsing:

Android - JSON parsing