android programming
<p>I know what has to be done.. this is what i have to do..</p>

<p>create a custom listview (with checkboxes on the list row on the left) in your app, with the adapter getting data one be one to your app from contacts app using a service or thread, then inflate it on the view</p>

<p>But I am having trouble implementing it... 
i knw the basics too..then pass that arraylist in the adapter...</p>

<p>If any body can help me out.. I am stuck for past week on this...  I want to get it over with...</p>

<pre><code>ArrayList&lt;WhateverTypeYouWant&gt; mArrayList = new ArrayList&lt;WhateverTypeYouWant&gt;();
for(mCursor.moveToFirst(); mCursor.moveToNext(); mCursor.isAfterLast()) {
    // The Cursor is now set to the right position
    mArrayList.add(mCursor.getWhateverTypeYouWant(WHATEVER_COLUMN_INDEX_YOU_WANT));
}
</code></pre>

<p>Here is the code... </p>

<pre><code>package com.exiom.productcatalogue;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.util.SparseBooleanArray;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;

public class WebexAttendeeList extends Activity {

 ListView lstAttends;
 ListView lstContacts;
 private ArrayList&lt;String&gt; aAttendees = new ArrayList&lt;String&gt;();
 private ArrayList&lt;String&gt; aContacts= new ArrayList&lt;String&gt;();

   /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.webexattendees);

//      lstContacts = (ListView)findViewById(R.id.lstContacts);
        lstAttends = (ListView)findViewById(R.id.lstAttendees);

        Cursor cur = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);

        ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
        HashMap&lt;String, String&gt; sContact = new HashMap&lt;String, String&gt;();

     if (cur.getCount() &gt; 0) {
      while (cur.moveToNext()) {
          String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));
          String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
          sContact = new HashMap&lt;String, String&gt;();
    Cursor emailCur = getContentResolver().query( 
      ContactsContract.CommonDataKinds.Email.CONTENT_URI, 
      null,
      ContactsContract.CommonDataKinds.Email.CONTACT_ID + " = ?", 
      new String[]{id}, null); 
     while (emailCur.moveToNext()) { 
         // This would allow you get several email addresses
            // if the email addresses were stored in an array
         String email = emailCur.getString(
                          emailCur.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA));
//          String emailType = emailCur.getString(
//                          emailCur.getColumnIndex(ContactsContract.CommonDataKinds.Email.TYPE));
         sContact.put("name", name);
         sContact.put("email", email);
         mylist.add(sContact);
        aAttendees.add(name);
      } 
      emailCur.close();

      }
      cur.close();
   }

 //   SimpleAdapter mAttendees = new SimpleAdapter(this, mylist, R.layout.multicolumnlayout,
//            new String[] {"name", "email"}, new int[] {R.id.NAME, R.id.EMAIL});
//        lstContacts.setAdapter(mAttendees);
//     lstContacts.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
     ArrayAdapter&lt;String&gt; attendAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_multiple_choice, aAttendees);
     lstAttends.setAdapter(attendAdapter);
        lstAttends.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

     Button btnStart = (Button)this.findViewById(R.id.btnStartWebex);
     btnStart.setOnClickListener(mStartButtonListener);
     Button btnCancel = (Button)this.findViewById(R.id.btnWebexCancel);
        btnCancel.setOnClickListener(mCancelButtonListener);
//        lstContacts.setOnClickListener(mSelectAttendee);

    }

    public void StartWebEx()
    {
//     WebexClient webex = null ;
//     String webExId = "";
//  String backUrl = "";
//  
//  webex.getLoginUrl(webExId, backUrl);

     int len = lstAttends.getCount();
     SparseBooleanArray checked = lstAttends.getCheckedItemPositions();
     for (int i = 0; i &lt; len; i++)
      if (checked.get(i)) {
       String item = aAttendees.get(i).toString();
       /* do whatever you want with the checked item */
      }
    }

    private OnClickListener mStartButtonListener = new OnClickListener() {
     public void onClick(View v) {
      // do something when the button is clicked
      Toast.makeText(getBaseContext(), "Starting WebEx...",Toast.LENGTH_SHORT).show();
//      String sSQLCmd = "update U_WEBEX_SETTING set webex_url = '"+edtWURL.getText()+"', "
//               + "webex_id = '"+edtWID.getText()+"', "
//               + "webex_pw = '"+edtWPW.getText()+"'";
//      
//      db.execSQL(sSQLCmd);
      StartWebEx();
      finish();
     };
    };

    private OnClickListener mCancelButtonListener = new OnClickListener() {
     public void onClick(View v) {
     // do something when the button is clicked
     Toast.makeText(getBaseContext(), "Exiting WebEx...",Toast.LENGTH_LONG).show();
     finish();
     };
    };

    private OnClickListener mSelectAttendee = new OnClickListener() {
       public void onClick(View v) {
       // do something when the button is clicked
                    //     aAttendees.add(lstContacts);
       Toast.makeText(getBaseContext(), "Selected...",Toast.LENGTH_LONG).show();
       finish();
       };
      };

}
</code></pre>
