Question: You are writing this method to process some data: private String fetch (String gitHubId) { String userInfo = ; String url = String.format(https://api.github.com/users/%s, gitHubId);

You are writing this method to process some data: private String fetch

You are writing this method to process some data: private String fetch (String gitHubId) { String userInfo = ""; String url = String.format("https://api.github.com/users/%s", gitHubId); OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() } .url (url) .build(); try (Response response = client.newCall (request).execute()) { userInfo = response.body () .string(); } catch (IOException ioe) { } Log.e(TAG, ioe.getMessage()); return userInfo; You have to decide on the best way to use this method in your application. What will be your selection from the following options ?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The best way to use the fetch method in your application would be Option 3 Run the method on a backg... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!