Android Application for joomla website
<p>I am developing a android application for Joomla website.i am able to retrieve data from remote database and i can able to place in the listview properly.but i can able to retrive image from url.but i cannot place it in the listview.
 below i will give the code</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.hospital);
         img=new ImageView(this);

        List&lt;String&gt; list=insertdynamicdata();
        Object[] ol = list.toArray();
        String[] title = (String[]) list.toArray(new String[0]);
        {};
        list1=insertdynamicdata1();
        Object[] ol1 = list1.toArray();
        String[] detail = (String[]) list1.toArray(new String[0]);
        {};
        mInflater = (LayoutInflater) getSystemService(
        Activity.LAYOUT_INFLATER_SERVICE);
        data   = new Vector&lt;RowData&gt;();
        for(int i=0;i&lt;title.length;i++){
        try {
        rd = new RowData(i,title[i],detail[i]);
            } 
        catch (ParseException e) {
                e.printStackTrace();
           }

           data.add(rd);
        }
           CustomAdapter adapter = new CustomAdapter(this,R.layout.hospitallist,
                                             R.id.title, data);
           setListAdapter(adapter);
          // getListView().setTextFilterEnabled(true);

        }




        private List&lt;String&gt; insertdynamicdata()
           {
        // TODO Auto-generated method stub
               ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
               ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
               try{
                     HttpClient httpclient = new DefaultHttpClient();
                     HttpPost httppost = new HttpPost("http://192.168.1.100/androidconnect/connect.php");
                     httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                     HttpResponse response = httpclient.execute(httppost);
                     HttpEntity entity = response.getEntity();
                     is = entity.getContent();
                     }
               catch(Exception e){
                         Log.e("log_tag", "Error in http connection"+e.toString());
                    }
        //convert response to string
                try{
                       BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
                       sb = new StringBuilder();
                       sb.append(reader.readLine() + "\n");
                       String line="0";
                       while ((line = reader.readLine()) != null) {
                                      sb.append(line + "\n");
                        }
                        is.close();
                        result=sb.toString();
                        }catch(Exception e){
                              Log.e("log_tag", "Error converting result "+e.toString());
                        }
                        try{
                              jArray = new JSONArray(result);
                              for (int i=0; i&lt;jArray.length(); i++) {
                                list.add(jArray.getString(i) );
                              }
                        }
                              catch(JSONException e1){
                                  Toast.makeText(getBaseContext(), "No City Found" ,Toast.LENGTH_LONG).show();
                              } catch (ParseException e1) {
                                    e1.printStackTrace();
                            }
                        return list;

                        }




        private List&lt;String&gt; insertdynamicdata1()
        {
        // TODO Auto-generated method stub

            ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
           ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
           try{

                HttpClient httpclient = new DefaultHttpClient();
                 HttpPost httppost = new HttpPost("http://192.168.1.100/androidconnect/connect1.php");
                 httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                 HttpResponse response = httpclient.execute(httppost);
                 HttpEntity entity = response.getEntity();
                 is = entity.getContent();
                 }
           catch(Exception e){
                     Log.e("log_tag", "Error in http connection"+e.toString());
                }


            //convert response to string
            try{
                   BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
                   sb = new StringBuilder();
                   sb.append(reader.readLine() + "\n");
                   String line="0";
                   while ((line = reader.readLine()) != null) 
                   {
                                  sb.append(line + "\n");
                    }
                    is.close();
                    result=sb.toString();
                    }catch(Exception e){
                          Log.e("log_tag", "Error converting result "+e.toString());
                    }

                    try{
                          jArray = new JSONArray(result);
                          for (int i=0; i&lt;jArray.length(); i++) {
                            list1.add(jArray.getString(i) );
                    }
                    }
                          catch(JSONException e1){
                              Toast.makeText(getBaseContext(), "No City Found" ,Toast.LENGTH_LONG).show();
                          } catch (ParseException e1) {
                                e1.printStackTrace();
                        }
                        return list1;

                    }


           private class RowData {
              protected int  mId;
               protected String mTitle;
               protected String mDetail;
               RowData(int i,String title,String Detail){
               //mId=id;
                   String noHTMLString = title.replaceAll("\\&lt;.*?\\&gt;", "");
                   String noHTMLString1 = noHTMLString.replaceAll("\\[","");
                   String noHTMLString2 = noHTMLString1.replaceAll("\\]","");
                   String noHTMLString3 = noHTMLString2.replace("\"","");
                   String noHTMLString4 = noHTMLString3.replace("\\,","");
                   mTitle = noHTMLString4;

                   String noHTMLString5 = Detail.replaceAll("\\&lt;.*?\\&gt;", "");
                  String noHTMLString6 = noHTMLString5.replaceAll("\\[","");
                   String noHTMLString7 = noHTMLString6.replaceAll("\\]","");
                   String noHTMLString8 = noHTMLString7.replace("\"","");
                   String noHTMLString9 = noHTMLString8.replace("\\,","");
                   mDetail = noHTMLString9;
                   mId=i;

            }
               @Override
               public String toString() {
                 return mId+" "+  mTitle+" "+mDetail;
               }
        }
           private class CustomAdapter extends ArrayAdapter&lt;RowData&gt;
           {
               public CustomAdapter(Context context, int resource,int textViewResourceId, List&lt;RowData&gt; objects) 
               {               
              super(context, resource, textViewResourceId, objects);
             }
               @Override
               public View getView(int position, View convertView, ViewGroup parent) {   
               ViewHolder holder = null;
               TextView title = null;
               TextView detail = null;
               ImageView im=null;
               RowData rowData= getItem(position);
               if(null == convertView){
                    convertView = mInflater.inflate(R.layout.hospitallist, null);
                    holder = new ViewHolder(convertView);
                    convertView.setTag(holder);
         }
               holder = (ViewHolder) convertView.getTag();
               title = holder.gettitle();
               title.setText(rowData.mTitle);
               detail = holder.getDetail();
              detail.setText(rowData.mDetail);
              return convertView;
               }
               private class ViewHolder {
                   private View mRow;
                   private TextView title = null;
                  private TextView detail = null;
                   private ImageView i11=null; 
                   public ViewHolder(View row) {
                   mRow = row;
        }
                   public TextView gettitle() {
                       if(null == title){
                           title = (TextView) mRow.findViewById(R.id.title);
                          }
                      return title;
                   }     
                   public TextView getDetail() {
                       if(null == detail){
                           detail = (TextView) mRow.findViewById(R.id.detail);
                          }
                      return detail;
                   }     

               }
           }
}
</code></pre>
