diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index fb8a4df..a0085bc 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -76,5 +76,10 @@
         <attr name="screen" format="string" />
         <attr name="x" format="string" />
         <attr name="y" format="string" />
+        <attr name="spanX" format="string" />
+        <attr name="spanY" format="string" />
+        <attr name="icon" format="reference" />  
+        <attr name="title" format="reference" />
+        <attr name="uri" format="string" />
     </declare-styleable>
 </resources>
diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java
index dff72a2..9226c22 100644
--- a/src/com/android/launcher2/LauncherProvider.java
+++ b/src/com/android/launcher2/LauncherProvider.java
@@ -17,6 +17,7 @@
 package com.android.launcher2;
 
 import android.appwidget.AppWidgetHost;
+import android.appwidget.AppWidgetManager;
 import android.content.ContentProvider;
 import android.content.Context;
 import android.content.ContentValues;
@@ -24,6 +25,7 @@
 import android.content.ComponentName;
 import android.content.ContentUris;
 import android.content.ContentResolver;
+import android.content.res.Resources;
 import android.content.res.XmlResourceParser;
 import android.content.res.TypedArray;
 import android.content.pm.PackageManager;
@@ -42,6 +44,7 @@
 import android.provider.Settings;
 
 import java.io.IOException;
+import java.net.URISyntaxException;
 import java.util.ArrayList;
 
 import org.xmlpull.v1.XmlPullParserException;
@@ -175,7 +178,9 @@
         private static final String TAG_FAVORITE = "favorite";
         private static final String TAG_CLOCK = "clock";
         private static final String TAG_SEARCH = "search";
-
+        private static final String TAG_APPWIDGET = "appwidget";
+        private static final String TAG_SHORTCUT = "shortcut";
+        
         private final Context mContext;
         private final AppWidgetHost mAppWidgetHost;
 
@@ -531,11 +536,15 @@
                             a.getString(R.styleable.Favorite_y));
 
                     if (TAG_FAVORITE.equals(name)) {
-                        added = addShortcut(db, values, a, packageManager, intent);
+                        added = addAppShortcut(db, values, a, packageManager, intent);
                     } else if (TAG_SEARCH.equals(name)) {
                         added = addSearchWidget(db, values);
                     } else if (TAG_CLOCK.equals(name)) {
                         added = addClockWidget(db, values);
+                    } else if (TAG_APPWIDGET.equals(name)) {
+                        added = addAppWidget(db, values, a);
+                    } else if (TAG_SHORTCUT.equals(name)) {
+                        added = addUriShortcut(db, values, a);
                     }
 
                     if (added) i++;
@@ -551,7 +560,7 @@
             return i;
         }
 
-        private boolean addShortcut(SQLiteDatabase db, ContentValues values, TypedArray a,
+        private boolean addAppShortcut(SQLiteDatabase db, ContentValues values, TypedArray a,
                 PackageManager packageManager, Intent intent) {
 
             ActivityInfo info;
@@ -597,7 +606,7 @@
                     "com.android.alarmclock.AnalogAppWidgetProvider"));
 
             boolean allocatedAppWidgets = false;
-
+            
             // Try binding to an analog clock widget
             try {
                 int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
@@ -620,8 +629,85 @@
 
             return allocatedAppWidgets;
         }
-    }
+        
+        private boolean addAppWidget(SQLiteDatabase db, ContentValues values, TypedArray a) {
+            final int[] bindSources = new int[] {
+                    Favorites.ITEM_TYPE_APPWIDGET,
+            };
 
+            String packageName = a.getString(R.styleable.Favorite_packageName);
+            String className = a.getString(R.styleable.Favorite_className);
+
+            if (packageName == null || className == null) {
+                return false;
+            }
+            
+            ComponentName cn = new ComponentName(packageName, className);
+            
+            final ArrayList<ComponentName> bindTargets = new ArrayList<ComponentName>();
+            bindTargets.add(cn);
+
+            boolean allocatedAppWidgets = false;
+            final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mContext);
+
+            try {
+                int appWidgetId = mAppWidgetHost.allocateAppWidgetId();
+                
+                values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
+                values.put(Favorites.SPANX, a.getString(R.styleable.Favorite_spanX));
+                values.put(Favorites.SPANY, a.getString(R.styleable.Favorite_spanY));
+                values.put(Favorites.APPWIDGET_ID, appWidgetId);
+                db.insert(TABLE_FAVORITES, null, values);
+
+                allocatedAppWidgets = true;
+                
+                appWidgetManager.bindAppWidgetId(appWidgetId, cn);
+            } catch (RuntimeException ex) {
+                Log.e(LOG_TAG, "Problem allocating appWidgetId", ex);
+            }
+            
+            return allocatedAppWidgets;
+        }
+        
+        private boolean addUriShortcut(SQLiteDatabase db, ContentValues values,
+                TypedArray a) {
+            Resources r = mContext.getResources();
+
+            final int iconResId = a.getResourceId(R.styleable.Favorite_icon, 0);
+            final int titleResId = a.getResourceId(R.styleable.Favorite_title, 0);
+
+            Intent intent = null;
+            String uri = null;
+            try {
+                uri = a.getString(R.styleable.Favorite_uri);
+                intent = Intent.parseUri(uri, 0);
+            } catch (URISyntaxException e) {
+                Log.w(LauncherModel.TAG, "Shortcut has malformed uri: " + uri);
+                return false; // Oh well
+            }
+
+            if (iconResId == 0 || titleResId == 0) {
+                Log.w(LauncherModel.TAG,
+                        "Shortcut is missing title or icon resource ID");
+                return false;
+            }
+
+            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            values.put(Favorites.INTENT, intent.toUri(0));
+            values.put(Favorites.TITLE, r.getString(titleResId));
+            values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_SHORTCUT);
+            values.put(Favorites.SPANX, 1);
+            values.put(Favorites.SPANY, 1);
+            values.put(Favorites.ICON_TYPE, Favorites.ICON_TYPE_RESOURCE);
+            values.put(Favorites.ICON_PACKAGE, mContext.getPackageName());
+            values.put(Favorites.ICON_RESOURCE, r.getResourceName(iconResId));
+
+            db.insert(TABLE_FAVORITES, null, values);
+
+            return true;
+        }
+    }
+    
     /**
      * Build a query string that will match any row where the column matches
      * anything in the values list.
