相关疑难解决方法(0)

Android Volley中的JsonRequest VS StringRequest

我正在使用Android Volley进行网络通话.通常我使用JSONRequest接收json数据,然后使用GSON将它们转换为对象.

new Response.Listener<JSONObject>() {
                    @Override
                    public void onResponse(JSONObject response) {
                       ///Convert response.toString() to POJO using GSON
                    }
                };
Run Code Online (Sandbox Code Playgroud)

如果我使用普通字符串请求然后使用GSON将字符串转换为对象,那么它会比JSONRequest更快吗?

new Response.Listener<String>() {
                    @Override
                    public void onResponse(String response) {
                  ///Convert response to POJO using GSON
                    }
                };
Run Code Online (Sandbox Code Playgroud)

谢谢

android android-volley

2
推荐指数
1
解决办法
3120
查看次数

标签 统计

android ×1

android-volley ×1