how to get Contact database schema.

Posted by kamiomar on Stack Overflow See other posts from Stack Overflow or by kamiomar
Published on 2010-04-20T07:51:40Z Indexed on 2010/04/20 7:53 UTC
Read the original article Hit count: 275

Filed under:
|

Dear,

is there any link that provide me the Contact Schema. when i store new phone number in mobile, the informaion store in the database. so i need schema to create my own table for back purpose.

i have alreay get People table column by the follwoing code.

boolean displayFlag = false;
        String str = "";
        Uri CONTACT_URI = People.CONTENT_URI;
        Cursor cursor = mContext.getContentResolver().query(CONTACT_URI, null,
                null, null, null);
        String columnNames = "";
        if (cursor != null) {
            try {
                cursor.getCount();
                if (cursor.moveToFirst()) {
                    String[] columns = cursor.getColumnNames();
                    for (int i = 0; i < columns.length; i++) {
                        columnNames += "colName" + cursor.getColumnName(i) + " : "
                                + cursor.getString(i) + "colValue";
                    }
                }

            } finally {
                cursor.close();
            }
        }
        createImage(columnNames);
        if (displayFlag) {
            Toast.makeText(mContext, str, Toast.LENGTH_SHORT).show();
        }
    }

Thanks

© Stack Overflow or respective owner

Related posts about android

Related posts about database