diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 33d8168..fb734c4 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -15,9 +15,10 @@
 -->
 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-        package="com.android.contacts"
-        android:sharedUserId="android.uid.shared"
+    package="com.android.contacts"
+    android:sharedUserId="android.uid.shared"
 >
+
     <uses-permission android:name="android.permission.CALL_PRIVILEGED" />
     <uses-permission android:name="android.permission.READ_CONTACTS" />
     <uses-permission android:name="android.permission.WRITE_CONTACTS" />
@@ -107,7 +108,7 @@
                 <category android:name="android.intent.category.BROWSABLE" />
             </intent-filter>
         </activity>
-        
+
         <!-- An empty activity that presents the DialtactActivity's Contacts tab -->
         <activity-alias android:name="DialtactsContactsEntryActivity"
             android:targetActivity="DialtactsActivity"
@@ -125,7 +126,7 @@
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:mimeType="vnd.android.cursor.dir/person" />
             </intent-filter>
-            
+
             <intent-filter>
                 <action android:name="com.android.contacts.action.FILTER_CONTACTS" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -143,7 +144,7 @@
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </activity-alias>
-        
+
         <!-- The actual list of contacts, usually embedded in ContactsActivity -->
         <activity android:name="ContactsListActivity"
             android:label="@string/contactsList"
@@ -178,7 +179,7 @@
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.TAB" />
             </intent-filter>
-            
+
             <intent-filter android:label="@string/frequentList">
                 <action android:name="com.android.contacts.action.LIST_FREQUENT" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -196,14 +197,7 @@
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:mimeType="vnd.android.cursor.item/person" />
             </intent-filter>
-<!--
-            <intent-filter android:label="Add To Contacts">
-                <action android:name="com.android.contacts.action.ADD_CONTACT" />
-                <category android:name="android.intent.category.SELECTED_ALTERNATIVE" />
-                <data android:scheme="mailto" />
-                <data android:scheme="tel" />
-            </intent-filter>
--->
+
             <intent-filter>
                 <action android:name="android.intent.action.PICK" />
                 <category android:name="android.intent.category.DEFAULT" />
diff --git a/res/layout-finger/edit_contact_entry_group.xml b/res/layout-finger/edit_contact_entry_group.xml
new file mode 100644
index 0000000..b233ca8
--- /dev/null
+++ b/res/layout-finger/edit_contact_entry_group.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/entry_group"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:paddingRight="?android:attr/scrollbarSize"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:background="@android:drawable/list_selector_background"
+    android:orientation="horizontal"
+    android:gravity="center_vertical"
+    android:focusable="true"
+    android:clickable="true"
+    >
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="14dip"
+        android:layout_marginTop="6dip"
+        android:layout_marginBottom="6dip"
+        android:layout_weight="1"
+        android:duplicateParentState="true"
+        >
+
+        <TextView android:id="@+id/label"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:singleLine="true"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:ellipsize="marquee"
+            android:fadingEdge="horizontal"
+            android:duplicateParentState="true"
+            />
+
+        <TextView android:id="@+id/data"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@+id/label"
+            android:layout_alignLeft="@+id/label"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:singleLine="true"
+            android:ellipsize="marquee"
+            android:duplicateParentState="true"
+            />
+
+    </RelativeLayout>
+
+    <ImageView
+        style="@style/MoreButton"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        />
+
+</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fe866f7..6eff5b4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -145,6 +145,15 @@
     <!-- The label describing the custom ringtone for a contact -->
     <string name="label_ringtone">Ringtone</string>
 
+    <!-- The label for a list of all the groups that the contact is associated with -->
+    <string name="label_groups">Groups</string>
+
+    <!-- Provides a delimeter in a list of groups. For example, "g1, g2" has ", g2" generated using this string -->
+    <string name="group_list">, <xliff:g id="groupName">%s</xliff:g></string>
+
+    <!-- Menu item used to send user to the edit contact screen -->
+    <string name="menu_viewGroup">Edit groups</string>
+
     <!-- Hint text for the contact name when editing -->
     <string name="ghostData_name">First and Last</string>
 
@@ -172,6 +181,9 @@
     <!-- Hint text for the postal address field when editing -->
     <string name="ghostData_postal">Postal address</string>
 
