Home > Mobile >  Using Okhttp met question, would you please have a look.
Using Okhttp met question, would you please have a look.

Time:09-21

Novice learning, request return of data, the position in position 1 or 2 deal with the corresponding data? Or there is no difference, thank you!
The code below:

CodePudding user response:

With you, but from the code standard, you also advocated encapsulated into a method,

CodePudding user response:

Personal think, OkHttpHelp is the place where the request and deal with the corresponding data, process data can be in two places,
My advice is, "STR" if the back-end returned is a String, in fact, if the back-end returns json, Suggestions are in OkHttpHelp into specific entity class to use 2 ways to do logic to handle, so do get data shows in the Activity, don't do the work of data processing,
  • Related