Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在具有RecyclerView的网格视图中将Json数据解析为_Android_Json_Gridview_Android Recyclerview - Fatal编程技术网

Android 在具有RecyclerView的网格视图中将Json数据解析为

Android 在具有RecyclerView的网格视图中将Json数据解析为,android,json,gridview,android-recyclerview,Android,Json,Gridview,Android Recyclerview,我指的是这首芭蕾舞。我想在此网格视图中从服务器获取json数据。请告诉我如何解析数据。另外,我需要缓存这些图像..使用截击库之类的。 你能为我们的图图提供任何链接吗???请建议我使用凌空截击快速解析您的数据,可以这样实现: 创建类截击服务 公共级截击{ private static VolleyService instance; private RequestQueue requestQueue; private ImageLoader imageLoader; private VolleyS

我指的是这首芭蕾舞。我想在此网格视图中从服务器获取json数据。请告诉我如何解析数据。另外,我需要缓存这些图像..使用截击库之类的。
你能为我们的图图提供任何链接吗???请建议我使用凌空截击快速解析您的数据,可以这样实现:

创建类截击服务 公共级截击{

private static VolleyService instance;
private RequestQueue requestQueue;
private ImageLoader imageLoader;

private VolleyService(Context context) {
    requestQueue = Volley.newRequestQueue(context);

    imageLoader = new ImageLoader(requestQueue, new ImageLoader.ImageCache() {
        private final LruCache<String, Bitmap> cache = new LruCache<String, Bitmap>(20);

        @Override
        public Bitmap getBitmap(String url) {
            return cache.get(url);
        }

        @Override
        public void putBitmap(String url, Bitmap bitmap) {
            cache.put(url,bitmap);
        }
    });
}

public static VolleyService getInstance(Context context) {
    if (instance == null) {
        instance = new VolleyService(context);
    }
    return instance;
}

public RequestQueue getRequestQueue() {
    return requestQueue;
}

public ImageLoader getImageLoader() {
    return imageLoader;
}
    VolleyService.getInstance(this.getContext()).getRequestQueue();    
    StringRequest request = new StringRequest(url, new 
    Response.Listener<String>() {
        @Override
        public void onResponse(String response) {
            // we got the response, now our job is to handle it
            try {
                updateArticleData(response, syncResult,categoryID);
            } catch (RemoteException | OperationApplicationException e) {
                e.printStackTrace();
            }
        }
    }, new Response.ErrorListener() {

        @Override
        public void onErrorResponse(VolleyError error) {
            //something happened, treat the error.
            Log.e("Error", error.toString());
        }
    });

    queue.add(request);
 private SomeClass getDataFromJson(String json) {     
    //Do sth with json    
    return someData;
}