+    <!-- Hint text for the group field when editing -->
+    <string name="ghostData_group">Display group</string>
+
     <!-- Message displayed in a toast when you try to view the details of a contact that
          for some reason doesn't exist anymore. -->
     <string name="invalidContactMessage">The contact does not exist.</string>
@@ -257,7 +269,7 @@
     <!-- Title for group selection dialog. The dialog contains a list of contact groups that the
          user can pick from, indicating they only want to see the contacts in that group. -->
     <string name="select_group_title">Groups</string>
-    
+
     <!-- The text displayed when the contacts list is empty while displaying a single group of contacts -->
     <string name="groupEmpty">Your \"<xliff:g id="groupName">%s</xliff:g>\" group is empty.</string>
 
@@ -312,6 +324,9 @@
     <!-- Separator in the contact details list describing that the items below are non-actionable organization information -->
     <string name="listSeparatorOrganizations">Organizations</string>
 
+    <!-- Separator in the contact details list describing that the items below are non-actionable group information -->
+    <string name="listSeparatorGroups">Groups</string>
+
     <!-- Separator in the contact details list describing that the items below are random other non-actionable information about a contact -->
     <string name="listSeparatorOtherInformation">Other information</string>
 
diff --git a/src/com/android/contacts/ContactEntryAdapter.java b/src/com/android/contacts/ContactEntryAdapter.java
index c5b7ccf..b8d9fe8 100644
--- a/src/com/android/contacts/ContactEntryAdapter.java
+++ b/src/com/android/contacts/ContactEntryAdapter.java
@@ -122,7 +122,9 @@
         /** Synthesized phone entry that will send an SMS instead of call the number */
         public static final int KIND_SMS = -2;
         /** A section separator */
-        public static final int KIND_SEPARATOR = -3; 
+        public static final int KIND_SEPARATOR = -3;
+        /** Signifies a group row that is stored in the group membership table */
+        public static final int KIND_GROUP = -4;
 
         public String label;
         public String data;
diff --git a/src/com/android/contacts/ContactsGroupSyncSelector.java b/src/com/android/contacts/ContactsGroupSyncSelector.java
index e1fbdf1..a94f8db 100644
--- a/src/com/android/contacts/ContactsGroupSyncSelector.java
+++ b/src/com/android/contacts/ContactsGroupSyncSelector.java
@@ -16,14 +16,15 @@
 
 package com.android.contacts;
 
-import com.google.android.googlelogin.GoogleLoginServiceConstants;
-import com.google.android.googlelogin.GoogleLoginServiceHelper;
-
+import android.accounts.AccountManager;
+import android.accounts.AuthenticatorException;
+import android.accounts.Future2;
+import android.accounts.Future2Callback;
+import android.accounts.OperationCanceledException;
 import android.app.ListActivity;
 import android.content.ContentResolver;
 import android.content.ContentUris;
 import android.content.ContentValues;
-import android.content.Intent;
 import android.database.Cursor;
 import android.os.Bundle;
 import android.provider.Contacts;
@@ -37,6 +38,9 @@
 import android.widget.ListView;
 
 import java.util.ArrayList;
+import java.io.IOException;
+
+import com.google.android.googlelogin.GoogleLoginServiceConstants;
 
 public final class ContactsGroupSyncSelector extends ListActivity implements View.OnClickListener {
 
@@ -51,8 +55,6 @@
     private static final int COLUMN_INDEX_SHOULD_SYNC = 2;
     private static final int COLUMN_INDEX_SYSTEM_ID = 3;
 
-    private static final int SUBACTIVITY_GET_ACCOUNT = 1;
-
     ArrayList<Boolean> mChecked;
     ArrayList<Long> mGroupIds;
     boolean mSyncAllGroups;
@@ -160,9 +162,26 @@
             // through onActivityResult().
             Bundle bundle = new Bundle();
             bundle.putCharSequence("optional_message", getText(R.string.contactsSyncPlug));
-            GoogleLoginServiceHelper.getCredentials(this, SUBACTIVITY_GET_ACCOUNT,
-                    bundle, GoogleLoginServiceConstants.PREFER_HOSTED, Gmail.GMAIL_AUTH_SERVICE,
-                    true);
+            AccountManager.get(this).getAuthTokenByFeatures(
+                    GoogleLoginServiceConstants.ACCOUNT_TYPE, Gmail.GMAIL_AUTH_SERVICE,
+                    new String[]{GoogleLoginServiceConstants.FEATURE_GOOGLE_OR_DASHER}, this,
+                    bundle, null /* loginOptions */, new Future2Callback() {
+                public void run(Future2 future) {
+                    try {
+                        // do this to check if this request succeeded or not
+                        future.getResult();
+                        // There is an account setup, build the group list
+                        buildItems();
+                        adjustChecks();
+                    } catch (OperationCanceledException e) {
+                        finish();
+                    } catch (IOException e) {
+                        finish();
+                    } catch (AuthenticatorException e) {
+                        finish();
+                    }
+                }
+            }, null /* handler */);
         }
 
         setContentView(R.layout.sync_settings);
