title: Unable to parse image from Json to listview in android
body: <p>I am trying to parse the images and text from url to list view. </p>
  
  <p>I succesfully parse names but unable to parse Images. I follow these links....</p>
  
  <p>I am getting bit map value null in image loader class..</p>
  
  <p>I copied the MemoryCache and File Cache classes from the below links...  Is there any mistake in my code? </p>
  
  <p>My Json is: <code>http://192.185.159.159/~charmmar/raj_spice/webservices/index.php?action=products</code>
  Is any problem for image parsing if json is large?</p>
  
  <ol>
  <li><a href="http://www.androidbegin.com/tutorial/android-json-parse-images-and-texts-tutorial/" rel="nofollow">http://www.androidbegin.com/tutorial/android-json-parse-images-and-texts-tutorial/</a></li>
  <li><a href="http://luchfilip.wordpress.com/2014/02/25/android-how-to-parse-json-and-show-images-and-texts-in-a-listview/comment-page-1/" rel="nofollow">http://luchfilip.wordpress.com/2014/02/25/android-how-to-parse-json-and-show-images-and-texts-in-a-listview/comment-page-1/</a></li>
  <li><a href="http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/" rel="nofollow">http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/</a></li>
  </ol>
  
  <p>in these links all contained <code>ImageLoader</code>, <code>FileCache</code>, <code>MemoryCache</code> classes but I am unable to parse images... is any special library needed for this?</p>
  
  <p>My class:</p>
  
  <pre><code>package com.example.dellizia;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  
  import org.json.JSONArray;
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import android.app.Activity;
  import android.app.ProgressDialog;
  import android.content.SharedPreferences;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.preference.PreferenceManager;
  import android.util.Log;
  import android.widget.ListView;
  
  public class RecipesJson extends Helper {
  
      private String url = com.example.dellizia.Utility.urlpath + "products";
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; productList;
      ProgressDialog pdialog;
      final String TAG_DATA = "data";
      final String TAG_ID = "id";
      final static String TAG_NAME = "name";
      final static String TAG_IMAGE = "images";
      ListView listview;
      RecipeJsonAdapter adapter;
      SharedPreferences preferences;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.menu);
          preferences = PreferenceManager.getDefaultSharedPreferences(this);
          PrefEdit("pref__footer", "img_recipe");
          footerBlock();
          new DownloadJSON().execute();
      }
  
      private class DownloadJSON extends AsyncTask&lt;Void, Void, Void&gt; {
  
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
              // Create a progressdialog
              pdialog = new ProgressDialog(RecipesJson.this);
              // Set progressdialog title
              // pdialog.setTitle("Android JSON Parse Tutorial");
              // Set progressdialog message
              pdialog.setMessage("Loading...");
              pdialog.setIndeterminate(false);
              // Show progressdialog
              pdialog.show();
          }
  
          @Override
          protected Void doInBackground(Void... arg0) {
              // TODO Auto-generated method stub
              productList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
              try {
                  String res = JsonFunction.getJSONfromURL(url);
                  Log.e("","resvalue--------"+res);
                  JSONObject jsonobj = new JSONObject(res);
  
                  String id = jsonobj.getString("status");
                  Log.e("","id value in parse json--------"+id);
                  if (id.equals("1")) {
                      JSONArray userdata = jsonobj.getJSONArray("data");
                      for (int i = 0; i &lt; userdata.length(); i++) {
                          HashMap&lt;String, String&gt; pdata = new HashMap&lt;String, String&gt;();
                          JSONObject obj = userdata.getJSONObject(i);
                          String catid = userdata.getJSONObject(i).getString("id");
                          String name = userdata.getJSONObject(i).getString("name");
                          String image = userdata.getJSONObject(i).getString("images");
                          pdata.put(TAG_ID, catid);
                          Log.e("", "TAG_ID---" + TAG_ID);
                          pdata.put(TAG_NAME, name);
                          Log.e("", "TAG_NAME---" + TAG_NAME);
                          Log.e("", "name---" + name);
  
                          pdata.put(TAG_IMAGE, image);
                          Log.e("", "TAG_IMAGE---" + TAG_IMAGE);
                          Log.e("", "image-----------" + image);
                          productList.add(pdata);
                          Log.e("", "product list----" + productList);
  
                      }
                  }
              } catch (JSONException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
              return null;
          }
  
          @Override
          protected void onPostExecute(Void args) {
              // Locate the listview in listview_main.xml
              listview = (ListView) findViewById(R.id.recipeslist);
              // Pass the results into ListViewAdapter.java
              adapter = new RecipeJsonAdapter(RecipesJson.this, productList);
              // Set the adapter to the ListView
              listview.setAdapter(adapter);
              // Close the progressdialog
              pdialog.dismiss();
          }
      }
  }
  </code></pre>
  
  <p>My adapter class:</p>
  
  <pre><code>package com.example.dellizia;
  
  import java.util.ArrayList;
  import java.util.HashMap;
  
      import com.example.androidhive.ImageLoader;
  
      import android.app.Activity;
      import android.content.Context;
      import android.util.Log;
      import android.view.LayoutInflater;
      import android.view.View;
      import android.view.ViewGroup;
      import android.widget.BaseAdapter;
      import android.widget.ImageView;
      import android.widget.TextView;
  
      public class RecipeJsonAdapter extends BaseAdapter {
  
          private Activity activity;
          private ArrayList&lt;HashMap&lt;String, String&gt;&gt; data;
          private static LayoutInflater inflater=null;
          public ImageLoader imageLoader; 
  
          public RecipeJsonAdapter(Activity a, ArrayList&lt;HashMap&lt;String, String&gt;&gt; d) {
              activity = a;
              data=d;
              inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              imageLoader=new ImageLoader(activity.getApplicationContext());
          }
  
          public int getCount() {
              return data.size();
          }
  
          public Object getItem(int position) {
              return position;
          }
  
          public long getItemId(int position) {
              return position;
          }
  
          public View getView(int position, View convertView, ViewGroup parent) {
              View vi=convertView;
              if(convertView==null)
                  vi = inflater.inflate(R.layout.recipeitems, null);
  
              TextView title = (TextView)vi.findViewById(R.id.title); // title
              //TextView artist = (TextView)vi.findViewById(R.id.artist); // artist name
              //TextView duration = (TextView)vi.findViewById(R.id.duration); // duration
              ImageView thumb_image=(ImageView)vi.findViewById(R.id.recipeimage); // thumb image
  
              HashMap&lt;String, String&gt; song = new HashMap&lt;String, String&gt;();
              song = data.get(position);
  
              // Setting all values in listview
              Log.e("","names values ------------"+song.get(RecipesJson.TAG_NAME));
  
              title.setText(song.get(RecipesJson.TAG_NAME));
              //artist.setText(song.get(CustomizedListView.KEY_ARTIST));
             // duration.setText(song.get(CustomizedListView.KEY_DURATION));
              Log.e("","images values ------------"+song.get(RecipesJson.TAG_IMAGE));
              imageLoader.DisplayImage(song.get(RecipesJson.TAG_IMAGE), thumb_image);
              return vi;
          }
      }
  </code></pre>
  
  <p>This is my link for all classes.. <a href="http://ge.tt/8keNUh62?c" rel="nofollow">http://ge.tt/8keNUh62?c</a>. In this link all my used classes are available.</p>
  
  <p>Please help!</p>