Android Address Book Search

by mike » Wed, 02 Jun 2010 01:15:14 GMT


Sponsored Links
 hi guys,

i have developed a application which loads all the contacts in the
native address book.
since i have many contacts i created a search.

my address book contains contacts like this.

Alan
Bill

and then again

Alex
Cooper
Dillon

1. even in the native address book it's the same. may i know the
reason for that. (All my contacts are in phone book)

2. i using phones.CONTENT_URI to load all the contacts. that's how i
want to do it

and assume that i have search for Alan or Bill search query returns
nothing

but if i search foe Alex,Cooper or Dillon it will return the correct
result

this is my query

        private Cursor searchItems(String query) {
                Cursor cur = getContentResolver().query(Phones.CONTENT_URI , 
null,
                                Phones.NAME + "='" + query.trim() + "'", null, 
null);
                startManagingCursor(cur);
                int x = cur.getCount();
                if (cur == null || x == 0) {
                        // alert("Address Book", "Empty Address Book");
                }
                if (cur.moveToNext()) {
                        do {
                                Log.d("CURSOR_SSSS", Integer.toString(x));
                        } while (cur.moveToNext());
                }
                columns = new String[] { Phones.NAME, Phones.NUMBER };
                names = new int[] { R.id.contactName, R.id.number };
                return cur;
        }

could somebody help me out??

regards,
Mike

--



Other Threads

1. Uninstall an app with drag and drop request

Steps:
1. Open Application Tray
2. Long hold icon (application tray closes and tab changes to rubbish
bin)
3. Drag icon onto the rubbish bin

Current functionality is to cancel the shortcut create.

However, it would be great if it also popped up the "Uninstall
application?" screen.

-- 

2. Problems Building Android Source Code with Eclipse

I recommend you to use make command for compilation ....




Hi, I have some problems building/compiling the Android Source
code...

I followed the instructions of
http://source.android.com/download
and
http://source.android.com/using-eclipse
to download and make the project source with NO errors.

But when I use Eclipse to build the Android Project Source, it reports
me with a lot of errors: 272325 errors and 6197warnings !!!!  For
example:

_aload cannot be resolved       CodeGen.java    /mydroid/external/
emma/
core/
java12/com/vladium/jcd/compiler line 34 Java Problem

$assert cannot be resolved      AppRunner.java  /mydroid/external/
emma/
core/
java12/com/vladium/emma/rt      line 81 Java Problem

I have installed Java1.5.0_22 correctly. I work under Ubuntu 10.04
platform.

Maybe, it will be an eclipse configuration error...

Can anyone save me?
Many thanks.

-- 

3. CheckBox image alignment issue

4. "Activity pause timeout for HistoryRecord" -- Any idea how does this happen

5. Problem with startManagingCursor

6. Process android.process.media is not responding.

7. Dynamically update preferences