@@ -173,20 +192,6 @@
         getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
     }
 
-    @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
-        super.onActivityResult(requestCode, resultCode, intent);
-        if (requestCode == SUBACTIVITY_GET_ACCOUNT) {
-            if (resultCode == RESULT_OK) {
-                // There is an account setup, build the group list
-                buildItems();
-                adjustChecks();
-            } else {
-                finish();
-            }
-        }
-    }
-
     private void buildItems() {
         final ContentResolver resolver = getContentResolver();
         Cursor cursor = resolver.query(Groups.CONTENT_URI, PROJECTION, null, null, Groups.NAME);
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 0ddb608..e5143e0 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -257,12 +257,12 @@
 
     private static final int QUERY_TOKEN = 42;
 
-    private static final String[] GROUPS_PROJECTION = new String[] {
+    static final String[] GROUPS_PROJECTION = new String[] {
         Groups.SYSTEM_ID, // 0
         Groups.NAME, // 1
     };
-    private static final int GROUPS_COLUMN_INDEX_SYSTEM_ID = 0;
-    private static final int GROUPS_COLUMN_INDEX_NAME = 1;
+    static final int GROUPS_COLUMN_INDEX_SYSTEM_ID = 0;
+    static final int GROUPS_COLUMN_INDEX_NAME = 1;
     
     static final String GROUP_WITH_PHONES = "android_smartgroup_phone";
 
@@ -525,23 +525,25 @@
         mQueryHandler = new QueryHandler(this);
         mJustCreated = true;
 
-        // Check to see if sync is enabled
-        final ContentResolver resolver = getContentResolver();
-        IContentProvider provider = resolver.acquireProvider(Contacts.CONTENT_URI);
-        if (provider == null) {
-            // No contacts provider, bail.
-            finish();
-            return;
-        }
-
-        try {
-            ISyncAdapter sa = provider.getSyncAdapter();
-            mSyncEnabled = sa != null;
-        } catch (RemoteException e) {
-            mSyncEnabled = false;
-        } finally {
-            resolver.releaseProvider(provider);
-        }
+        // TODO(jham) redesign this
+        mSyncEnabled = true;
+//        // Check to see if sync is enabled
+//        final ContentResolver resolver = getContentResolver();
+//        IContentProvider provider = resolver.acquireProvider(Contacts.CONTENT_URI);
+//        if (provider == null) {
+//            // No contacts provider, bail.
+//            finish();
+//            return;
+//        }
+//
+//        try {
+//            ISyncAdapter sa = provider.getSyncAdapter();
+//            mSyncEnabled = sa != null;
+//        } catch (RemoteException e) {
+//            mSyncEnabled = false;
+//        } finally {
+//            resolver.releaseProvider(provider);
+//        }
     }
 
     private void setEmptyText() {
diff --git a/src/com/android/contacts/DialtactsActivity.java b/src/com/android/contacts/DialtactsActivity.java
index 73d702b..8f933b8 100644
--- a/src/com/android/contacts/DialtactsActivity.java
+++ b/src/com/android/contacts/DialtactsActivity.java
@@ -213,6 +213,8 @@
             }
         } else if (FAVORITES_ENTRY_COMPONENT.equals(componentName)) {
             mTabHost.setCurrentTab(TAB_INDEX_FAVORITES);
+        } else if (Contacts.Intents.UI.FILTER_CONTACTS_ACTION.equals(intent.getAction())) {
+            mTabHost.setCurrentTab(TAB_INDEX_CONTACTS);
         } else {
             SharedPreferences prefs = getSharedPreferences(PREFS_DIALTACTS, MODE_PRIVATE);
             boolean favoritesAsContacts = prefs.getBoolean(PREF_FAVORITES_AS_CONTACTS,
diff --git a/src/com/android/contacts/EditContactActivity.java b/src/com/android/contacts/EditContactActivity.java
index b89573b..4d5a669 100644
--- a/src/com/android/contacts/EditContactActivity.java
+++ b/src/com/android/contacts/EditContactActivity.java
@@ -44,6 +44,8 @@
 import static com.android.contacts.ContactEntryAdapter.PHONES_PROJECTION;
 import static com.android.contacts.ContactEntryAdapter.PHONES_TYPE_COLUMN;
 
+import com.android.contacts.ViewContactActivity.ViewEntry;
+
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
@@ -69,6 +71,7 @@
 import android.provider.Contacts;
 import android.provider.Contacts.ContactMethods;
 import android.provider.Contacts.Intents.Insert;
+import android.provider.Contacts.GroupMembership;
 import android.provider.Contacts.Groups;
 import android.provider.Contacts.Organizations;
 import android.provider.Contacts.People;
@@ -171,6 +174,20 @@
 
     /** Flag marking this contact as changed, meaning we should write changes back. */
     private boolean mContactChanged = false;
+    
+    /** List of all the group names */
+    private CharSequence[] mGroups;
+    
+    /** Is this contact part of the group */
+    private boolean[] mInTheGroup;
+
+    private static final String[] GROUP_ID_PROJECTION = new String[] {
+        Groups._ID,
+    };
+
+    private static final String[] GROUPMEMBERSHIP_ID_PROJECTION = new String[] {
+        GroupMembership._ID,
+    };
 
     // These are accessed by inner classes. They're package scoped to make access more efficient.
     /* package */ ContentResolver mResolver;
@@ -188,7 +205,7 @@
     /* package */ static final int MSG_ADD_PHONE = 3;
     /* package */ static final int MSG_ADD_EMAIL = 4;
     /* package */ static final int MSG_ADD_POSTAL = 5;
-
+    
     private static final int[] TYPE_PRECEDENCE_PHONES = new int[] {
             Phones.TYPE_MOBILE, Phones.TYPE_HOME, Phones.TYPE_WORK, Phones.TYPE_OTHER
     };
@@ -222,6 +239,12 @@
                 break;
             }
             
+            case R.id.entry_group: {
+                EditEntry entry = findEntryForView(v);
+                doPickGroup(entry);
+                break;
+            }
+            
             case R.id.entry_ringtone: {
                 EditEntry entry = findEntryForView(v);
                 doPickRingtone(entry);
@@ -716,6 +739,127 @@
         setPhotoPresent(false);
     }
     
+    private void populateGroups() {
+        // Create a list of all the groups
+        Cursor cursor = mResolver.query(Groups.CONTENT_URI, ContactsListActivity.GROUPS_PROJECTION,
+                null, null, Groups.DEFAULT_SORT_ORDER);
+        try {
+            ArrayList<Long> ids = new ArrayList<Long>();
+            ArrayList<String> items = new ArrayList<String>();
+
+            while (cursor.moveToNext()) {
+                String systemId = cursor.getString(ContactsListActivity.GROUPS_COLUMN_INDEX_SYSTEM_ID);
+                String name = cursor.getString(ContactsListActivity.GROUPS_COLUMN_INDEX_NAME);
+                
+                if (systemId != null || Groups.GROUP_MY_CONTACTS.equals(systemId)) {
+                    continue;
+                }
+
+                if (!TextUtils.isEmpty(name)) {
+                    ids.add(new Long(cursor.getLong(ContactsListActivity.GROUPS_COLUMN_INDEX_SYSTEM_ID)));
+                    items.add(name);
+                }
+            }
+
+            mGroups = items.toArray(new CharSequence[items.size()]);
+            mInTheGroup = new boolean[items.size()];
+        } finally {
+            cursor.close();
+        }
+        
+        if (mGroups != null) {
+            
+            // Go through the groups for this member and update the list
+            final Uri groupsUri = Uri.withAppendedPath(mUri, GroupMembership.CONTENT_DIRECTORY);
+            Cursor groupCursor = null;
+            try {
+                groupCursor = mResolver.query(groupsUri, ContactsListActivity.GROUPS_PROJECTION,
+                        null, null, Groups.DEFAULT_SORT_ORDER);
+            } catch (IllegalArgumentException e) {
+                // Contact is new, so we don't need to do any work.
+            }
+            
+            if (groupCursor != null) {
+                try {
+                    while (groupCursor.moveToNext()) {
+                        String systemId = groupCursor.getString(ContactsListActivity.GROUPS_COLUMN_INDEX_SYSTEM_ID);
+                        String name = groupCursor.getString(ContactsListActivity.GROUPS_COLUMN_INDEX_NAME);
+                        
+                        if (systemId != null || Groups.GROUP_MY_CONTACTS.equals(systemId)) {
+                            continue;
+                        }
+                        
+                        if (!TextUtils.isEmpty(name)) {
+                            for (int i = 0; i < mGroups.length; i++) {
+                                if (name.equals(mGroups[i])) {
+                                    mInTheGroup[i] = true;
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                } finally {
+                    groupCursor.close();
+                }
+            }
+        }
+    }
+    
+    private String generateGroupList() {
+        StringBuilder groupList = new StringBuilder();
+        for (int i = 0; mGroups != null && i < mGroups.length; i++) {
+            if (mInTheGroup[i]) {
+                if (groupList.length() == 0) {
+                    groupList.append(mGroups[i]);
+                } else {
+                    groupList.append(getString(R.string.group_list, mGroups[i]));
+                }
+            }
+        }
+        return groupList.length() > 0 ? groupList.toString() : null;
+    }
+    
+    private void doPickGroup(EditEntry entry) {
+        if (mGroups != null) {
+            GroupDialogListener listener = new GroupDialogListener(this, entry);
+            
+            new AlertDialog.Builder(EditContactActivity.this)
+                .setTitle(R.string.label_groups)
+                .setMultiChoiceItems(mGroups, mInTheGroup, listener)
+                .setPositiveButton(android.R.string.ok, listener)
+                .setNegativeButton(android.R.string.cancel, null)
+                .show();
+        }
+    }
+
+    /** Handles the clicks in the groups dialog */
+    private static final class GroupDialogListener implements DialogInterface.OnClickListener,
+            DialogInterface.OnMultiChoiceClickListener {
+        
+        private EditContactActivity mEditContactActivity;
+        private EditEntry mEntry;
+        private boolean[] mInTheGroup;
+        
+        public GroupDialogListener(EditContactActivity editContactActivity, EditEntry entry) {
+            mEditContactActivity = editContactActivity;
+            mEntry = entry;
+            mInTheGroup = editContactActivity.mInTheGroup.clone();
+        }
+
+        /** Called when the dialog's ok button is clicked */
+        public void onClick(DialogInterface dialog, int which) {
+            mEditContactActivity.mInTheGroup = mInTheGroup;
+            mEntry.data = mEditContactActivity.generateGroupList();
+            mEditContactActivity.updateDataView(mEntry, mEntry.data);
+        }
+
+        /** Called when each group is clicked */
+        public void onClick(DialogInterface dialog, int which, boolean isChecked) {
+            mInTheGroup[which] = isChecked;
+        }
+    }
+    
+    
     private void doPickRingtone(EditEntry entry) {
         Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
         // Allow user to pick 'Default'
@@ -881,6 +1025,64 @@
         }
         finish();
     }
+
+    /**
+     * Gets the group id based on group name.
+     * 
+     * @param resolver the resolver to use
+     * @param groupName the name of the group to add the contact to
+     * @return the id of the group
+     * @throws IllegalStateException if the group can't be found
+     */
+    private long getGroupId(ContentResolver resolver, String groupName) {
+        long groupId = 0;
+        Cursor groupsCursor = resolver.query(Groups.CONTENT_URI, GROUP_ID_PROJECTION,
+                Groups.NAME + "=?", new String[] { groupName }, null);
+        if (groupsCursor != null) {
+            try {
+                if (groupsCursor.moveToFirst()) {
+                    groupId = groupsCursor.getLong(0);
+                }
+            } finally {
+                groupsCursor.close();
+            }
+        }
+    
+        if (groupId == 0) {
+            throw new IllegalStateException("Failed to find the " + groupName + "group");
+        }
+        
+        return groupId;
+    }
+
+    /**
+     * Deletes group membership based on person and group ids.
+     * 
+     * @param personId the person id
+     * @param groupId the group id
+     * @return the id of the group membership
+     */
+    private void deleteGroupMembership(long personId, long groupId) {
+        long groupMembershipId = 0;
+        Cursor groupsCursor = mResolver.query(GroupMembership.CONTENT_URI, GROUPMEMBERSHIP_ID_PROJECTION,
+                GroupMembership.PERSON_ID + "=? AND " + GroupMembership.GROUP_ID + "=?",
+                new String[] {String.valueOf(personId), String.valueOf(groupId)}, null);
+        if (groupsCursor != null) {
+            try {
+                if (groupsCursor.moveToFirst()) {
+                    groupMembershipId = groupsCursor.getLong(0);
+                }
+            } finally {
+                groupsCursor.close();
+            }
+        }
+        
+        if (groupMembershipId != 0) {
+            final Uri groupsUri = ContentUris.withAppendedId(
+                    GroupMembership.CONTENT_URI,groupMembershipId);
+            mResolver.delete(groupsUri, null, null);
+        }
+    }
     
     /**
      * Save the various fields to the existing contact.
@@ -929,6 +1131,18 @@
                     values.put(entry.column, (String) null);
                     mResolver.update(entry.uri, values, null, null);
                 }
+            } else if (kind == EditEntry.KIND_GROUP) {
+                if (entry.id != 0) {
+                    for (int g = 0; g < mGroups.length; g++) {
+                        long groupId = getGroupId(mResolver, mGroups[g].toString());
+                        if (mInTheGroup[g]) {
+                            Contacts.People.addToGroup(mResolver, entry.id, groupId);
+                            numValues++;
+                        } else {
+                            deleteGroupMembership(entry.id, groupId);
+                        }
+                    }
+                }
             } else {
                 if (!empty) {
                     values.clear();
@@ -1045,7 +1259,16 @@
         int entryCount = ContactEntryAdapter.countEntries(mSections, false);
         for (int i = 0; i < entryCount; i++) {
             EditEntry entry = ContactEntryAdapter.getEntry(mSections, i, false);
-            if (entry.kind != EditEntry.KIND_CONTACT) {
+            if (entry.kind == EditEntry.KIND_GROUP) {
+                long contactId = ContentUris.parseId(contactUri);
+                for (int g = 0; g < mGroups.length; g++) {
+                    if (mInTheGroup[g]) {
+                        long groupId = getGroupId(mResolver, mGroups[g].toString());
+                        People.addToGroup(mResolver, contactId, groupId);
+                        numValues++;
+                    }
+                }
+            } else if (entry.kind != EditEntry.KIND_CONTACT) {
                 values.clear();
                 if (entry.toValues(values)) {
                     // Only create the entry if there is data
@@ -1152,7 +1375,15 @@
                     mUri);
             mNoteEntries.add(entry);
         }
-
+        
+        // Groups
+        populateGroups();
+        if (mGroups != null) {
+            entry = EditEntry.newGroupEntry(this, generateGroupList(), mUri,
+                    personCursor.getLong(0));
+            mOtherEntries.add(entry);
+        }
+        
         // Ringtone
         entry = EditEntry.newRingtoneEntry(this,
                 personCursor.getString(CONTACT_CUSTOM_RINGTONE_COLUMN), mUri);
@@ -1316,6 +1547,13 @@
             mEmailEntries.add(entry);
         }
 
+        // Group
+        populateGroups();
+        if (mGroups != null) {
+            entry = EditEntry.newGroupEntry(this, null, mUri, 0);
+            mOtherEntries.add(entry);
+        }
+        
         // Ringtone
         entry = EditEntry.newRingtoneEntry(this, null, mUri);
         mOtherEntries.add(entry);
@@ -1577,6 +1815,9 @@
         // with some additional logic.
         if (entry.kind == Contacts.KIND_ORGANIZATION) {
             view = mInflater.inflate(R.layout.edit_contact_entry_org, parent, false);
+        } else if (isOtherEntry(entry, GroupMembership.GROUP_ID)) {
+            view = mInflater.inflate(R.layout.edit_contact_entry_group, parent, false);
+            view.setOnFocusChangeListener(this);
         } else if (isOtherEntry(entry, People.CUSTOM_RINGTONE)) {
             view = mInflater.inflate(R.layout.edit_contact_entry_ringtone, parent, false);
             view.setOnFocusChangeListener(this);
@@ -1671,6 +1912,10 @@
     private void fillViewData(final EditEntry entry) {
         if (isOtherEntry(entry, People.CUSTOM_RINGTONE)) {
             updateRingtoneView(entry);
+        } else if (isOtherEntry(entry, GroupMembership.GROUP_ID)) {
+            if (entry.data != null) {
+                updateDataView(entry, entry.data);
+            }
         } else if (isOtherEntry(entry, People.SEND_TO_VOICEMAIL)) {
             CheckBox checkBox = (CheckBox) entry.view.findViewById(R.id.checkbox);
             boolean sendToVoicemail = false;
@@ -1846,7 +2091,9 @@
                 }
 
                 case Contacts.KIND_IM: {
-                    v.setText(getLabelsForKind(activity, kind)[type]);
+                    if (type >= 0) {
+                        v.setText(getLabelsForKind(activity, kind)[type]);
+                    }
                     break;
                 }
                 
@@ -2036,6 +2283,24 @@
         }
 
         /**
+         * Create a new group entry with the given data.
+         */
+        public static final EditEntry newGroupEntry(EditContactActivity activity,
+                String data, Uri uri, long personId) {
+            EditEntry entry = new EditEntry(activity);
+            entry.label = activity.getString(R.string.label_groups);
+            entry.data = data;
+            entry.uri = uri;
+            entry.id = personId;
+            entry.column = GroupMembership.GROUP_ID;
+            entry.kind = KIND_GROUP;
+            entry.isStaticLabel = true;
+            entry.syncDataWithView = false;
+            entry.lines = -1;
+            return entry;
+        }
+
+        /**
          * Create a new ringtone entry with the given data.
          */
         public static final EditEntry newRingtoneEntry(EditContactActivity activity,
diff --git a/src/com/android/contacts/ShowOrCreateActivity.java b/src/com/android/contacts/ShowOrCreateActivity.java
index 0732ffe..75af4ae 100755
--- a/src/com/android/contacts/ShowOrCreateActivity.java
+++ b/src/com/android/contacts/ShowOrCreateActivity.java
@@ -41,6 +41,7 @@
  * connected with a specific E-mail address or phone number. Will search based
  * on incoming {@link Intent#getData()} as described by
  * {@link Intents#SHOW_OR_CREATE_CONTACT}.
+ *
  * <ul>
  * <li>If no matching contacts found, will prompt user with dialog to add to a
  * contact, then will use {@link Intent#ACTION_INSERT_OR_EDIT} to let create new
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index 28a82b4..e5afdc2 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -73,6 +73,8 @@
 import android.provider.Contacts;
 import android.provider.Im;
 import android.provider.Contacts.ContactMethods;
+import android.provider.Contacts.Groups;
+import android.provider.Contacts.GroupMembership;
 import android.provider.Contacts.Organizations;
 import android.provider.Contacts.People;
 import android.provider.Contacts.Phones;
@@ -136,6 +138,7 @@
     /* package */ ArrayList<ViewEntry> mPostalEntries = new ArrayList<ViewEntry>();
     /* package */ ArrayList<ViewEntry> mImEntries = new ArrayList<ViewEntry>();
     /* package */ ArrayList<ViewEntry> mOrganizationEntries = new ArrayList<ViewEntry>();
+    /* package */ ArrayList<ViewEntry> mGroupEntries = new ArrayList<ViewEntry>();
     /* package */ ArrayList<ViewEntry> mOtherEntries = new ArrayList<ViewEntry>();
     /* package */ ArrayList<ArrayList<ViewEntry>> mSections = new ArrayList<ArrayList<ViewEntry>>();
 
@@ -229,6 +232,7 @@
         mSections.add(mImEntries);
         mSections.add(mPostalEntries);
         mSections.add(mOrganizationEntries);
+        mSections.add(mGroupEntries);
         mSections.add(mOtherEntries);
 
         //TODO Read this value from a preference
@@ -395,6 +399,11 @@
                 menu.add(0, 0, 0, R.string.menu_viewAddress).setIntent(entry.intent);
                 break;
             }
+            
+            case ContactEntryAdapter.Entry.KIND_GROUP: {
+                menu.add(0, 0, 0, R.string.menu_viewGroup).setIntent(entry.intent);
+                break;
+            }
         }
     }
 
@@ -579,6 +588,11 @@
 
         separator = new ViewEntry();
         separator.kind = ViewEntry.KIND_SEPARATOR;
+        separator.data = getString(R.string.listSeparatorGroups);
+        mGroupEntries.add(separator);
+
+        separator = new ViewEntry();
+        separator.kind = ViewEntry.KIND_SEPARATOR;
         separator.data = getString(R.string.listSeparatorOtherInformation);
         mOtherEntries.add(separator);
     }
@@ -716,7 +730,7 @@
                     case Contacts.KIND_IM: {
                         Object protocolObj = ContactMethods.decodeImProtocol(
                                 methodsCursor.getString(METHODS_AUX_DATA_COLUMN));
-                        String host;
+                        String host = null;
                         if (protocolObj instanceof Number) {
                             int protocol = ((Number) protocolObj).intValue();
                             entry.label = buildActionString(R.string.actionChat,
@@ -726,7 +740,7 @@
                                     || protocol == ContactMethods.PROTOCOL_MSN) {
                                 entry.maxLabelLines = 2;
                             }
-                        } else {
+                        } else if (protocolObj != null) {
                             String providerName = (String) protocolObj;
                             entry.label = buildActionString(R.string.actionChat,
                                     providerName, false);
@@ -848,7 +862,6 @@
             organizationsCursor.close();
         }
 
-
         // Build the other entries
         String note = personCursor.getString(CONTACT_NOTES_COLUMN);
         if (!TextUtils.isEmpty(note)) {
@@ -863,7 +876,49 @@
             entry.actionIcon = R.drawable.sym_note;
             mOtherEntries.add(entry);
         }
-        
+
+        // Build the group entries
+        final Uri groupsUri = Uri.withAppendedPath(mUri, GroupMembership.CONTENT_DIRECTORY);
+        Cursor groupCursor = mResolver.query(groupsUri, ContactsListActivity.GROUPS_PROJECTION,
+                null, null, Groups.DEFAULT_SORT_ORDER);
+        if (groupCursor != null) {
+            try {
+                StringBuilder sb = new StringBuilder();
+
+                while (groupCursor.moveToNext()) {
+                    String systemId = groupCursor.getString(
+                            ContactsListActivity.GROUPS_COLUMN_INDEX_SYSTEM_ID);
+
+                    if (systemId != null || Groups.GROUP_MY_CONTACTS.equals(systemId)) {
+                        continue;
+                    }
+
+                    String name = groupCursor.getString(ContactsListActivity.GROUPS_COLUMN_INDEX_NAME);
+                    if (!TextUtils.isEmpty(name)) {
+                        if (sb.length() == 0) {
+                            sb.append(name);
+                        } else {
+                            sb.append(getString(R.string.group_list, name));
+                        }
+                    }
+                }
+
+                if (sb.length() > 0) {
+                    ViewEntry entry = new ViewEntry();
+                    entry.kind = ContactEntryAdapter.Entry.KIND_GROUP;
+                    entry.label = getString(R.string.label_groups);
+                    entry.data = sb.toString();
+                    entry.intent = new Intent(Intent.ACTION_EDIT, mUri);
+
+                    // TODO: Add an icon for the groups item.
+
+                    mGroupEntries.add(entry);
+                }
+            } finally {
+                groupCursor.close();
+            }
+        }
+
         // Build the ringtone entry
         String ringtoneStr = personCursor.getString(CONTACT_CUSTOM_RINGTONE_COLUMN);
         if (!TextUtils.isEmpty(ringtoneStr)) {
