diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index e28c78b..8ce237c 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -20,22 +20,6 @@
             </intent-filter>
         </activity>
 
-        <activity
-            android:name=".LogcatSettingsActivity"
-            android:label="@string/nfd_log_settings" />
-
-        <activity
-            android:name=".LogcatActivity"
-            android:label="@string/nfd_logger" />
-
-        <activity
-            android:name=".FaceListActivity"
-            android:label="Faces" />
-
-        <activity
-            android:name=".RouteListActivity"
-            android:label="Routes" />
-
         <service
             android:name=".service.NfdService"
             android:process="net.named_data.nfd.service.NfdService"
diff --git a/app/src/main/java/net/named_data/nfd/DrawerFragment.java b/app/src/main/java/net/named_data/nfd/DrawerFragment.java
new file mode 100644
index 0000000..8190941
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/DrawerFragment.java
@@ -0,0 +1,527 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.preference.PreferenceManager;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v4.widget.ViewDragHelper;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.ActionBarActivity;
+import android.support.v7.app.ActionBarDrawerToggle;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+/**
+ * DrawerFragment that provides navigation for MainActivity.
+ */
+public class DrawerFragment extends Fragment {
+
+  public static DrawerFragment
+  newInstance(ArrayList<DrawerFragment.DrawerItem> items) {
+    Bundle drawerParams = new Bundle();
+    drawerParams.putParcelableArrayList(DrawerFragment.BUNDLE_PARAMETERS, items);
+
+    DrawerFragment fragment = new DrawerFragment();
+    fragment.setArguments(drawerParams);
+    return fragment;
+  }
+
+  @Override
+  public void onAttach(Activity activity) {
+    super.onAttach(activity);
+    try {
+      // Register callback
+      m_callbacks = (DrawerCallbacks)activity;
+    } catch (ClassCastException e) {
+      throw new ClassCastException("Host activity must implement DrawerFragment.DrawerCallbacks.");
+    }
+  }
+
+  @Override
+  public void onDetach() {
+    super.onDetach();
+    m_callbacks = null;
+  }
+
+  @Override
+  public void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+
+    // Read in the flag indicating whether or not the user has demonstrated awareness of the
+    // drawer. See PREF_DRAWER_SHOWN_TO_USER_FOR_THE_FIRST_TIME for details.
+    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity());
+    m_hasUserSeenDrawer = sp.getBoolean(PREF_DRAWER_SHOWN_TO_USER_FOR_THE_FIRST_TIME, false);
+
+    if (savedInstanceState != null) {
+      m_drawerSelectedPosition = savedInstanceState.getInt(DRAWER_SELECTED_POSITION_BUNDLE_KEY);
+      m_restoredFromSavedInstanceState = true;
+    }
+
+    m_drawerItems = getArguments().getParcelableArrayList(BUNDLE_PARAMETERS);
+  }
+
+  @Override
+  public View onCreateView(LayoutInflater inflater,
+                           ViewGroup container,
+                           Bundle savedInstanceState)
+  {
+    m_drawerListView = (ListView)inflater.inflate(
+      R.layout.activity_main_drawer_listview, container, false);
+
+    m_drawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+      @Override
+      public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+        // Update UI
+        updateSelection(position);
+      }
+    });
+
+    m_drawerListView.setAdapter(new DrawerListAdapter(getActionBar().getThemedContext(), m_drawerItems));
+    m_drawerListView.setItemChecked(m_drawerSelectedPosition, true);
+
+    return m_drawerListView;
+  }
+
+  @Override
+  public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+    super.onActivityCreated(savedInstanceState);
+    // Fragment influences action bar
+    setHasOptionsMenu(true);
+
+    // Initialize and set up the navigation drawer UI
+    initializeDrawerFragment(getActivity().findViewById(R.id.navigation_drawer),
+                             (DrawerLayout)getActivity().findViewById(R.id.drawer_layout));
+
+    if (savedInstanceState == null) {
+      // when restoring (e.g., after rotation), rely on system to restore previous state of
+      // fragments
+      updateSelection(m_drawerSelectedPosition);
+    }
+  }
+
+  /**
+   * Initialize drawer fragment after being attached to the host activity.
+   *
+   * @param drawerFragmentViewContainer View container that holds the navigation drawer
+   * @param drawerLayout DrawerLayout of the drawer in the host Activity
+   */
+  private void initializeDrawerFragment(View drawerFragmentViewContainer,
+                                        DrawerLayout drawerLayout)
+  {
+    m_drawerFragmentViewContainer = drawerFragmentViewContainer;
+    m_drawerLayout = drawerLayout;
+
+    // Setup drawer and action bar
+    ActionBar actionBar = getActionBar();
+    actionBar.setDisplayHomeAsUpEnabled(true);
+    actionBar.setHomeButtonEnabled(true);
+
+    m_drawerToggle = new ActionBarDrawerToggle(
+        getActivity(),
+        m_drawerLayout,
+        R.string.accessibility_open_drawer,
+        R.string.accessibility_close_drawer)
+    {
+      @Override
+      public void onDrawerClosed(View drawerView) {
+        super.onDrawerClosed(drawerView);
+        if (!isAdded()) {
+          return;
+        }
+
+        // Allow update calls to onCreateOptionsMenu() and
+        // onPrepareOptionsMenu() to update Menu UI.
+        getActivity().supportInvalidateOptionsMenu();
+      }
+
+      @Override
+      public void onDrawerOpened(View drawerView) {
+        super.onDrawerOpened(drawerView);
+        if (!isAdded()) {
+          // Drawer has not been added; Nothing to de here
+          return;
+        }
+
+        // Flag that user has seen drawer for the first time
+        if (!m_hasUserSeenDrawer) {
+          m_hasUserSeenDrawer = true;
+          SharedPreferences sp = PreferenceManager
+              .getDefaultSharedPreferences(getActivity());
+
+          sp.edit()
+            .putBoolean(PREF_DRAWER_SHOWN_TO_USER_FOR_THE_FIRST_TIME, true)
+            .apply();
+        }
+
+        // Allow update calls to onCreateOptionsMenu() and
+        // onPrepareOptionsMenu() to update Menu UI
+        getActivity().supportInvalidateOptionsMenu();
+      }
+
+      @Override
+      public void onDrawerStateChanged(int newState) {
+        super.onDrawerStateChanged(newState);
+        switch (newState) {
+          case ViewDragHelper.STATE_DRAGGING:
+            // Fall through; Same condition.
+          case ViewDragHelper.STATE_SETTLING:
+            if (m_drawerCurrentState == DRAWER_CLOSED) {
+                m_shouldHideOptionsMenu = true;
+                m_drawerCurrentState = DRAWER_SLIDING;
+                getActivity().supportInvalidateOptionsMenu();
+            }
+            break;
+          case ViewDragHelper.STATE_IDLE:
+            if (m_drawerCurrentState == DRAWER_SLIDING) {
+              m_drawerCurrentState = DRAWER_OPENED;
+              m_shouldHideOptionsMenu = false;
+              getActivity().supportInvalidateOptionsMenu();
+            } else if (m_drawerCurrentState == DRAWER_OPENED) {
+              m_drawerCurrentState = DRAWER_CLOSED;
+            }
+            break;
+        }
+      }
+    };
+
+    // Open drawer for the first time
+    if (!m_hasUserSeenDrawer && !m_restoredFromSavedInstanceState) {
+      m_shouldHideOptionsMenu = true;
+      m_drawerCurrentState = DRAWER_OPENED;
+      m_drawerLayout.openDrawer(m_drawerFragmentViewContainer);
+    }
+
+    // Post to drawer's handler to update UI State
+    m_drawerLayout.post(new Runnable() {
+      @Override
+      public void run() {
+        m_drawerToggle.syncState();
+      }
+    });
+
+    m_drawerLayout.setDrawerListener(m_drawerToggle);
+  }
+
+  @Override
+  public void onSaveInstanceState(Bundle outState) {
+    super.onSaveInstanceState(outState);
+    outState.putInt(DRAWER_SELECTED_POSITION_BUNDLE_KEY, m_drawerSelectedPosition);
+  }
+
+  @Override
+  public void onConfigurationChanged(Configuration newConfig) {
+    super.onConfigurationChanged(newConfig);
+    // Forward the new configuration the drawer toggle component.
+    m_drawerToggle.onConfigurationChanged(newConfig);
+  }
+
+  @Override
+  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+    super.onCreateOptionsMenu(menu, inflater);
+    // Update menu UI when the drawer is open. This gives the user a better
+    // contextual perception of the application.
+    if (m_drawerLayout != null && isDrawerOpen()) {
+      // Inflate drawer specific menu here (if any)
+      showGlobalContextActionBar();
+    }
+
+  }
+
+  @Override
+  public void onPrepareOptionsMenu(Menu menu) {
+    super.onPrepareOptionsMenu(menu);
+    // Remove option menu items when drawer is sliding out
+    if (m_shouldHideOptionsMenu) {
+      for (int i = 0; i < menu.size(); i++) {
+        menu.getItem(i).setVisible(false);
+      }
+    }
+
+  }
+
+  @Override
+  public boolean onOptionsItemSelected(MenuItem item) {
+    // Handle drawer selection events
+    if (m_drawerToggle.onOptionsItemSelected(item)) {
+      return true;
+    }
+
+    // Handle other menu items
+    switch (item.getItemId()) {
+    // Handle activity menu item here (if any)
+    default:
+      return super.onOptionsItemSelected(item);
+    }
+  }
+
+  /**
+   * Convenience method that updates the UI and callbacks the host activity.
+   *
+   * @param position Position of the selected item within the Drawer's ListView.
+   */
+  private void updateSelection(int position) {
+    // Update Position
+    m_drawerSelectedPosition = position;
+
+    // Update UI of selected position
+    if (m_drawerListView != null) {
+      m_drawerListView.setItemChecked(position, true);
+    }
+
+    // Close drawer
+    if (m_drawerLayout != null) {
+      m_drawerLayout.closeDrawer(m_drawerFragmentViewContainer);
+    }
+
+    // Invoke host activity callback
+    if (m_callbacks != null) {
+      DrawerItem item = m_drawerItems.get(position);
+      m_callbacks.onDrawerItemSelected(item.getItemCode(), item.getItemName());
+    }
+  }
+
+  /**
+   * Safe convenience method to determine if drawer is open.
+   *
+   * @return True if drawer is present and in an open state; false otherwise
+   */
+  public boolean isDrawerOpen() {
+    return m_drawerLayout != null && m_drawerLayout.isDrawerOpen(m_drawerFragmentViewContainer);
+  }
+
+  /**
+   * Convenience method to update host activity action bar so that the user is informed of
+   * the app's "current context" of the fragment.
+   */
+  private void showGlobalContextActionBar() {
+    ActionBar actionBar = getActionBar();
+    actionBar.setDisplayShowTitleEnabled(true);
+    actionBar.setTitle(R.string.app_name);
+  }
+
+  /**
+   * Convenience method to get host activity's ActionBar. This makes for easy updates
+   * in a single location when upgrading to use >= HONEYCOMB (API 11) ActionBar.
+   *
+   * @return Host activity's ActionBar.
+   */
+  private ActionBar getActionBar() {
+    return ((ActionBarActivity)getActivity()).getSupportActionBar();
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /**
+   * DrawerItem represents a single selection option in the Drawer, complete
+   * with the ability to set a Drawable resource icon for display along
+   * with the drawer item name.
+   */
+  public static class DrawerItem implements Parcelable {
+    @Override
+    public int describeContents()
+    {
+      return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel parcel, int i)
+    {
+      parcel.writeInt(m_itemNameId);
+      parcel.writeInt(m_iconResId);
+      parcel.writeInt(m_itemCode);
+    }
+
+    public static final Parcelable.Creator<DrawerItem> CREATOR = new Parcelable.Creator<DrawerItem>() {
+      public DrawerItem
+      createFromParcel(Parcel in) {
+        return new DrawerItem(in.readInt(), in.readInt(), in.readInt());
+      }
+
+      public DrawerItem[] newArray(int size) {
+        return new DrawerItem[size];
+      }
+    };
+
+    public
+    DrawerItem(int itemNameId, int resIconId, int itemCode) {
+      m_itemNameId = itemNameId;
+      m_iconResId = resIconId;
+      m_itemCode = itemCode;
+    }
+
+    public int
+    getItemName() {
+      return m_itemNameId;
+    }
+
+    public int
+    getIconResId() {
+      return m_iconResId;
+    }
+
+    public int
+    getItemCode() {
+      return m_itemCode;
+    }
+
+    ///////////////////////////////////////////////////////////////////////////
+
+    /** Drawer item name */
+    private final int m_itemNameId;
+
+    /** Resource ID of a drawable to be shown as the item's icon */
+    private final int m_iconResId;
+
+    /** Item code for feedback to the host activity's implemented callback. */
+    private final int m_itemCode;
+
+  }
+
+  /**
+   * Customized DrawerListAdapter to furnishes the Drawer with DrawerItem
+   * information.
+   */
+  private static class DrawerListAdapter extends ArrayAdapter<DrawerItem> {
+
+    public DrawerListAdapter(Context context, ArrayList<DrawerItem> drawerItems) {
+      super(context, 0, drawerItems);
+      m_layoutInflater =
+          (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+      m_resources = context.getResources();
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+      DrawerItemHolder holder;
+
+      if (convertView == null) {
+        holder = new DrawerItemHolder();
+
+        convertView = m_layoutInflater.inflate(R.layout.list_item_drawer_item, null);
+        convertView.setTag(holder);
+
+        holder.m_icon = (ImageView) convertView.findViewById(R.id.drawer_item_icon);
+        holder.m_text = (TextView) convertView.findViewById(R.id.drawer_item_text);
+      } else {
+        holder = (DrawerItemHolder)convertView.getTag();
+      }
+
+      // Update items in holder
+      DrawerItem item = getItem(position);
+      if (item.getIconResId() != 0) {
+        holder.m_icon.setImageDrawable(m_resources.getDrawable(item.getIconResId()));
+      }
+      holder.m_text.setText(item.getItemName());
+
+      return convertView;
+    }
+
+    private static class DrawerItemHolder {
+      private ImageView m_icon;
+      private TextView m_text;
+    }
+
+    /** Layout inflater for use */
+    private final LayoutInflater m_layoutInflater;
+
+    /** Reference to get context's resources */
+    private final Resources m_resources;
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /** Callback that host activity must implement */
+  public static interface DrawerCallbacks {
+    /** Callback to host activity when a drawer item is selected */
+    void onDrawerItemSelected(int itemCode, int itemNameId);
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /** SharedPreference: Display drawer when drawer loads for the very first time */
+  private static final String PREF_DRAWER_SHOWN_TO_USER_FOR_THE_FIRST_TIME
+      = "DRAWER_PRESENTED_TO_USER_ON_FIRST_LOAD";
+
+  /** Bundle key used to (re)store position of selected drawer item */
+  private static final String DRAWER_SELECTED_POSITION_BUNDLE_KEY
+      = "DRAWER_SELECTED_POSITION";
+
+  /** Bundle argument key for bundle parameters */
+  private static final String BUNDLE_PARAMETERS = "net.named_data.nfd.drawer_fragment_parameters";
+
+  /** Callback to parent activity */
+  private DrawerCallbacks m_callbacks;
+
+  /** DrawerToggle for interacting with drawer and action bar app icon */
+  private ActionBarDrawerToggle m_drawerToggle;
+
+  /** Reference to DrawerLayout fragment in host activity */
+  private DrawerLayout m_drawerLayout;
+
+  /** Reference to drawer's ListView */
+  private ListView m_drawerListView;
+
+  /** Drawer's fragment container in the host activity */
+  private View m_drawerFragmentViewContainer;
+
+  /** Current position of the Drawer's selection */
+  private int m_drawerSelectedPosition = 0;
+
+  /** Flag that denotes if the fragment is restored from an instance state */
+  private boolean m_restoredFromSavedInstanceState;
+
+  /** Flag that denotes if the user has seen the Drawer when the app loads for the first time */
+  private boolean m_hasUserSeenDrawer;
+
+  /** ArrayList of DrawerItems to be displayed in the Drawer */
+  private ArrayList<DrawerItem> m_drawerItems;
+
+  /** Flag that marks if drawer is sliding outwards and being displayed */
+  private boolean m_shouldHideOptionsMenu;
+
+  /** Keeping track of the drawer state */
+  private int m_drawerCurrentState = DRAWER_CLOSED;
+
+  /** Drawer State Values that are used by m_drawerCurrentState */
+  private static final int DRAWER_SLIDING = 1;
+  private static final int DRAWER_CLOSED  = 2;
+  private static final int DRAWER_OPENED  = 3;
+}
diff --git a/app/src/main/java/net/named_data/nfd/FaceCreateDialog.java b/app/src/main/java/net/named_data/nfd/FaceCreateDialog.java
deleted file mode 100644
index 0020f59..0000000
--- a/app/src/main/java/net/named_data/nfd/FaceCreateDialog.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
- * See AUTHORS.md for complete list of NFD Android authors and contributors.
- *
- * NFD Android is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.named_data.nfd;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.content.DialogInterface;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.WindowManager;
-import android.widget.EditText;
-
-import net.named_data.jndn_xx.util.FaceUri;
-import net.named_data.nfd.utils.Nfdc;
-import net.named_data.nfd.utils.NfdcAsyncTask;
-
-public class FaceCreateDialog extends DialogFragment
-{
-  @Override
-  public Dialog
-  onCreateDialog(Bundle savedInstanceState) {
-    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-    LayoutInflater inflater = getActivity().getLayoutInflater();
-    builder
-      .setView(inflater.inflate(R.layout.create_face, null))
-      .setPositiveButton("Create face", new DialogInterface.OnClickListener() {
-          @Override
-          public void onClick(DialogInterface dialog, int id)
-          {
-            EditText uriBox = (EditText) getDialog().findViewById(R.id.faceUri);
-            final String uri = uriBox.getText().toString();
-            new NfdcAsyncTask(getActivity(),
-                              new NfdcAsyncTask.Task() {
-                                public String
-                                runTask() throws Exception
-                                {
-                                  try {
-                                    Nfdc nfdc = new Nfdc();
-                                    int faceId = nfdc.faceCreate(m_uri);
-                                    nfdc.shutdown();
-                                    return "OK. Face id: " + String.valueOf(faceId);
-                                  } catch (FaceUri.CanonizeError e) {
-                                    return "Error creating face (" + e.getMessage() + ")";
-                                  } catch (FaceUri.Error e) {
-                                    return "Error creating face (" + e.getMessage() + ")";
-                                  }
-                                }
-
-                                ///////////////////////////
-                                private String m_uri = uri;
-                              }).execute();
-          }
-        })
-      .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
-          public void onClick(DialogInterface dialog, int id)
-          {
-            FaceCreateDialog.this.getDialog().cancel();
-          }
-        })
-    ;
-
-    Dialog faceCreateDialog = builder.create();
-    faceCreateDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
-    return faceCreateDialog;
-  }
-}
diff --git a/app/src/main/java/net/named_data/nfd/FaceCreateDialogFragment.java b/app/src/main/java/net/named_data/nfd/FaceCreateDialogFragment.java
new file mode 100644
index 0000000..2013129
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/FaceCreateDialogFragment.java
@@ -0,0 +1,72 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.DialogFragment;
+import android.view.LayoutInflater;
+import android.view.WindowManager;
+import android.widget.EditText;
+
+public class FaceCreateDialogFragment extends DialogFragment {
+  public static interface OnFaceCreateRequested {
+    public void
+    createFace(String faceUri);
+  }
+
+  public static FaceCreateDialogFragment
+  newInstance() {
+    return new FaceCreateDialogFragment();
+  }
+
+  @NonNull @Override
+  public Dialog
+  onCreateDialog(@Nullable Bundle savedInstanceState) {
+    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+    LayoutInflater inflater = getActivity().getLayoutInflater();
+    builder
+      .setView(inflater.inflate(R.layout.create_face, null))
+      .setPositiveButton(R.string.face_add_dialog_create_face, new DialogInterface.OnClickListener() {
+          @Override
+          public void onClick(DialogInterface dialog, int id)
+          {
+            EditText uriBox = (EditText) getDialog().findViewById(R.id.faceUri);
+            String uri = uriBox.getText().toString();
+            ((OnFaceCreateRequested)getTargetFragment()).createFace(uri);
+          }
+        })
+      .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+          public void onClick(DialogInterface dialog, int id)
+          {
+            FaceCreateDialogFragment.this.getDialog().cancel();
+          }
+        })
+    ;
+
+    Dialog faceCreateDialog = builder.create();
+    faceCreateDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
+    return faceCreateDialog;
+  }
+}
diff --git a/app/src/main/java/net/named_data/nfd/FaceListActivity.java b/app/src/main/java/net/named_data/nfd/FaceListActivity.java
deleted file mode 100644
index 3ca5042..0000000
--- a/app/src/main/java/net/named_data/nfd/FaceListActivity.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
- * See AUTHORS.md for complete list of NFD Android authors and contributors.
- *
- * NFD Android is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.named_data.nfd;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.FragmentManager;
-import android.app.FragmentTransaction;
-import android.app.ListFragment;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.os.Bundle;
-import android.preference.PreferenceFragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.BaseAdapter;
-import android.widget.TextView;
-
-import com.intel.jndn.management.types.FacePersistency;
-import com.intel.jndn.management.types.FaceScope;
-import com.intel.jndn.management.types.FaceStatus;
-import com.intel.jndn.management.types.LinkType;
-
-import net.named_data.jndn.encoding.EncodingException;
-import net.named_data.jndn.util.Blob;
-import net.named_data.nfd.utils.NfdcAsyncTask;
-import net.named_data.nfd.utils.Nfdc;
-
-import org.joda.time.Period;
-import org.joda.time.format.PeriodFormat;
-import org.w3c.dom.Text;
-
-import java.nio.ByteBuffer;
-import java.util.LinkedList;
-import java.util.List;
-
-public class FaceListActivity extends Activity {
-  @Override
-  public void
-  onCreate(Bundle savedInstanceState)
-  {
-    super.onCreate(savedInstanceState);
-
-    FragmentManager fm = getFragmentManager();
-    FragmentTransaction ft = fm.beginTransaction();
-    if (fm.findFragmentById(android.R.id.content) == null) {
-      ft.add(android.R.id.content, m_faceListFragment);
-    } else {
-      ft.replace(android.R.id.content, m_faceListFragment);
-    }
-    ft.commit();
-  }
-
-  public static class FaceListFragment extends ListFragment
-    implements AdapterView.OnItemLongClickListener,
-               AdapterView.OnItemClickListener {
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState)
-    {
-      super.onActivityCreated(savedInstanceState);
-
-      setListAdapter(new FaceListAdapter(getActivity()));
-      getListView().setLongClickable(true);
-
-      getListView().setOnItemLongClickListener(this);
-      getListView().setOnItemClickListener(this);
-
-    }
-
-    @Override
-    public boolean
-    onItemLongClick(final AdapterView<?> parent, View view, final int position, long id)
-    {
-      final int faceId = (int)id;
-      if (faceId < 256) {
-        return false;
-      }
-
-      AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
-      alertDialogBuilder
-        .setMessage("Delete face " + String.valueOf(faceId) + "?")
-        .setCancelable(false)
-        .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
-          public void onClick(DialogInterface dialog, int id)
-          {
-            new NfdcAsyncTask(getActivity(),
-                              new NfdcAsyncTask.Task() {
-                                public String
-                                runTask() throws Exception
-                                {
-                                  Nfdc nfdc = new Nfdc();
-                                  nfdc.faceDestroy(faceId);
-                                  nfdc.shutdown();
-
-                                  getActivity().runOnUiThread(new Runnable() {
-                                    @Override
-                                    public void run()
-                                    {
-                                      ((FaceListAdapter) parent.getAdapter()).updateFaceList();
-                                    }
-                                  });
-                                  return null;
-                                }
-                              }).execute();
-          }
-        })
-        .setNegativeButton("No", new DialogInterface.OnClickListener() {
-          public void onClick(DialogInterface dialog, int id)
-          {
-            dialog.cancel();
-          }
-        });
-
-      AlertDialog alertDialog = alertDialogBuilder.create();
-      alertDialog.show();
-
-      return true;
-    }
-
-    @Override
-    public void onItemClick(AdapterView<?> parent, View view, int position, long id)
-    {
-      FaceStatus s = (FaceStatus)getListAdapter().getItem(position);
-      FaceStatusFragment fragment = new FaceStatusFragment();
-      Bundle bundle = new Bundle();
-      bundle.putByteArray("faceStatus", s.wireEncode().getImmutableArray());
-      fragment.setArguments(bundle);
-
-      getFragmentManager()
-        .beginTransaction()
-        .addToBackStack("FaceStatus")
-        .replace(android.R.id.content, fragment)
-        .commit();
-    }
-
-    private class FaceListAdapter extends BaseAdapter {
-      public FaceListAdapter(Context context)
-      {
-        this.m_inflater = LayoutInflater.from(context);
-        this.m_context = context;
-
-        updateFaceList();
-      }
-
-      public void
-      updateFaceList()
-      {
-        new NfdcAsyncTask(m_context,
-                          new NfdcAsyncTask.Task() {
-                            public String
-                            runTask() throws Exception
-                            {
-                              synchronized (m_facesLock) {
-                                Nfdc nfdc = new Nfdc();
-                                m_faces = nfdc.faceList();
-                                nfdc.shutdown();
-                              }
-
-                              getActivity().runOnUiThread(new Runnable() {
-                                @Override
-                                public void run()
-                                {
-                                  notifyDataSetChanged();
-                                }
-                              });
-                              return null;
-                            }
-                          }).execute();
-      }
-
-      @Override
-      public int
-      getCount()
-      {
-        synchronized (m_facesLock) {
-          if (m_faces == null)
-            return 0;
-          else
-            return m_faces.size();
-        }
-      }
-
-      @Override
-      public Object
-      getItem(int position)
-      {
-        synchronized (m_facesLock) {
-          assert m_faces != null && position < m_faces.size();
-          return m_faces.get(position);
-        }
-      }
-
-      @Override
-      public long
-      getItemId(int position)
-      {
-        synchronized (m_facesLock) {
-          assert m_faces != null && position < m_faces.size();
-          return m_faces.get(position).getFaceId();
-        }
-      }
-
-      @Override
-      public View
-      getView(int position, View convertView, ViewGroup parent)
-      {
-        if (convertView == null) {
-          convertView = this.m_inflater.inflate(android.R.layout.simple_list_item_2, parent, false);
-        }
-
-        FaceStatus s;
-        synchronized(m_facesLock) {
-          s = m_faces.get(position);
-        }
-
-        ((TextView)convertView.findViewById(android.R.id.text2)).setText(String.valueOf(s.getFaceId()));
-        ((TextView)convertView.findViewById(android.R.id.text1)).setText(s.getUri());
-
-        return convertView;
-      }
-
-      /////////////////////////////////////////////////////////////////////////
-      private LayoutInflater m_inflater;
-      private Context m_context;
-      private List<FaceStatus> m_faces;
-      private final Object m_facesLock = new Object();
-    }
-  }
-
-  ////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public static class FaceStatusFragment extends ListFragment {
-
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState)
-    {
-      super.onActivityCreated(savedInstanceState);
-
-      FaceStatus s = null;
-      try {
-        s = new FaceStatus();
-        s.wireDecode(new Blob(getArguments().getByteArray("faceStatus")).buf());
-      }
-      catch (EncodingException e) {
-        assert false;
-      }
-
-      m_faceStatus.add(new Item("Face ID",          String.valueOf(s.getFaceId())));
-      m_faceStatus.add(new Item("Local FaceUri",    s.getLocalUri()));
-      m_faceStatus.add(new Item("Remote FaceUri",   s.getUri()));
-      m_faceStatus.add(new Item("Expires in",       s.getExpirationPeriod() < 0 ?
-        "never" :
-        PeriodFormat.getDefault().print(new Period(s.getExpirationPeriod()))));
-      m_faceStatus.add(new Item("Face scope",       getScope(s.getFaceScope())));
-      m_faceStatus.add(new Item("Face persistency", getPersistency(s.getFacePersistency())));
-      m_faceStatus.add(new Item("Link type",        getLinkType(s.getLinkType())));
-      m_faceStatus.add(new Item("In interests",     String.valueOf(s.getInInterests())));
-      m_faceStatus.add(new Item("In data",          String.valueOf(s.getInDatas())));
-      m_faceStatus.add(new Item("Out interests",    String.valueOf(s.getOutInterests())));
-      m_faceStatus.add(new Item("Out data",         String.valueOf(s.getOutDatas())));
-      m_faceStatus.add(new Item("In bytes",         String.valueOf(s.getInBytes())));
-      m_faceStatus.add(new Item("Out bytes",        String.valueOf(s.getOutBytes())));
-
-      setListAdapter(new FaceStatusAdapter(getActivity()));
-    }
-
-    private class FaceStatusAdapter extends BaseAdapter {
-      public FaceStatusAdapter(Context context)
-      {
-        this.m_inflater = LayoutInflater.from(context);
-      }
-
-      @Override
-      public int getCount()
-      {
-        return m_faceStatus.size();
-      }
-
-      @Override
-      public Object getItem(int position)
-      {
-        return m_faceStatus.get(position);
-      }
-
-      @Override
-      public long getItemId(int position)
-      {
-        return position;
-      }
-
-      @Override
-      public View getView(int position, View convertView, ViewGroup parent)
-      {
-        if (convertView == null) {
-          convertView = m_inflater.inflate(R.layout.face_status_item, parent, false);
-        }
-
-        Item i = (Item)getItem(position);
-        ((TextView)convertView.findViewById(R.id.title)).setText(i.getTitle());
-        ((TextView)convertView.findViewById(R.id.value)).setText(i.getValue());
-
-        return convertView;
-      }
-
-      /////////////////////////////////////////////////////////////////////////
-      private LayoutInflater m_inflater;
-    }
-
-    private static class Item {
-      public Item(String title, String value)
-      {
-        m_title = title;
-        m_value = value;
-      }
-
-      public String getValue()
-      {
-        return m_value;
-      }
-
-      public void setValue(String value)
-      {
-        m_value = value;
-      }
-
-      public String getTitle()
-      {
-        return m_title;
-      }
-
-      public void setTitle(String title)
-      {
-        m_title = title;
-      }
-
-      /////////////////////////////////////////////////////////////////////////
-      private String m_title;
-      private String m_value;
-    }
-    private List<Item> m_faceStatus = new LinkedList<Item>();
-  }
-
-  /////////////////////////////////////////////////////////////////////////////
-
-  private static String
-  getScope(FaceScope scope)
-  {
-    assert scope.getNumericValue() < s_scopes.length;
-    return s_scopes[scope.getNumericValue()];
-  }
-
-  private static String
-  getPersistency(FacePersistency persistency)
-  {
-    assert persistency.getNumericValue() < s_persistencies.length;
-    return s_persistencies[persistency.getNumericValue()];
-  }
-
-  private static String
-  getLinkType(LinkType linkType)
-  {
-    assert linkType.getNumericValue() < s_linkTypes.length;
-    return s_linkTypes[linkType.getNumericValue()];
-  }
-
-  private static final String[] s_scopes = {"Local", "Non-local"};
-  private static final String[] s_persistencies = {"Persistent", "On-demand", "Permanent"};
-  private static final String[] s_linkTypes = {"Point-to-point", "Multi-access"};
-
-  private FaceListFragment m_faceListFragment = new FaceListFragment();
-}
diff --git a/app/src/main/java/net/named_data/nfd/FaceListFragment.java b/app/src/main/java/net/named_data/nfd/FaceListFragment.java
new file mode 100644
index 0000000..168fe85
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/FaceListFragment.java
@@ -0,0 +1,528 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.v4.app.ListFragment;
+import android.util.Pair;
+import android.view.ActionMode;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AbsListView;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.intel.jndn.management.types.FaceStatus;
+
+import net.named_data.jndn_xx.util.FaceUri;
+import net.named_data.nfd.utils.G;
+import net.named_data.nfd.utils.Nfdc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FaceListFragment extends ListFragment implements FaceCreateDialogFragment.OnFaceCreateRequested {
+
+  public static FaceListFragment
+  newInstance() {
+    return new FaceListFragment();
+  }
+
+  @Override
+  public void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+
+    setListAdapter(new FaceListAdapter(getActivity()));
+  }
+
+  @Override
+  public View onCreateView(final LayoutInflater inflater,
+                           ViewGroup container,
+                           Bundle savedInstanceState)
+  {
+    @SuppressLint("InflateParams")
+    View v = inflater.inflate(R.layout.fragment_face_list, null);
+
+    // Get info unavailable view
+    m_faceListInfoUnavailableView = v.findViewById(R.id.face_list_info_unavailable);
+
+    // Get progress bar spinner view
+    m_reloadingListProgressBar
+        = (ProgressBar)v.findViewById(R.id.face_list_reloading_list_progress_bar);
+
+    // Set refresh button click listener
+    Button refreshFaceListButton = (Button)v.findViewById(R.id.face_list_refresh_button);
+    refreshFaceListButton.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View v) {
+        retrieveFaceList();
+      }
+    });
+
+    Button addFaceButton = (Button)v.findViewById(R.id.face_list_add_button);
+    addFaceButton.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view)
+      {
+        FaceCreateDialogFragment dialog = FaceCreateDialogFragment.newInstance();
+        dialog.setTargetFragment(FaceListFragment.this, 0);
+        dialog.show(getFragmentManager(), "FaceCreateFragment");
+      }
+    });
+
+    // Setup list view for deletion
+    ListView listView = (ListView)v.findViewById(android.R.id.list);
+    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
+    listView.setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() {
+      @Override
+      public void
+      onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
+        if (checked && id < 256) {
+          getListView().setItemChecked(position, false);
+        }
+      }
+
+      @Override
+      public boolean
+      onCreateActionMode(ActionMode mode, Menu menu) {
+        MenuInflater menuInflater = mode.getMenuInflater();
+        menuInflater.inflate(R.menu.menu_face_list_multiple_modal_menu, menu);
+        return true;
+      }
+
+      @Override
+      public boolean
+      onPrepareActionMode(ActionMode mode, Menu menu) {
+        return false;
+      }
+
+      @Override
+      public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+        switch (item.getItemId()) {
+          case R.id.menu_item_delete_face_item:
+            FaceListAdapter faceListAdapter = (FaceListAdapter)getListAdapter();
+            List<Integer> deleteFaceInfoList = new ArrayList<Integer>();
+
+            for (int i = faceListAdapter.getCount() - 1; i >= 0; i--) {
+              if (getListView().isItemChecked(i)) {
+                int faceId = faceListAdapter.getItem(i).getFaceId();
+                if (faceId < 256)
+                  continue;
+                deleteFaceInfoList.add(faceListAdapter.getItem(i).getFaceId());
+              }
+            }
+
+            // Delete selected faceIds
+            m_faceDestroyAsyncTask = new FaceDestroyAsyncTask();
+            m_faceDestroyAsyncTask.execute(deleteFaceInfoList);
+
+            mode.finish();
+            return true;
+          default:
+            return false;
+        }
+      }
+
+      @Override
+      public void onDestroyActionMode(ActionMode mode) {
+      }
+    });
+
+    return v;
+  }
+
+  @Override
+  public void onResume() {
+    super.onResume();
+    startFaceListRetrievalTask();
+  }
+
+  @Override
+  public void onPause() {
+    super.onPause();
+    stopFaceListRetrievalTask();
+
+    if (m_faceDestroyAsyncTask != null) {
+      m_faceDestroyAsyncTask.cancel(false);
+      m_faceDestroyAsyncTask = null;
+    }
+
+    if (m_faceCreateAsyncTask != null) {
+      m_faceCreateAsyncTask.cancel(false);
+      m_faceCreateAsyncTask = null;
+    }
+  }
+
+  @Override
+  public void onAttach(Activity activity) {
+    super.onAttach(activity);
+    try {
+      m_callbacks = (Callbacks)activity;
+    } catch (Exception e) {
+      G.Log("Hosting activity must implement this fragment's callbacks: " + e);
+    }
+  }
+
+  @Override
+  public void onDetach() {
+    super.onDetach();
+    m_callbacks = null;
+  }
+
+  @Override
+  public void
+  onListItemClick(ListView l, View v, int position, long id) {
+    if (m_callbacks != null) {
+      FaceStatus faceStatus = (FaceStatus)l.getAdapter().getItem(position);
+      m_callbacks.onFaceItemSelected(faceStatus);
+    }
+  }
+
+  @Override
+  public void
+  createFace(String faceUri)
+  {
+    m_faceCreateAsyncTask = new FaceCreateAsyncTask(faceUri);
+    m_faceCreateAsyncTask.execute();
+  }
+
+  /////////////////////////////////////////////////////////////////////////
+
+  /**
+   * Updates the underlying adapter with the given list of FaceStatus.
+   *
+   * Note: This method should only be called from the UI thread.
+   *
+   * @param list Update ListView with the given List&lt;FaceStatus&gt;
+   */
+  private void updateFaceList(List<FaceStatus> list) {
+    if (list == null) {
+      m_faceListInfoUnavailableView.setVisibility(View.VISIBLE);
+      return;
+    }
+
+    ((FaceListAdapter)getListAdapter()).updateList(list);
+  }
+
+  /**
+   * Convenience method that starts the AsyncTask that retrieves the
+   * list of available faces.
+   */
+  private void retrieveFaceList() {
+    // Update UI
+    m_faceListInfoUnavailableView.setVisibility(View.GONE);
+
+    // Stop if running; before starting the new Task
+    stopFaceListRetrievalTask();
+    startFaceListRetrievalTask();
+  }
+
+  /**
+   * Create a new AsyncTask for face list information retrieval.
+   */
+  private void startFaceListRetrievalTask() {
+    m_faceListAsyncTask = new FaceListAsyncTask();
+    m_faceListAsyncTask.execute();
+  }
+
+  /**
+   * Stops a previously started face retrieval AsyncTask.
+   */
+  private void stopFaceListRetrievalTask() {
+    if (m_faceListAsyncTask != null) {
+      m_faceListAsyncTask.cancel(false);
+      m_faceListAsyncTask = null;
+    }
+  }
+
+  /**
+   * Custom adapter for displaying face information in a ListView.
+   */
+  private static class FaceListAdapter extends BaseAdapter {
+    private FaceListAdapter(Context context) {
+      m_layoutInflater = LayoutInflater.from(context);
+    }
+
+    private void
+    updateList(List<FaceStatus> faces)
+    {
+      m_faces = faces;
+      notifyDataSetChanged();
+    }
+
+    @Override
+    public FaceStatus
+    getItem(int i)
+    {
+      assert m_faces != null;
+      return m_faces.get(i);
+    }
+
+    @Override
+    public long getItemId(int i)
+    {
+      assert m_faces != null;
+      return m_faces.get(i).getFaceId();
+    }
+
+    @Override
+    public int getCount()
+    {
+      return (m_faces != null) ? m_faces.size() : 0;
+    }
+
+    @SuppressLint("InflateParams")
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+      FaceInfoHolder holder;
+
+      if (convertView == null) {
+        holder = new FaceInfoHolder();
+
+        convertView = m_layoutInflater.inflate(R.layout.list_item_face_status_item, null);
+        convertView.setTag(holder);
+
+        holder.m_faceUri = (TextView)convertView.findViewById(R.id.list_item_face_uri);
+        holder.m_faceId = (TextView)convertView.findViewById(R.id.list_item_face_id);
+      } else {
+        holder = (FaceInfoHolder)convertView.getTag();
+      }
+
+      FaceStatus info = getItem(position);
+      holder.m_faceUri.setText(info.getUri());
+      holder.m_faceId.setText(String.valueOf(info.getFaceId()));
+
+      return convertView;
+    }
+
+    private static class FaceInfoHolder {
+      private TextView m_faceUri;
+      private TextView m_faceId;
+    }
+
+    private final LayoutInflater m_layoutInflater;
+    private List<FaceStatus> m_faces;
+  }
+
+  /**
+   * AsyncTask that gets the list of faces from the running NFD.
+   */
+  private class FaceListAsyncTask extends AsyncTask<Void, Void, Pair<List<FaceStatus>, Exception>> {
+    @Override
+    protected void
+    onPreExecute() {
+      // Display progress bar
+      m_reloadingListProgressBar.setVisibility(View.VISIBLE);
+    }
+
+    @Override
+    protected Pair<List<FaceStatus>, Exception>
+    doInBackground(Void... params) {
+      Exception returnException = null;
+      Nfdc nfdc = new Nfdc();
+      List<FaceStatus> faceStatusList = null;
+      try {
+        faceStatusList = nfdc.faceList();
+      } catch (Exception e) {
+        returnException = e;
+      }
+      nfdc.shutdown();
+      return new Pair<>(faceStatusList, returnException);
+    }
+
+    @Override
+    protected void
+    onCancelled() {
+      // Remove progress bar
+      m_reloadingListProgressBar.setVisibility(View.GONE);
+
+      // Nothing to do here; No change in UI.
+    }
+
+    @Override
+    protected void
+    onPostExecute(Pair<List<FaceStatus>, Exception> result) {
+      // Remove progress bar
+      m_reloadingListProgressBar.setVisibility(View.GONE);
+
+      if (result.second != null) {
+        Toast.makeText(getActivity(), "Error communicating with NFD (" + result.second.getMessage() + ")",
+                       Toast.LENGTH_LONG).show();
+      }
+
+      updateFaceList(result.first);
+    }
+  }
+
+  /**
+   * AsyncTask that destroys faces that are passed in as a list of FaceInfo.
+   */
+  private class FaceDestroyAsyncTask extends AsyncTask<List<Integer>, Void, Exception> {
+    @Override
+    protected void
+    onPreExecute() {
+      // Display progress bar
+      m_reloadingListProgressBar.setVisibility(View.VISIBLE);
+    }
+
+    @SafeVarargs
+    @Override
+    protected final Exception
+    doInBackground(List<Integer>... params) {
+      Exception retval = null;
+
+      Nfdc nfdc = new Nfdc();
+      try {
+        for (List<Integer> faces : params) {
+          for (int faceId : faces) {
+            nfdc.faceDestroy(faceId);
+          }
+        }
+      } catch (Exception e) {
+        retval = e;
+      }
+      nfdc.shutdown();
+
+      return retval;
+    }
+
+    @Override
+    protected void onCancelled() {
+      // Remove progress bar
+      m_reloadingListProgressBar.setVisibility(View.GONE);
+
+      // Nothing to do here; No change in UI.
+    }
+
+    @Override
+    protected void onPostExecute(Exception e) {
+      // Remove progress bar
+      m_reloadingListProgressBar.setVisibility(View.GONE);
+
+      if (e != null) {
+        Toast.makeText(getActivity(), "Error communicating with NFD (" + e.getMessage() + ")",
+                       Toast.LENGTH_LONG).show();
+      }
+      else {
+        // Reload face list
+        retrieveFaceList();
+      }
+    }
+  }
+
+  private class FaceCreateAsyncTask extends AsyncTask<Void, Void, String> {
+    public FaceCreateAsyncTask(String faceUri)
+    {
+      m_faceUri = faceUri;
+    }
+
+    @Override
+    protected String
+    doInBackground(Void... params)
+    {
+      try {
+        Nfdc nfdc = new Nfdc();
+        int faceId = nfdc.faceCreate(m_faceUri);
+        nfdc.shutdown();
+        return "OK. Face id: " + String.valueOf(faceId);
+      }
+      catch (FaceUri.CanonizeError e) {
+        return "Error creating face (" + e.getMessage() + ")";
+      }
+      catch (FaceUri.Error e) {
+        return "Error creating face (" + e.getMessage() + ")";
+      }
+      catch (Exception e) {
+        return "Error communicating with NFD (" + e.getMessage() + ")";
+      }
+    }
+
+    @Override
+    protected void onPreExecute()
+    {
+      // Display progress bar
+      m_reloadingListProgressBar.setVisibility(View.VISIBLE);
+    }
+
+    @Override
+    protected void onPostExecute(String status)
+    {
+      // Display progress bar
+      m_reloadingListProgressBar.setVisibility(View.VISIBLE);
+      Toast.makeText(getActivity(), status, Toast.LENGTH_LONG).show();
+
+      retrieveFaceList();
+    }
+
+    @Override
+    protected void onCancelled()
+    {
+      // Remove progress bar
+      m_reloadingListProgressBar.setVisibility(View.GONE);
+    }
+
+    ///////////////////////////////////////////////////////////////////////////
+
+    private String m_faceUri;
+  }
+  /////////////////////////////////////////////////////////////////////////
+
+  public interface Callbacks {
+    /**
+     * This method is called when a face is selected and more
+     * information about the face should be presented to the user.
+     *
+     * @param faceStatus FaceStatus instance with information about the face
+     */
+    public void onFaceItemSelected(FaceStatus faceStatus);
+  }
+
+  /////////////////////////////////////////////////////////////////////////
+
+  /** Reference to the most recent AsyncTask that was created for listing faces */
+  private FaceListAsyncTask m_faceListAsyncTask;
+
+  /** Callback handler of the hosting activity */
+  private Callbacks m_callbacks;
+
+  /** Reference to the most recent AsyncTask that was created for destroying faces */
+  private FaceDestroyAsyncTask m_faceDestroyAsyncTask;
+
+  /** Reference to the most recent AsyncTask that was created for creating a face */
+  private FaceCreateAsyncTask m_faceCreateAsyncTask;
+
+  /** Reference to the view to be displayed when no information is available */
+  private View m_faceListInfoUnavailableView;
+
+  /** Progress bar spinner to display to user when destroying faces */
+  private ProgressBar m_reloadingListProgressBar;
+}
diff --git a/app/src/main/java/net/named_data/nfd/FaceStatusFragment.java b/app/src/main/java/net/named_data/nfd/FaceStatusFragment.java
new file mode 100644
index 0000000..13aa367
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/FaceStatusFragment.java
@@ -0,0 +1,235 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.ListFragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.TextView;
+
+import com.intel.jndn.management.types.FacePersistency;
+import com.intel.jndn.management.types.FaceScope;
+import com.intel.jndn.management.types.FaceStatus;
+import com.intel.jndn.management.types.LinkType;
+
+import net.named_data.jndn.encoding.EncodingException;
+import net.named_data.jndn.util.Blob;
+import net.named_data.nfd.utils.G;
+
+import org.joda.time.Period;
+import org.joda.time.format.PeriodFormat;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FaceStatusFragment extends ListFragment {
+
+  /**
+   * Create a new instance of {@link net.named_data.nfd.FaceStatusFragment} with
+   * the given detail face information as a byte array object.
+   * 
+   * Note:
+   * faceStatus.wireEncode().getImmutableArray()
+   * This byte array should be retrieved via a call to:
+   * {@link com.intel.jndn.management.types.FaceStatus#wireEncode()} for a
+   * {@link net.named_data.jndn.util.Blob} object. Subsequently, an
+   * immutable byte array can be retrieved via
+   * {@link net.named_data.jndn.util.Blob#getImmutableArray()}.
+   * 
+   * @param faceStatus FaceStatus instance with information about the face
+   * @return Fragment instance of {@link net.named_data.nfd.FaceStatusFragment}
+   * that is ready for use by the hosting activity
+   */
+  public static FaceStatusFragment
+  newInstance(FaceStatus faceStatus) {
+    Bundle args = new Bundle();
+    args.putByteArray(EXTRA_FACE_INFORMATION, faceStatus.wireEncode().getImmutableArray());
+
+    FaceStatusFragment fragment = new FaceStatusFragment();
+    fragment.setArguments(args);
+
+    return fragment;
+  }
+
+  @Override
+  public void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    m_listItems = new ArrayList<>();
+
+    Resources res = getResources();
+    m_scopes = res.getStringArray(R.array.face_scopes);
+    m_linkTypes = res.getStringArray(R.array.face_link_types);
+    m_persistencies = res.getStringArray(R.array.face_persistency);
+
+    // Get face status information
+    FaceStatus faceStatus = new FaceStatus();
+    try {
+      byte [] args = getArguments().getByteArray(EXTRA_FACE_INFORMATION);
+      faceStatus.wireDecode(new Blob(args).buf());
+    } catch (EncodingException e) {
+      G.Log("EXTRA_FACE_INFORMATION: EncodingException: " + e);
+    }
+
+    // Creating list of items to be displayed
+    m_listItems.add(new ListItem("Face ID",          String.valueOf(faceStatus.getFaceId())));
+    m_listItems.add(new ListItem("Local FaceUri",    faceStatus.getLocalUri()));
+    m_listItems.add(new ListItem("Remote FaceUri",   faceStatus.getUri()));
+    m_listItems.add(new ListItem("Expires in",       faceStatus.getExpirationPeriod() < 0 ?
+        getString(R.string.expire_never):
+        PeriodFormat.getDefault().print(new Period(faceStatus.getExpirationPeriod()))));
+    m_listItems.add(new ListItem("Face scope",       getScope(faceStatus.getFaceScope())));
+    m_listItems.add(new ListItem("Face persistency", getPersistency(faceStatus.getFacePersistency())));
+    m_listItems.add(new ListItem("Link type",        getLinkType(faceStatus.getLinkType())));
+    m_listItems.add(new ListItem("In interests",     String.valueOf(faceStatus.getInInterests())));
+    m_listItems.add(new ListItem("In data",          String.valueOf(faceStatus.getInDatas())));
+    m_listItems.add(new ListItem("Out interests",    String.valueOf(faceStatus.getOutInterests())));
+    m_listItems.add(new ListItem("Out data",         String.valueOf(faceStatus.getOutDatas())));
+    m_listItems.add(new ListItem("In bytes",         String.valueOf(faceStatus.getInBytes())));
+    m_listItems.add(new ListItem("Out bytes",        String.valueOf(faceStatus.getOutBytes())));
+
+    m_faceStatusAdapter = new FaceStatusAdapter(getActivity(), m_listItems);
+    setListAdapter(m_faceStatusAdapter);
+  }
+
+  @SuppressLint("InflateParams")
+  @Override
+  public View onCreateView(LayoutInflater inflater,
+                           @Nullable ViewGroup container,
+                           @Nullable Bundle savedInstanceState)
+  {
+    return inflater.inflate(R.layout.fragment_face_detail, null);
+  }
+
+  /////////////////////////////////////////////////////////////////////////
+
+  private String
+  getScope(FaceScope scope)
+  {
+    return m_scopes[scope.getNumericValue()];
+  }
+
+  private String
+  getPersistency(FacePersistency persistency)
+  {
+    return m_persistencies[persistency.getNumericValue()];
+  }
+
+  private String
+  getLinkType(LinkType linkType)
+  {
+    return m_linkTypes[linkType.getNumericValue()];
+  }
+
+  /**
+   * Generic list item model for use in
+   * {@link net.named_data.nfd.FaceStatusFragment.FaceStatusAdapter}.
+   */
+  private static class ListItem {
+    public ListItem(String title, String value) {
+      m_title = title;
+      m_value = value;
+    }
+
+    public String getValue() {
+      return m_value;
+    }
+
+    public void setValue(String value) {
+      m_value = value;
+    }
+
+    public String getTitle() {
+      return m_title;
+    }
+
+    public void setTitle(String title) {
+      m_title = title;
+    }
+
+    private String m_title;
+    private String m_value;
+  }
+
+  /**
+   * Custom ListView adapter that displays face status information.
+   */
+  private static class FaceStatusAdapter extends ArrayAdapter<ListItem> {
+    private FaceStatusAdapter(Context context, List<ListItem> objects) {
+      super(context, 0, objects);
+      m_layoutInflater = LayoutInflater.from(context);
+    }
+
+    @SuppressLint("InflateParams")
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+      ListItemHolder holder;
+      if (convertView == null) {
+        holder = new ListItemHolder();
+
+        convertView = m_layoutInflater.inflate(R.layout.list_item_face_generic_item, null);
+        convertView.setTag(holder);
+
+        holder.m_title = (TextView)convertView.findViewById(R.id.list_item_generic_title);
+        holder.m_value = (TextView)convertView.findViewById(R.id.list_item_generic_value);
+      } else {
+        holder = (ListItemHolder)convertView.getTag();
+      }
+
+      ListItem info = getItem(position);
+      holder.m_title.setText(info.getTitle());
+      holder.m_value.setText(info.getValue());
+
+      return convertView;
+    }
+
+    private static class ListItemHolder {
+      private TextView m_title;
+      private TextView m_value;
+    }
+
+    private final LayoutInflater m_layoutInflater;
+  }
+
+  /////////////////////////////////////////////////////////////////////////
+
+  /** Bundle argument key for face information byte array */
+  private static final String EXTRA_FACE_INFORMATION
+      = "net.named_data.nfd.face_detail_fragment_face_id";
+
+  /**
+   * List items to be displayed; Used when creating
+   * {@link net.named_data.nfd.FaceStatusFragment.FaceStatusAdapter}
+   */
+  private ArrayList<ListItem> m_listItems;
+
+  /** Reference to custom {@link net.named_data.nfd.FaceStatusFragment.FaceStatusAdapter} */
+  private FaceStatusAdapter m_faceStatusAdapter;
+
+  private String[] m_scopes;
+  private String[] m_persistencies;
+  private String[] m_linkTypes;
+}
diff --git a/app/src/main/java/net/named_data/nfd/LogcatActivity.java b/app/src/main/java/net/named_data/nfd/LogcatFragment.java
similarity index 66%
rename from app/src/main/java/net/named_data/nfd/LogcatActivity.java
rename to app/src/main/java/net/named_data/nfd/LogcatFragment.java
index de5b039..ed4b1e8 100644
--- a/app/src/main/java/net/named_data/nfd/LogcatActivity.java
+++ b/app/src/main/java/net/named_data/nfd/LogcatFragment.java
@@ -19,11 +19,14 @@
 
 package net.named_data.nfd;
 
-import android.content.Intent;
+import android.annotation.SuppressLint;
+import android.app.Activity;
 import android.os.Bundle;
-import android.support.v7.app.ActionBarActivity;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
 import android.view.LayoutInflater;
 import android.view.Menu;
+import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
@@ -32,7 +35,6 @@
 import android.widget.TextView;
 
 import net.named_data.nfd.utils.G;
-import net.named_data.nfd.utils.LogcatTags;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -40,55 +42,91 @@
 import java.util.ArrayList;
 
 /**
- * Display of NfdService's logcat output for easy debugging
+ * Logcat fragment that houses the output of LogCat in a ListView for viewing.
+ *
+ * The ListView is backed by a {@link net.named_data.nfd.LogcatFragment.LogListAdapter}
+ * that that limits the number of logs that are being displayed to the user. This
+ * prevents the ListView from growing indeterminately. This maximum number of
+ * log lines that is allowed to be displayed is set by
+ * {@link net.named_data.nfd.LogcatFragment#s_logMaxLines}.
+ *
  */
-public class LogcatActivity extends ActionBarActivity {
+public class LogcatFragment extends Fragment {
+
+  public static Fragment newInstance() {
+    return new LogcatFragment();
+  }
 
   @Override
-  public boolean onCreateOptionsMenu(Menu menu) {
-    getMenuInflater().inflate(R.menu.menu_log, menu);
-    return true;
+  public void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    setHasOptionsMenu(true);
+  }
+
+  @Override
+  public View onCreateView(LayoutInflater inflater,
+                           @Nullable ViewGroup container,
+                           @Nullable Bundle savedInstanceState) {
+    @SuppressLint("InflateParams")
+    View v = inflater.inflate(R.layout.fragment_logcat_output, null);
+
+    // Get UI Elements
+    m_logListView = (ListView) v.findViewById(R.id.log_output);
+    m_logListAdapter = new LogListAdapter(inflater, s_logMaxLines);
+    m_logListView.setAdapter(m_logListAdapter);
+
+    return v;
+  }
+
+  @Override
+  public void onResume() {
+    super.onResume();
+    startLogging();
+    G.Log("LogcatFragment(): onResume()");
+  }
+
+  @Override
+  public void onPause() {
+    super.onPause();
+    stopLogging();
+    G.Log("LogcatFragment(): onPause()");
+  }
+
+  @Override
+  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+    super.onCreateOptionsMenu(menu, inflater);
+    inflater.inflate(R.menu.menu_log, menu);
   }
 
   @Override
   public boolean onOptionsItemSelected(MenuItem item) {
     switch (item.getItemId()) {
-    case R.id.action_log_settings:
-      startActivity(new Intent(this, LogcatSettingsActivity.class));
-      return true;
-    default:
-      return super.onOptionsItemSelected(item);
+      case R.id.action_log_settings:
+        m_callbacks.onDisplayLogcatSettings();
+        return true;
+      default:
+        return super.onOptionsItemSelected(item);
     }
   }
 
   @Override
-  protected void onCreate(Bundle savedInstanceState) {
-    super.onCreate(savedInstanceState);
-    setContentView(R.layout.activity_log);
-
-    // Get UI Elements
-    m_logListView = (ListView) findViewById(R.id.log_output);
-    m_logListAdapter = new LogListAdapter(getLayoutInflater(), s_logMaxLines);
-    m_logListView.setAdapter(m_logListAdapter);
+  public void onAttach(Activity activity) {
+    super.onAttach(activity);
+    try {
+      m_callbacks = (Callbacks) activity;
+    } catch (ClassCastException e) {
+      G.Log("Hosting activity must implement callback.");
+      throw e;
+    }
   }
 
   @Override
-  protected void onResume() {
-    super.onResume();
-    startLogging();
+  public void onDetach() {
+    super.onDetach();
+    m_callbacks = null;
   }
 
-  @Override
-  protected void onPause() {
-    super.onPause();
-    stopLogging();
-  }
-
-  @Override
-  protected void onDestroy() {
-    super.onDestroy();
-    G.Log("LogActivity::onDestroy()");
-  }
+  //////////////////////////////////////////////////////////////////////////////
 
   /**
    * Starts logging by spawning a new thread to capture logs.
@@ -97,7 +135,7 @@
     // Clear output, update UI and get tag arguments
     clearLogOutput();
     appendLogText(getString(R.string.loading_logger));
-    m_tagArguments = LogcatTags.getTags(this);
+    m_tagArguments = LogcatSettingsManager.get(getActivity()).getTags();
 
     new Thread(){
       @Override
@@ -149,19 +187,19 @@
        */
       // Build command for execution
       String cmd = String.format("%s -v time %s *:S",
-        "logcat",
-        m_tagArguments);
+          "logcat",
+          m_tagArguments);
 
       G.Log("LogCat Command: " + cmd);
 
       m_logProcess =  Runtime.getRuntime().exec(cmd);
       BufferedReader in = new BufferedReader(
-        new InputStreamReader(m_logProcess.getInputStream()));
+          new InputStreamReader(m_logProcess.getInputStream()));
 
       String line;
       while ((line = in.readLine()) != null) {
         final String message = line;
-        runOnUiThread(new Runnable() {
+        getActivity().runOnUiThread(new Runnable() {
           @Override
           public void run() {
             appendLogText(message);
@@ -171,13 +209,13 @@
 
       // Wait for process to join this thread
       m_logProcess.waitFor();
-    } catch (IOException e) {
-      G.Log("captureLog(): " + e);
-    } catch (InterruptedException e) {
+    } catch (IOException | InterruptedException e) {
       G.Log("captureLog(): " + e);
     }
   }
 
+  //////////////////////////////////////////////////////////////////////////////
+
   /**
    * Custom LogListAdapter to limit the number of log lines that
    * is being stored and displayed.
@@ -193,7 +231,7 @@
      *                 the ListView for this adapter.
      */
     public LogListAdapter(LayoutInflater layoutInflater, int maxLines) {
-      m_data = new ArrayList<String>();
+      m_data = new ArrayList<>();
       m_layoutInflater = layoutInflater;
       m_maxLines = maxLines;
     }
@@ -237,6 +275,7 @@
       return position;
     }
 
+    @SuppressLint("InflateParams")
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
       LogEntryViewHolder holder;
@@ -244,7 +283,7 @@
       if (convertView == null) {
         holder = new LogEntryViewHolder();
 
-        convertView = m_layoutInflater.inflate(R.layout.log_item, null);
+        convertView = m_layoutInflater.inflate(R.layout.list_item_log, null);
         convertView.setTag(holder);
 
         holder.logLineTextView = (TextView) convertView.findViewById(R.id.log_line);
@@ -257,13 +296,13 @@
     }
 
     /** Underlying message data store for log messages*/
-    private ArrayList<String> m_data;
+    private final ArrayList<String> m_data;
 
     /** Layout inflater for inflating views */
-    private LayoutInflater m_layoutInflater;
+    private final LayoutInflater m_layoutInflater;
 
     /** Maximum number of log lines to display */
-    private int m_maxLines;
+    private final int m_maxLines;
   }
 
   /**
@@ -273,7 +312,15 @@
     public TextView logLineTextView;
   }
 
-  /** Maximum number of log lines to be displayed */
+  //////////////////////////////////////////////////////////////////////////////
+
+  public interface Callbacks {
+    void onDisplayLogcatSettings();
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /** Maximum number of log lines to be displayed by the backing adapter of the ListView */
   private static final int s_logMaxLines = 380;
 
   /** Process in which logcat is running in */
@@ -287,4 +334,7 @@
 
   /** Tag argument to logcat */
   private String m_tagArguments;
+
+  /** Callback reference to hosting activity */
+  private Callbacks m_callbacks;
 }
diff --git a/app/src/main/java/net/named_data/nfd/LogcatSettingItem.java b/app/src/main/java/net/named_data/nfd/LogcatSettingItem.java
new file mode 100644
index 0000000..d5a3fff
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/LogcatSettingItem.java
@@ -0,0 +1,61 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+/**
+ * Logcat setting item that contains information about the tag name
+ * in the m_logTag field and log level in the m_logLevel field.
+ */
+public class LogcatSettingItem {
+
+  public LogcatSettingItem(String logTag, String logLevel) {
+    m_logTag = logTag;
+    m_logLevel = logLevel;
+  }
+
+  public String getLogTag() {
+    return m_logTag;
+  }
+
+  public void setLogTag(String logTag) {
+    m_logTag = logTag;
+  }
+
+  public String getLogLevel() {
+    return m_logLevel;
+  }
+
+  public void setLogLevel(String logLevel) {
+    m_logLevel = logLevel;
+  }
+
+  @Override
+  public String toString() {
+    return String.format("%s: %s", m_logTag, m_logLevel);
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /** Log tag that logcat should monitor */
+  private String m_logTag;
+
+  /** Log level (aka priority level) that logcat should use for this log tag */
+  private String m_logLevel;
+}
diff --git a/app/src/main/java/net/named_data/nfd/LogcatSettingsActivity.java b/app/src/main/java/net/named_data/nfd/LogcatSettingsActivity.java
deleted file mode 100644
index b8b0f13..0000000
--- a/app/src/main/java/net/named_data/nfd/LogcatSettingsActivity.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
- * See AUTHORS.md for complete list of NFD Android authors and contributors.
- *
- * NFD Android is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.named_data.nfd;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.preference.PreferenceFragment;
-import android.preference.PreferenceGroup;
-import android.preference.PreferenceManager;
-import android.preference.PreferenceScreen;
-
-import net.named_data.nfd.utils.LogcatTags;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class LogcatSettingsActivity extends Activity {
-
-  @Override
-  protected void onCreate(Bundle savedInstanceState) {
-    super.onCreate(savedInstanceState);
-
-    getFragmentManager().
-        beginTransaction().
-        replace(android.R.id.content, new NfdLogSettingsFragment()).
-        commit();
-  }
-
-  public static class NfdLogSettingsFragment extends PreferenceFragment {
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-      super.onCreate(savedInstanceState);
-
-      // Load the preferences from an XML resource
-      addPreferencesFromResource(R.xml.pref_nfd_log);
-
-      PreferenceScreen preferenceScreen = getPreferenceScreen();
-
-      //// NOTE: This section of code demonstrates how a preference can
-      //// be added programmatically.
-      ////
-      // Creating and inserting a preference programmatically
-      // Preference customPreference = preferenceScreen.
-      //     findPreference(getString(R.string.pref_category_title_tags_key));
-      // if (customPreference instanceof PreferenceCategory) {
-      //   ListPreference listPreference = new ListPreference(getActivity());
-      //   listPreference.setKey("NFDTest_Key");
-      //   listPreference.setTitle("NFDTest");
-      //   listPreference.setDefaultValue("I");
-      //   listPreference.setNegativeButtonText(null);
-      //   listPreference.setDialogTitle("NFDTest");
-
-      //   String [] keys = getResources().getStringArray(R.array.pref_log_levels);
-      //   String [] values = getResources().getStringArray(R.array.pref_log_level_values);
-
-      //   listPreference.setEntries(keys);
-      //   listPreference.setEntryValues(values);
-
-      //   ((PreferenceCategory) customPreference).addPreference(listPreference);
-      // }
-
-      // Collect all Preference in the hierarchy
-      m_tagListPreferences = new ArrayList<ListPreference>();
-      extractPreferences(m_tagListPreferences,
-          (PreferenceGroup) preferenceScreen.
-              findPreference(getString(R.string.pref_category_title_tags_key)));
-
-      // Set all preference setting
-      m_resetPreference = preferenceScreen.
-          findPreference(getString(R.string.pref_tags_log_level_key));
-    }
-
-    @Override
-    public void onResume() {
-      super.onResume();
-      registerListeners();
-    }
-
-    @Override
-    public void onPause() {
-      super.onPause();
-      unregisterPreferenceListeners();
-      saveTagArguments();
-    }
-
-    /**
-     * Convenience method to register preference listeners.
-     */
-    private void registerListeners() {
-      for (Preference p : m_tagListPreferences) {
-        if (p instanceof ListPreference) {
-          registerPreferenceListener(p);
-        }
-      }
-
-      m_resetPreference.setOnPreferenceChangeListener(m_setAllPreferenceChangeListener);
-    }
-
-    /**
-     * Convenience method to unregister preference listeners.
-     */
-    private void unregisterPreferenceListeners() {
-      for (Preference p : m_tagListPreferences) {
-        if (p instanceof ListPreference) {
-          unregisterPreferenceListener(p);
-        }
-      }
-
-      m_resetPreference.setOnPreferenceChangeListener(null);
-    }
-
-    /**
-     * Register preference listener and fire an update.
-     *
-     * @param preference Preference to register listener.
-     */
-    private void registerPreferenceListener(Preference preference) {
-      // Attach listener
-      preference.setOnPreferenceChangeListener(m_tagPreferenceChangeListener);
-
-      // Trigger update
-      m_tagPreferenceChangeListener.onPreferenceChange(preference,
-          PreferenceManager.
-              getDefaultSharedPreferences(preference.getContext()).
-              getString(preference.getKey(), ""));
-    }
-
-    /**
-     * Unregister preference listener for the given preference.
-     *
-     * @param preference Preference to unregister listener.
-     */
-    private void unregisterPreferenceListener(Preference preference) {
-      // Remove listener
-      preference.setOnPreferenceChangeListener(null);
-    }
-
-    /**
-     * Convenience method that extracts all list preferences within a hierarchy
-     * recursively.
-     *
-     * @param list List to add preference to
-     * @param preferenceGroup Root preference group to begin search from
-     */
-    private void extractPreferences(List<ListPreference> list, PreferenceGroup preferenceGroup) {
-      for (int i = 0; i < preferenceGroup.getPreferenceCount(); i++) {
-        final Preference preference = preferenceGroup.getPreference(i);
-
-        if (preference instanceof ListPreference) {
-          list.add((ListPreference) preference);
-        } else if (preference instanceof PreferenceGroup) {
-          extractPreferences(list, (PreferenceGroup) preference);
-        }
-      }
-    }
-
-    /**
-     * Save tag arguments for quick retrieval.
-     */
-    private void saveTagArguments() {
-      LogcatTags.TagBuilder tagBuilder = LogcatTags.TagBuilder.getTagBuilder();
-
-      for (Preference p : m_tagListPreferences) {
-        if (p instanceof ListPreference) {
-          ListPreference listPreference = (ListPreference) p;
-          tagBuilder.addTag(listPreference.getTitle(), listPreference.getValue());
-        }
-      }
-
-      LogcatTags.saveTags(getActivity(), tagBuilder.generateTagString());
-    }
-
-    /**
-     * Convenience method to change all tags' log level to the
-     * given logLevel.
-     *
-     * @param logLevel Target log level to set to.
-     */
-    private void setAllTagPreferences(String logLevel) {
-      for (ListPreference preference : m_tagListPreferences) {
-        preference.setValue(logLevel);
-        m_tagPreferenceChangeListener.onPreferenceChange(preference, logLevel);
-      }
-    }
-
-    /** List of preferences for registering handlers */
-    private List<ListPreference> m_tagListPreferences;
-
-    /** Reset log level preference */
-    private Preference m_resetPreference;
-
-    /**
-     * Change listener that updates the summary text of the tag preferences.
-     */
-    private Preference.OnPreferenceChangeListener m_tagPreferenceChangeListener
-        = new Preference.OnPreferenceChangeListener() {
-      @Override
-      public boolean onPreferenceChange(Preference preference, Object value) {
-        // Get value of preference setting as a String
-        String displayString = value.toString();
-
-        // Deal with ListPreference
-        if (preference instanceof ListPreference) {
-          // Get display value
-          ListPreference listPreference = (ListPreference) preference;
-          int offset = listPreference.findIndexOfValue(displayString);
-          displayString = (offset != -1) ?
-              (String) listPreference.getEntries()[offset] :
-              null;
-        }
-
-        // Update UI
-        preference.setSummary(displayString);
-        return true;
-      }
-    };
-
-    /**
-     * Change listener that resets all preference tags' log levels.
-     */
-    private Preference.OnPreferenceChangeListener m_setAllPreferenceChangeListener
-        = new Preference.OnPreferenceChangeListener() {
-      @Override
-      public boolean onPreferenceChange(Preference preference, Object value) {
-        setAllTagPreferences(value.toString());
-        return true;
-      }
-    };
-  }
-}
diff --git a/app/src/main/java/net/named_data/nfd/LogcatSettingsFragment.java b/app/src/main/java/net/named_data/nfd/LogcatSettingsFragment.java
new file mode 100644
index 0000000..805a568
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/LogcatSettingsFragment.java
@@ -0,0 +1,341 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.v4.app.DialogFragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.ListFragment;
+import android.view.ActionMode;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AbsListView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+public class LogcatSettingsFragment extends ListFragment {
+
+  public static LogcatSettingsFragment newInstance() {
+    return new LogcatSettingsFragment();
+  }
+
+  @Override
+  public void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+
+    m_logcatSettingsManager = LogcatSettingsManager.get(getActivity());
+    m_logcatSettingItems = m_logcatSettingsManager.getLogcatSettingItems();
+
+    ArrayAdapter<LogcatSettingItem> adapter
+        = new LogcatSettingsAdapter(getActivity(), m_logcatSettingItems);
+
+    setListAdapter(adapter);
+    setRetainInstance(true);
+  }
+
+  @Override
+  public View onCreateView(LayoutInflater inflater,
+                           ViewGroup container,
+                           Bundle savedInstanceState) {
+    @SuppressLint("InflateParams")
+    View v = inflater.inflate(R.layout.fragment_logcat_tags_list, null);
+
+    // Set resetLogLevelButton listener
+    Button resetLogLevelButton = (Button) v.findViewById(R.id.logcat_reset_loglevel_defaults);
+    resetLogLevelButton.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View v) {
+        FragmentManager fm = getActivity().getSupportFragmentManager();
+        ResetLogLevelDialog dialog
+            = ResetLogLevelDialog.newInstance(getString(R.string.reset_log_level_dialog_title));
+        dialog.setTargetFragment(LogcatSettingsFragment.this, REQUEST_CODE_DIALOG_RESET_ALL_LOG_LEVELS);
+        dialog.show(fm, DIALOG_RESET_ALL_LOG_LEVELS_TAG);
+      }
+    });
+
+    // Register context listener
+    ListView listView = (ListView) v.findViewById(android.R.id.list);
+    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL);
+    listView.setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() {
+      @Override
+      public void onItemCheckedStateChanged(ActionMode mode,
+                                            int position,
+                                            long id,
+                                            boolean checked)
+      {
+        // Nothing to do here
+      }
+
+      @Override
+      public boolean onCreateActionMode(ActionMode mode, Menu menu) {
+        MenuInflater inflater = mode.getMenuInflater();
+        inflater.inflate(R.menu.menu_logcat_settings_multiple_modal_menu, menu);
+        return true;
+      }
+
+      @Override
+      public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
+        return false;
+      }
+
+      @Override
+      public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+        switch (item.getItemId()) {
+          case R.id.menu_item_delete_setting_item:
+            // TODO: Delete log item tag
+            return true;
+          default:
+            return false;
+        }
+      }
+
+      @Override
+      public void onDestroyActionMode(ActionMode mode) {
+        // Nothing to do here
+      }
+    });
+
+    return v;
+  }
+
+  @Override
+  public void onListItemClick(ListView l, View v, int position, long id) {
+    final String logTag = m_logcatSettingItems.get(position).getLogTag();
+
+    final FragmentManager fm = getActivity().getSupportFragmentManager();
+    final ResetLogLevelDialog dialog = ResetLogLevelDialog.newInstance(logTag, position);
+
+    dialog.setTargetFragment(LogcatSettingsFragment.this, REQUEST_CODE_DIALOG_SET_LOG_LEVEL);
+    dialog.show(fm, DIALOG_SET_LOG_LEVEL_TAG);
+  }
+
+  @Override
+  public void onActivityResult(int requestCode, int resultCode, Intent data) {
+    if (resultCode != Activity.RESULT_OK) {
+      return;
+    }
+
+    String newLogLevel;
+    switch (requestCode) {
+    case REQUEST_CODE_DIALOG_RESET_ALL_LOG_LEVELS:
+      newLogLevel = data.getStringExtra(ResetLogLevelDialog.EXTRA_RESET_LOG_LEVEL_VALUE);
+
+      // Update settings
+      for (LogcatSettingItem item : m_logcatSettingItems) {
+        item.setLogLevel(newLogLevel);
+      }
+
+      // Update UI
+      updateListUI();
+
+      // Save setting items
+      m_logcatSettingsManager.saveSettingItems();
+      break;
+    case REQUEST_CODE_DIALOG_SET_LOG_LEVEL:
+      newLogLevel = data.getStringExtra(ResetLogLevelDialog.EXTRA_RESET_LOG_LEVEL_VALUE);
+      final int listPosition
+          = data.getIntExtra(ResetLogLevelDialog.EXTRA_LOG_ITEM_LIST_POSITION, -1);
+
+      if (listPosition != -1) {
+        m_logcatSettingItems.get(listPosition).setLogLevel(newLogLevel);
+
+        // Update UI
+        updateListUI();
+
+        // Save setting items
+        m_logcatSettingsManager.saveSettingItems();
+      }
+      break;
+    }
+  }
+
+  /**
+   * Convenience method that updates the UI by notifying the backing list adapter
+   * that changes has been made to the underlying data set.
+   */
+  private void updateListUI() {
+    ((LogcatSettingsAdapter) getListAdapter()).notifyDataSetChanged();
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /**
+   * Adapter for use by thi ListFragment that display a list of LogcatSettingItem.
+   */
+  private static class LogcatSettingsAdapter extends ArrayAdapter<LogcatSettingItem> {
+
+    public LogcatSettingsAdapter(Context context, ArrayList<LogcatSettingItem> objects) {
+      super(context, 0, objects);
+      m_layoutInflater = LayoutInflater.from(context);
+    }
+
+    @SuppressLint("InflateParams")
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+      SettingItemHolder holder;
+
+      if (convertView == null) {
+        holder = new SettingItemHolder();
+
+        convertView = m_layoutInflater.inflate(R.layout.list_item_setting_item, null);
+        convertView.setTag(holder);
+
+        holder.m_logTag = (TextView) convertView.findViewById(R.id.list_item_log_tag);
+        holder.m_logLevel = (TextView) convertView.findViewById(R.id.list_item_setting_log_level);
+      } else {
+        holder = (SettingItemHolder) convertView.getTag();
+      }
+
+      LogcatSettingItem item = getItem(position);
+      holder.m_logTag.setText(item.getLogTag());
+      holder.m_logLevel.setText(item.getLogLevel());
+
+      return convertView;
+    }
+
+    private static class SettingItemHolder {
+      private TextView m_logTag;
+      private TextView m_logLevel;
+    }
+
+    private final LayoutInflater m_layoutInflater;
+  }
+
+  /**
+   * Convenient dialog fragment that prompts for the log level value
+   * to reset all tags to.
+   */
+  public static class ResetLogLevelDialog extends DialogFragment {
+
+    public static ResetLogLevelDialog newInstance(String dialogTitle) {
+      return newInstance(dialogTitle, -1);
+    }
+
+    public static ResetLogLevelDialog newInstance(String dialogTitle, int listPosition) {
+      final Bundle args = new Bundle();
+      args.putSerializable(BUNDLE_KEY_DIALOG_TITLE, dialogTitle);
+
+      if (listPosition != -1) {
+        args.putSerializable(BUNDLE_KEY_DIALOG_LIST_POSITION, listPosition);
+      }
+
+      final ResetLogLevelDialog fragment = new ResetLogLevelDialog();
+      fragment.setArguments(args);
+
+      return fragment;
+    }
+
+    @NonNull
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+      final String [] logLevelValues
+          = getResources().getStringArray(R.array.reset_log_level_values);
+
+      final String dialogTitle = getArguments().getString(BUNDLE_KEY_DIALOG_TITLE);
+
+      return new AlertDialog.Builder(getActivity())
+                            .setTitle(dialogTitle)
+                            .setItems(
+                                logLevelValues,
+                                new DialogInterface.OnClickListener() {
+                                  @Override
+                                  public void onClick(DialogInterface dialog, int which) {
+                                    sendResult(Activity.RESULT_OK, logLevelValues[which]);
+                                  }
+                                })
+                            .create();
+    }
+
+    /**
+     * Convenient method to send data back to the fragment that presents this
+     * dialog.
+     *
+     * @param resultCode Result code to be passed back
+     * @param logLevelValue Log level value to be passed back
+     */
+    private void sendResult(int resultCode, String logLevelValue) {
+      if (getTargetFragment() == null) {
+        return;
+      }
+
+      // Create intent
+      Intent intent = new Intent();
+      intent.putExtra(EXTRA_RESET_LOG_LEVEL_VALUE, logLevelValue);
+
+      // Fill item position if present
+      final int logItemPosition = getArguments().getInt(BUNDLE_KEY_DIALOG_LIST_POSITION, -1);
+      if (logItemPosition != -1) {
+        intent.putExtra(EXTRA_LOG_ITEM_LIST_POSITION, logItemPosition);
+      }
+
+      // Send results
+      getTargetFragment().onActivityResult(getTargetRequestCode(), resultCode, intent);
+    }
+
+    /** Unique extra name to be used */
+    public static final String EXTRA_RESET_LOG_LEVEL_VALUE
+        = "net.named_data.nfd.reset_log_level_value";
+
+    public static final String EXTRA_LOG_ITEM_LIST_POSITION
+        = "net.named_data.nfd.log_item_list_position";
+
+    private static final String BUNDLE_KEY_DIALOG_TITLE
+        = "BUNDLE_KEY_DIALOG_TITLE";
+
+    private static final String BUNDLE_KEY_DIALOG_LIST_POSITION
+        = "BUNDLE_KEY_DIALOG_LIST_POSITION";
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /** Array list that contains all the tags that are logged */
+  private ArrayList<LogcatSettingItem> m_logcatSettingItems;
+
+  /** Reference to the currently used LogcatSettingsManager */
+  private LogcatSettingsManager m_logcatSettingsManager;
+
+  /** Request code for dialog that gets the new log level for all tags */
+  private static final int REQUEST_CODE_DIALOG_RESET_ALL_LOG_LEVELS = 1;
+
+  /** Request code for dialog that gets the new log level for a single tag */
+  private static final int REQUEST_CODE_DIALOG_SET_LOG_LEVEL = 2;
+
+  /** Unique tag that identifies dialog fragment in the fragment manager */
+  private static final String DIALOG_RESET_ALL_LOG_LEVELS_TAG = "ResetAllLogLevelDialog";
+
+  /** Unique tag that identifies dialog fragment in the fragment manager */
+  private static final String DIALOG_SET_LOG_LEVEL_TAG = "SetLogLevelDialog";
+}
diff --git a/app/src/main/java/net/named_data/nfd/LogcatSettingsManager.java b/app/src/main/java/net/named_data/nfd/LogcatSettingsManager.java
new file mode 100644
index 0000000..e6bffcb
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/LogcatSettingsManager.java
@@ -0,0 +1,391 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.content.Context;
+import android.text.TextUtils;
+
+import net.named_data.nfd.utils.G;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Manager that controls the loading and saving of tags that are being logged.
+ */
+public class LogcatSettingsManager {
+
+  private LogcatSettingsManager(Context context) {
+    m_context = context;
+    m_logcatSettingItems = new ArrayList<>();
+    m_logLevelMap = new HashMap<>();
+    m_logcatTagsJSONSerializer = new LogcatTagsJSONSerializer(context, NFD_LOGCAT_TAGS_FILENAME);
+
+    // Populate log level map
+    loadLogLevelMap();
+
+    // Check if previous tags setting exists; otherwise load defaults
+    if (m_logcatTagsJSONSerializer.logcatTagsFileExists()) {
+      loadSettingItems();
+    } else {
+      loadDefaultSettingItems();
+    }
+
+    // Save setting items to file
+    saveSettingItems();
+
+    // Sort log tag name lexicographically
+    Collections.sort(m_logcatSettingItems, new Comparator<LogcatSettingItem>() {
+      @Override
+      public int compare(LogcatSettingItem lhs, LogcatSettingItem rhs) {
+        return lhs.getLogTag().compareTo(rhs.getLogTag());
+      }
+    });
+  }
+
+  /**
+   * Gets the singleton logcat settings manager.
+   *
+   * @param context Current application context
+   * @return The singleton settings manager
+   */
+  public static LogcatSettingsManager get(Context context) {
+    if (s_logcatSettingsManager == null) {
+      s_logcatSettingsManager = new LogcatSettingsManager(context.getApplicationContext());
+    }
+    return s_logcatSettingsManager;
+  }
+
+  /**
+   * Return the current working copy of setting items that are managed by the
+   * settings manager.
+   *
+   * @return Current setting items that are loaded
+   */
+  public ArrayList<LogcatSettingItem> getLogcatSettingItems() {
+    return m_logcatSettingItems;
+  }
+
+  /**
+   * Generate a string representing all the tags to be filtered by logcat
+   * and the relevant log levels.
+   *
+   * An example of a string returned by this method is:
+   *
+   * <pre>
+   *    NFDService:S Strategy:S TcpChannel:S TcpFactory:S TcpLocalFace:S UdpFactory:S *:S
+   * </pre>
+   *
+   * @return String representation of the tags and their relevant log levels to be
+   * filtered.
+   */
+  public String getTags() {
+    ArrayList<String> arr = new ArrayList<>();
+    for (LogcatSettingItem item : m_logcatSettingItems) {
+      arr.add(String.format("%s:%s", item.getLogTag(), getPriorityName(item.getLogLevel())));
+    }
+
+    // Sort and silence everything else by default
+    Collections.sort(arr);
+    arr.add("*:S");
+
+    return TextUtils.join(" ", arr);
+  }
+
+  /**
+   * Convenience method that saves all tags present in m_logcatSettingItems
+   * to the persistent JSON storage file.
+   */
+  public void saveSettingItems() {
+    // Create tags map
+    Map<CharSequence, CharSequence> map = new HashMap<>();
+    for (LogcatSettingItem item : m_logcatSettingItems) {
+      map.put(item.getLogTag(), getPriorityName(item.getLogLevel()));
+    }
+
+    // Save tags
+    try {
+      m_logcatTagsJSONSerializer.saveTags(map);
+    } catch (IOException e) {
+      G.Log("saveSettingItems(): Error: " + e);
+    }
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /**
+   * Convenience method that loads all possible log level priority values as
+   * specified by the string array: R.array.logcat_log_level_map.
+   */
+  private void loadLogLevelMap() {
+    for (String item : m_context.getResources().getStringArray(R.array.logcat_log_level_map)) {
+      String [] arr = item.split(":");
+      m_logLevelMap.put(arr[0], arr[1]);
+    }
+  }
+
+  /**
+   * Convenience method that loads default values for tags and log levels that
+   * should be used. This method should be invoked when the application does not
+   * have previous JSON state information of the tags and log levels.
+   */
+  private void loadDefaultSettingItems() {
+    String [] defaults
+        = m_context.getResources().getStringArray(R.array.default_log_tags_and_levels);
+    for (String item : defaults) {
+      String [] arr = item.split(":");
+      m_logcatSettingItems.add(new LogcatSettingItem(arr[0], getVerbosePriorityName(arr[1])));
+    }
+  }
+
+  /**
+   * Convenience method that loads all tags that were previously stored and recorded. This
+   * method populates m_logcatSettingItems for use in a ListView to present all loaded tags and
+   * their relevant log levels.
+   */
+  private void loadSettingItems() {
+    Map<CharSequence, CharSequence> map;
+
+    try {
+      map = m_logcatTagsJSONSerializer.loadTags();
+
+      for (Map.Entry<CharSequence, CharSequence> entry : map.entrySet()) {
+        m_logcatSettingItems
+            .add(new LogcatSettingItem(entry.getKey().toString(),
+                getVerbosePriorityName(entry.getValue().toString())));
+      }
+    } catch (IOException | NullPointerException e) {
+      G.Log("loadSettingItems(): Error in loading tags from file: " + e);
+    }
+  }
+
+  /**
+   * Convenience method to get the verbose priority name. For instance, if
+   * "V" were passed in, the returned string would be "Verbose". This is
+   * dependent on the data that is loaded into m_logLevelMap.
+   *
+   * @param priority Short form priority name, e.g. "V"
+   * @return Verbose priority name, e.g. "Verbose" for a priority argument of "V"
+   */
+  private String getVerbosePriorityName(String priority) {
+    for (Map.Entry<CharSequence, CharSequence> item : m_logLevelMap.entrySet()) {
+      if (item.getValue().equals(priority)) {
+        return item.getKey().toString();
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Convenience method that gets the priority name from the verbose name. For instance,
+   * if "Verbose" were passed in, the returned string would be "V". This is
+   * dependent on the data that is loaded into m_logLevelMap.
+   *
+   * @param priorityVerboseName Verbose priority name, e.g. "Verbose"
+   * @return Short form priority name, e.g. "V"
+   */
+  private String getPriorityName(String priorityVerboseName) {
+    return m_logLevelMap.get(priorityVerboseName).toString();
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /**
+   * JSON Serializer used to store JSON Tags and relevant settings to
+   * a local file. The JSON file format that this serializer stores
+   * in the private file is as such:
+   *
+   * <pre>
+   *   [
+   *     {
+   *       "TcpFactory": "V",
+   *       "CommandValidator": "V",
+   *       "RibManager": "V",
+   *       "Strategy": "V",
+   *       "FaceTable": "V",
+   *       "FibManager": "V",
+   *       "FaceManager": "V",
+   *       "PrivilegeHelper": "V",
+   *       "ManagerBase": "V",
+   *       "TcpChannel": "V",
+   *       "InternalFace": "V",
+   *       "TcpLocalFace": "V",
+   *       "RemoteRegistrator": "V",
+   *       "GeneralConfigSection": "V",
+   *       "UdpFactory": "V",
+   *       "StrategyChoice": "V",
+   *       "TablesConfigSection": "V"
+   *     }
+   *   ]
+   * </pre>
+   *
+   * Each line represents a log tag that is to be monitored as well as the
+   * log level to be monitored (aka priority level of log cat). Tags can be any
+   * tag for the logger to filter.
+   *
+   * The log level should be one of the following form:
+   *
+   * <pre>
+   *     Log Level | Meaning
+   *     ===================
+   *       V       : Verbose
+   *       D       : Debug
+   *       I       : Info
+   *       W       : Warning
+   *       E       : Error
+   *       F       : Fatal
+   *       S       : Silent
+   * </pre>
+   *
+   */
+  private static class LogcatTagsJSONSerializer {
+
+    public LogcatTagsJSONSerializer(Context context, String filename) {
+      m_context = context;
+      m_filename = filename;
+    }
+
+    /**
+     * Convenience method to save all tags and their respective log levels from the
+     * given map. The map should contain key-value pairs of the following format:
+     *
+     * <pre>
+     *   "TagName": "V"
+     * </pre>
+     *
+     * @param map Map to be converted saved as a JSON file
+     * @throws IOException
+     */
+    public void saveTags(Map<CharSequence, CharSequence> map) throws IOException {
+      // Create JSON Array
+      JSONArray array = new JSONArray().put(new JSONObject(map));
+
+      BufferedWriter writer = null;
+      try {
+        OutputStream out = m_context.openFileOutput(m_filename, Context.MODE_PRIVATE);
+        writer = new BufferedWriter(new OutputStreamWriter(out));
+        writer.write(array.toString());
+      } catch (IOException e) {
+        G.Log(String.format("saveTags(): Error while writing to file: %s - %s",
+            m_filename, e));
+      } finally {
+        if (writer != null) {
+          writer.close();
+        }
+      }
+    }
+
+    /**
+     * Convenience method to load all tags that were previously saved to a JSON
+     * file. The format depends on what was previously stored in the JSON file,
+     * but it is recommended to following the format set out in
+     * {@link
+     * net.named_data.nfd.LogcatSettingsManager.LogcatTagsJSONSerializer#saveTags(java.util.Map)}
+     *
+     * @return Map that was previously stored in the JSON file
+     * @throws IOException
+     */
+    public Map<CharSequence, CharSequence> loadTags() throws IOException {
+      Map<CharSequence, CharSequence> map = new HashMap<>();
+
+      BufferedReader reader = null;
+      try {
+        InputStream inputStream = m_context.openFileInput(m_filename);
+        reader = new BufferedReader(new InputStreamReader(inputStream));
+        StringBuilder jsonString = new StringBuilder();
+        String line;
+        while ((line = reader.readLine()) != null) {
+          jsonString.append(line);
+        }
+
+        // Parse JSON array
+        JSONArray array = (JSONArray) new JSONTokener(jsonString.toString()).nextValue();
+
+        // Populate map
+        for (int i=0; i<array.length(); i++) {
+          JSONObject jsonObject = array.getJSONObject(i);
+          Iterator<String> iterator = jsonObject.keys();
+          while (iterator.hasNext()) {
+            String key = iterator.next();
+            map.put(key, (CharSequence) jsonObject.get(key));
+          }
+        }
+      } catch (JSONException | IOException e) {
+        G.Log(String.format("saveTags(): Error while reading from file: %s - %s",
+            m_filename, e));
+      } finally {
+        if (reader != null) {
+          reader.close();
+        }
+      }
+
+      return map;
+    }
+
+    /**
+     * @return true if a previously saved file exists; false otherwise
+     */
+    public boolean logcatTagsFileExists() {
+      return m_context.getFileStreamPath(m_filename).exists();
+    }
+
+    /** Context for storing and retrieving files */
+    private final Context m_context;
+
+    /** File name to store JSON */
+    private final String m_filename;
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /** Context for storage and retrieval of logcat settings (e.g. from Preferences or Files) */
+  private final Context m_context;
+
+  /** Array list that contains all the tags that are logged */
+  private final ArrayList<LogcatSettingItem> m_logcatSettingItems;
+
+  /** Mapping of log tag description to logcat priority setting */
+  private final Map<CharSequence, CharSequence> m_logLevelMap;
+
+  /** Reference to JSON Serializer for use */
+  private final LogcatTagsJSONSerializer m_logcatTagsJSONSerializer;
+
+  /** Singleton reference to a LogcatSettingsManager */
+  private static LogcatSettingsManager s_logcatSettingsManager;
+
+  /** NFD Logcat Tags JSON filename */
+  private static final String NFD_LOGCAT_TAGS_FILENAME = "NFD_LOGCAT_TAGS_FILE";
+}
diff --git a/app/src/main/java/net/named_data/nfd/MainActivity.java b/app/src/main/java/net/named_data/nfd/MainActivity.java
index e079e7c..945165a 100644
--- a/app/src/main/java/net/named_data/nfd/MainActivity.java
+++ b/app/src/main/java/net/named_data/nfd/MainActivity.java
@@ -19,329 +19,173 @@
 
 package net.named_data.nfd;
 
-import android.app.Activity;
-import android.app.DialogFragment;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
 import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Message;
-import android.os.Messenger;
-import android.os.RemoteException;
-import android.preference.Preference;
-import android.preference.PreferenceFragment;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.ActionBarActivity;
+import android.view.Menu;
+import android.view.MenuItem;
 
-import net.named_data.nfd.service.NfdService;
-import net.named_data.nfd.utils.G;
+import com.intel.jndn.management.types.FaceStatus;
 
-public class MainActivity extends Activity {
+import java.util.ArrayList;
 
-  MainFragment m_main = new MainFragment();
+/**
+ * Main activity that is loaded for the NFD app.
+ */
+public class MainActivity extends ActionBarActivity
+    implements DrawerFragment.DrawerCallbacks,
+               LogcatFragment.Callbacks,
+               FaceListFragment.Callbacks
+{
+
+  @Override
+  protected void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    setContentView(R.layout.activity_main);
+
+    FragmentManager fragmentManager = getSupportFragmentManager();
+
+    if (savedInstanceState != null) {
+      m_drawerFragment = (DrawerFragment)fragmentManager.findFragmentByTag(DrawerFragment.class.toString());
+    }
+
+    if (m_drawerFragment == null) {
+      ArrayList<DrawerFragment.DrawerItem> items = new ArrayList<DrawerFragment.DrawerItem>();
+
+      items.add(new DrawerFragment.DrawerItem(R.string.drawer_item_general, 0,
+                                              DRAWER_ITEM_GENERAL));
+      items.add(new DrawerFragment.DrawerItem(R.string.drawer_item_faces, 0,
+                                              DRAWER_ITEM_FACES));
+      items.add(new DrawerFragment.DrawerItem(R.string.drawer_item_routes, 0,
+                                              DRAWER_ITEM_ROUTES));
+      //    items.add(new DrawerFragment.DrawerItem(R.string.drawer_item_strategies, 0,
+      //                                            DRAWER_ITEM_STRATEGIES));
+      items.add(new DrawerFragment.DrawerItem(R.string.drawer_item_logcat, 0,
+                                              DRAWER_ITEM_LOGCAT));
+
+      m_drawerFragment = DrawerFragment.newInstance(items);
+
+      fragmentManager
+        .beginTransaction()
+        .replace(R.id.navigation_drawer, m_drawerFragment, DrawerFragment.class.toString())
+        .commit();
+    }
+  }
+
+  @Override
+  public boolean onCreateOptionsMenu(Menu menu) {
+    if (!m_drawerFragment.isDrawerOpen()) {
+      // Inflate current Activity's menu only if the drawer is not
+      // displayed; otherwise, allow the drawer to inflate its own
+      // menu in the action bar. Inflate activity wide menu here.
+      updateActionBar();
+      return true;
+    }
+    return super.onCreateOptionsMenu(menu);
+  }
+
+  @Override
+  public boolean onOptionsItemSelected(MenuItem item) {
+    return super.onOptionsItemSelected(item);
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /**
+   * Convenience method that updates and display the current title in the Action Bar
+   */
+  @SuppressWarnings("deprecation")
+  private void updateActionBar() {
+    ActionBar actionBar = getSupportActionBar();
+    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
+    actionBar.setDisplayShowTitleEnabled(true);
+    if (m_actionBarTitleId != -1) {
+      actionBar.setTitle(m_actionBarTitleId);
+    }
+  }
+
+  /**
+   * Convenience method that replaces the main fragment container with the
+   * new fragment and adding the current transaction to the backstack.
+   *
+   * @param fragment Fragment to be displayed in the main fragment container.
+   */
+  private void replaceContentFragmentWithBackstack(Fragment fragment) {
+    FragmentManager fragmentManager = getSupportFragmentManager();
+    fragmentManager.beginTransaction()
+        .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
+        .replace(R.id.main_fragment_container, fragment)
+        .addToBackStack(null)
+        .commit();
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
 
   @Override
   public void
-  onCreate(Bundle savedInstanceState)
-  {
-    super.onCreate(savedInstanceState);
+  onDrawerItemSelected(int itemCode, int itemNameId) {
 
-    getFragmentManager()
-      .beginTransaction()
-      .replace(android.R.id.content, m_main)
+    String fragmentTag = "net.named-data.nfd.content-" + String.valueOf(itemCode);
+    FragmentManager fragmentManager = getSupportFragmentManager();
+
+    // Create fragment according to user's selection
+    Fragment fragment = fragmentManager.findFragmentByTag(fragmentTag);
+    if (fragment == null) {
+      switch (itemCode) {
+        case DRAWER_ITEM_GENERAL:
+          fragment = MainFragment.newInstance();
+          break;
+        case DRAWER_ITEM_FACES:
+          fragment = FaceListFragment.newInstance();
+          break;
+        case DRAWER_ITEM_ROUTES:
+          fragment = RouteListFragment.newInstance();
+          break;
+        // TODO: Placeholders; Fill these in when their fragments have been created
+        //    case DRAWER_ITEM_STRATEGIES:
+        //      break;
+        case DRAWER_ITEM_LOGCAT:
+          fragment = LogcatFragment.newInstance();
+          break;
+        default:
+          // Invalid; Nothing else needs to be done
+          return;
+      }
+    }
+
+    // Update ActionBar title
+    m_actionBarTitleId = itemNameId;
+
+    fragmentManager.beginTransaction()
+      .replace(R.id.main_fragment_container, fragment, fragmentTag)
       .commit();
   }
 
-  public static class MainFragment extends PreferenceFragment {
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState)
-    {
-      super.onActivityCreated(savedInstanceState);
-
-      ///////////////////////////////////////////////////////////////////////////
-      // General settings
-      ///////////////////////////////////////////////////////////////////////////
-      addPreferencesFromResource(R.xml.pref_general);
-
-      m_startStopPref = findPreference("start_stop");
-      m_startStopPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener()
-      {
-        @Override
-        public boolean onPreferenceClick(Preference preference)
-        {
-          toggleNfdState();
-          return true;
-        }
-      });
-
-      ///////////////////////////////////////////////////////////////////////////
-      // Face settings
-      ///////////////////////////////////////////////////////////////////////////
-      addPreferencesFromResource(R.xml.pref_face);
-
-      findPreference("create_face")
-        .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
-          @Override
-          public boolean onPreferenceClick(Preference preference)
-          {
-            DialogFragment dialog = new FaceCreateDialog();
-            dialog.show(getFragmentManager(), "FaceCreateFragment");
-            return true;
-          }
-        });
-
-      ///////////////////////////////////////////////////////////////////////////
-      // Routes settings
-      ///////////////////////////////////////////////////////////////////////////
-      addPreferencesFromResource(R.xml.pref_routes);
-
-      findPreference("create_route")
-        .setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
-          @Override
-          public boolean onPreferenceClick(Preference preference)
-          {
-            DialogFragment dialog = new RouteCreateDialog();
-            dialog.show(getFragmentManager(), "RouteCreateFragment");
-            return true;
-          }
-        });
-    }
-
-    @Override
-    public void onResume() {
-      super.onResume();
-
-      // Bind to NfdService
-      bindNfdService();
-    }
-
-    @Override
-    public void onPause() {
-      super.onPause();
-
-      // Unbind from NfdService
-      unbindNfdService();
-    }
-
-    /**
-     * Thread safe way to start and stop the NFD through
-     * the UI Button.
-     */
-    private synchronized void toggleNfdState() {
-      if (m_isNfdRunning) {
-        m_startStopPref.setTitle(R.string.stopping_nfd);
-        sendNfdServiceMessage(NfdService.MESSAGE_STOP_NFD_SERVICE);
-      } else {
-        m_startStopPref.setTitle(R.string.starting_nfd);
-        sendNfdServiceMessage(NfdService.MESSAGE_START_NFD_SERVICE);
-      }
-    }
-
-    /**
-     * Convenience method to send a message to the NfdService
-     * through a Messenger.
-     *
-     * @param message Message from a set of predefined NfdService messages.
-     */
-    private synchronized void sendNfdServiceMessage(int message) {
-      try {
-        Message msg = Message.obtain(null, message);
-        msg.replyTo = m_clientMessenger;
-        m_nfdServiceMessenger.send(msg);
-      } catch (RemoteException e) {
-        // If Service crashes, nothing to do here
-        G.Log("Service Disconnected: " + e);
-      }
-    }
-
-    /**
-     * Enable UI Button once critical operations are completed.
-     */
-    private void enableNfdButton() {
-      m_startStopPref.setEnabled(true);
-    }
-
-    /**
-     * Disable UI Button to ensure user is unable to hit the button mutiple times.
-     */
-    private void disableNfdButton() {
-      m_startStopPref.setEnabled(false);
-    }
-
-    /**
-     * Thread safe way of flagging that the NFD is running.
-     *
-     * @param isNfdRunning true if NFD is running; false otherwise
-     */
-    private synchronized void setNfdRunningState(boolean isNfdRunning) {
-      m_isNfdRunning = isNfdRunning;
-    }
-
-    /**
-     * Toggle UI Button text to inform user of the next possible action.
-     *
-     * @param isNfdRunning true if NFD is currently running; false otherwise
-     */
-    private void setNfdButtonText(boolean isNfdRunning) {
-      m_startStopPref.setTitle(isNfdRunning ? R.string.stop_nfd : R.string.start_nfd);
-    }
-
-    /**
-     * Thread safe way of flagging that application is successfully connected
-     * to the NfdService.
-     *
-     * @param isNfdServiceConnected true if successfully connected to the NfdService;
-     *                              false otherwise
-     */
-    private synchronized void setNfdServiceConnected(boolean isNfdServiceConnected) {
-      m_isNfdServiceConnected = isNfdServiceConnected;
-    }
-
-    /**
-     * Method that binds the current activity to the NfdService.
-     */
-    private synchronized void bindNfdService() {
-      if (m_isNfdServiceBound == false) {
-        // Bind to Service
-        m_isNfdServiceBound = getActivity().bindService(
-          new Intent(getActivity(), NfdService.class),
-          m_ServiceConnection, Context.BIND_AUTO_CREATE);
-
-        G.Log("MainActivity::bindNfdService()");
-      }
-    }
-
-    /**
-     * Method that unbinds the current activity from the NfdService.
-     */
-    private synchronized void unbindNfdService() {
-      if (m_isNfdServiceBound == true) {
-        // Unbind from Service
-        getActivity().unbindService(m_ServiceConnection);
-        m_isNfdServiceBound = false;
-
-        G.Log("MainActivity::unbindNfdService()");
-      }
-    }
-
-    /**
-     * Client Message Handler.
-     *
-     * This handler is used to handle messages that are being sent back
-     * from the NfdService to the current application.
-     */
-    class ClientHandler extends Handler
-    {
-      @Override
-      public void handleMessage(Message msg) {
-        switch (msg.what) {
-          case NfdService.MESSAGE_NFD_RUNNING:
-            setNfdRunningState(true);
-            setNfdButtonText(true);
-            G.Log("ClientHandler: NFD is Running.");
-            break;
-
-          case NfdService.MESSAGE_NFD_STOPPED:
-            setNfdRunningState(false);
-            setNfdButtonText(false);
-            G.Log("ClientHandler: NFD is Stopped.");
-            break;
-
-          default:
-            super.handleMessage(msg);
-            break;
-        }
-
-        enableNfdButton();
-      }
-    }
-
-    /**
-     * Client ServiceConnection to NfdService.
-     */
-    private ServiceConnection m_ServiceConnection = new ServiceConnection() {
-      @Override
-      public void onServiceConnected(ComponentName className, IBinder service) {
-        // Establish Messenger to the Service
-        m_nfdServiceMessenger = new Messenger(service);
-
-        // Set service connected flag
-        setNfdServiceConnected(true);
-
-        // Check if NFD Service is running
-        try {
-          Message msg = Message.obtain(null,
-                                       NfdService.MESSAGE_IS_NFD_RUNNING);
-          msg.replyTo = m_clientMessenger;
-          m_nfdServiceMessenger.send(msg);
-        } catch (RemoteException e) {
-          // If Service crashes, nothing to do here
-          G.Log("onServiceConnected(): " + e);
-        }
-
-        G.Log("m_ServiceConnection::onServiceConnected()");
-      }
-
-      @Override
-      public void onServiceDisconnected(ComponentName componentName) {
-        // In event of unexpected disconnection with the Service; Not expecting to get here.
-        G.Log("m_ServiceConnection::onServiceDisconnected()");
-
-        // Update UI
-        disableNfdButton();
-        m_startStopPref.setTitle(R.string.reconnect_to_nfd);
-
-        // Reconnect to NfdService
-        setNfdServiceConnected(false);
-        retryConnectionToNfdService();
-      }
-    };
-
-    /**
-     * Attempt to reconnect to the NfdService.
-     *
-     * This method attempts to reconnect the application to the NfdService
-     * when the NfdService has been killed (either by the user or by the OS).
-     */
-    private void retryConnectionToNfdService() {
-      new Thread(){
-        @Override
-        public void run() {
-          while (m_isNfdServiceConnected == false) {
-            G.Log("Retrying connection to NFD Service ...");
-            bindNfdService();
-
-            try {
-              Thread.sleep(1000);
-            } catch (InterruptedException e) {
-              // Nothing to do here; Keep going.
-            }
-          }
-
-          G.Log("Reconnection to NFD Service is successful.");
-        }
-      }.start();
-    }
-
-    //////////////////////////////////////////////////////////////////////////////
-
-    /** Button that starts and stops the NFD */
-    private Preference m_startStopPref;
-
-    /** Flag that marks that application is bound to the NfdService */
-    private boolean m_isNfdServiceBound = false;
-
-    /** Flag that marks that application is connected to the NfdService */
-    private boolean m_isNfdServiceConnected = false;
-
-    /** Client Message Handler */
-    private final Messenger m_clientMessenger = new Messenger(new ClientHandler());
-
-    /** Messenger connection to NfdService */
-    private Messenger m_nfdServiceMessenger = null;
-
-    /** Flag that marks if the NFD is running */
-    private boolean m_isNfdRunning = false;
+  @Override
+  public void onDisplayLogcatSettings() {
+    replaceContentFragmentWithBackstack(LogcatSettingsFragment.newInstance());
   }
+
+  @Override
+  public void onFaceItemSelected(FaceStatus faceStatus) {
+    replaceContentFragmentWithBackstack(FaceStatusFragment.newInstance(faceStatus));
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /** Reference to drawer fragment */
+  private DrawerFragment m_drawerFragment;
+
+  /** Title that is to be displayed in the ActionBar */
+  private int m_actionBarTitleId = -1;
+
+  /** Item code for drawer items: For use in onDrawerItemSelected() callback */
+  public static final int DRAWER_ITEM_GENERAL = 1;
+  public static final int DRAWER_ITEM_FACES = 2;
+  public static final int DRAWER_ITEM_ROUTES = 3;
+  public static final int DRAWER_ITEM_STRATEGIES = 4;
+  public static final int DRAWER_ITEM_LOGCAT = 5;
 }
diff --git a/app/src/main/java/net/named_data/nfd/MainFragment.java b/app/src/main/java/net/named_data/nfd/MainFragment.java
new file mode 100644
index 0000000..878e7b1
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/MainFragment.java
@@ -0,0 +1,318 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.annotation.SuppressLint;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Switch;
+
+import net.named_data.nfd.service.NfdService;
+import net.named_data.nfd.utils.G;
+
+public class MainFragment extends Fragment {
+
+  public static MainFragment newInstance() {
+    // Create fragment arguments here (if necessary)
+    return new MainFragment();
+  }
+
+  @Override
+  public View onCreateView(LayoutInflater inflater,
+                           @Nullable ViewGroup container,
+                           @Nullable Bundle savedInstanceState)
+  {
+    @SuppressLint("InflateParams")
+    View v =  inflater.inflate(R.layout.fragment_main, null);
+
+    m_nfdStartStopSwitch = (Switch) v.findViewById(R.id.nfd_start_stop_switch);
+    m_nfdStartStopSwitch.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View v) {
+        toggleNfdState();
+      }
+    });
+
+    return v;
+  }
+
+  @Override
+  public void onResume () {
+    super.onResume();
+
+    // Bind to NfdService
+    bindNfdService();
+  }
+
+  @Override
+  public void onPause () {
+    super.onPause();
+
+    // Unbind from NfdService
+    unbindNfdService();
+  }
+
+  /**
+   * Thread safe way to start and stop the NFD through
+   * the UI Button.
+   */
+  private synchronized void toggleNfdState() {
+    if (m_isNfdRunning) {
+      m_nfdStartStopSwitch.setText(R.string.stopping_nfd);
+      sendNfdServiceMessage(NfdService.MESSAGE_STOP_NFD_SERVICE);
+    } else {
+      m_nfdStartStopSwitch.setText(R.string.starting_nfd);
+      sendNfdServiceMessage(NfdService.MESSAGE_START_NFD_SERVICE);
+    }
+  }
+
+  /**
+   * Convenience method to send a message to the NfdService
+   * through a Messenger.
+   *
+   * @param message Message from a set of predefined NfdService messages.
+   */
+  private synchronized void sendNfdServiceMessage(int message) {
+    try {
+      Message msg = Message.obtain(null, message);
+      msg.replyTo = m_clientMessenger;
+      m_nfdServiceMessenger.send(msg);
+    } catch (RemoteException e) {
+      // If Service crashes, nothing to do here
+      G.Log("Service Disconnected: " + e);
+    }
+  }
+
+  /**
+   * Enable UI Switch once critical operations are completed.
+   */
+  private void enableNfdSwitch() {
+    m_nfdStartStopSwitch.setEnabled(true);
+  }
+
+  /**
+   * Disable UI Switch to ensure user is unable to hit the switch multiple times.
+   */
+  private void disableNfdSwitch() {
+    m_nfdStartStopSwitch.setEnabled(false);
+  }
+
+  /**
+   * Thread safe way of flagging that the NFD is running.
+   *
+   * @param isNfdRunning true if NFD is running; false otherwise
+   */
+  private synchronized void setNfdRunningState(boolean isNfdRunning) {
+    m_isNfdRunning = isNfdRunning;
+  }
+
+  /**
+   * Toggle UI Switch to inform user of the next possible action.
+   *
+   * @param isNfdRunning true if NFD is currently running; false otherwise
+   */
+  private void setNfdSwitchState(boolean isNfdRunning) {
+    m_nfdStartStopSwitch.setText(isNfdRunning ? R.string.nfd_started : R.string.nfd_stopped);
+    m_nfdStartStopSwitch.setChecked(isNfdRunning);
+  }
+
+  /**
+   * Update UI Switch to inform user that the NFD Service has been disconnected
+   * and an attempt is made to reconnect with the NFD Service.
+   */
+  private void setNfdDisconnectedSwitchState() {
+    disableNfdSwitch();
+    m_nfdStartStopSwitch.setText(R.string.reconnect_to_nfd);
+    m_nfdStartStopSwitch.setChecked(false);
+  }
+
+  /**
+   * Thread safe way of flagging that application is successfully connected
+   * to the NfdService.
+   *
+   * @param isNfdServiceConnected true if successfully connected to the NfdService;
+   *                              false otherwise
+   */
+  private synchronized void setNfdServiceConnected(boolean isNfdServiceConnected) {
+    m_isNfdServiceConnected = isNfdServiceConnected;
+  }
+
+  /**
+   * Method that binds the current activity to the NfdService.
+   */
+  private synchronized void bindNfdService() {
+    if (!m_isNfdServiceBound) {
+      // Bind to Service
+      m_isNfdServiceBound = getActivity().bindService(
+          new Intent(getActivity(), NfdService.class),
+          m_ServiceConnection, Context.BIND_AUTO_CREATE);
+
+      G.Log("MainFragment::bindNfdService()");
+    }
+  }
+
+  /**
+   * Method that unbinds the current activity from the NfdService.
+   */
+  private synchronized void unbindNfdService() {
+    if (m_isNfdServiceBound) {
+      // Unbind from Service
+      getActivity().unbindService(m_ServiceConnection);
+      m_isNfdServiceBound = false;
+
+      G.Log("MainFragment::unbindNfdService()");
+    }
+  }
+
+  /**
+   * Client Message Handler.
+   *
+   * This handler is used to handle messages that are being sent back
+   * from the NfdService to the current application.
+   */
+  private class ClientHandler extends Handler {
+    @Override
+    public void handleMessage(Message msg) {
+      switch (msg.what) {
+        case NfdService.MESSAGE_NFD_RUNNING:
+          setNfdRunningState(true);
+          setNfdSwitchState(true);
+          G.Log("ClientHandler: NFD is Running.");
+          break;
+
+        case NfdService.MESSAGE_NFD_STOPPED:
+          setNfdRunningState(false);
+          setNfdSwitchState(false);
+          G.Log("ClientHandler: NFD is Stopped.");
+          break;
+
+        default:
+          super.handleMessage(msg);
+          break;
+      }
+
+      enableNfdSwitch();
+    }
+  }
+
+  /**
+   * Client ServiceConnection to NfdService.
+   */
+  private final ServiceConnection m_ServiceConnection = new ServiceConnection() {
+    @Override
+    public void onServiceConnected(ComponentName className, IBinder service) {
+      // Establish Messenger to the Service
+      m_nfdServiceMessenger = new Messenger(service);
+
+      // Set service connected flag
+      setNfdServiceConnected(true);
+
+      // Check if NFD Service is running
+      try {
+        Message msg = Message.obtain(null,
+            NfdService.MESSAGE_IS_NFD_RUNNING);
+        msg.replyTo = m_clientMessenger;
+        m_nfdServiceMessenger.send(msg);
+      } catch (RemoteException e) {
+        // If Service crashes, nothing to do here
+        G.Log("onServiceConnected(): " + e);
+      }
+
+      G.Log("m_ServiceConnection::onServiceConnected()");
+    }
+
+    @Override
+    public void onServiceDisconnected(ComponentName componentName) {
+      // In event of unexpected disconnection with the Service; Not expecting to get here.
+      G.Log("m_ServiceConnection::onServiceDisconnected()");
+
+      // Update UI
+      setNfdDisconnectedSwitchState();
+
+      // Reconnect to NfdService
+      setNfdServiceConnected(false);
+      retryConnectionToNfdService();
+    }
+  };
+
+  /**
+   * Attempt to reconnect to the NfdService.
+   *
+   * This method attempts to reconnect the application to the NfdService
+   * when the NfdService has been killed (either by the user or by the OS).
+   */
+  private void retryConnectionToNfdService() {
+    new Thread(){
+      @Override
+      public void run() {
+        // TODO: Trying infinitely doesn't make sense.
+        // Convert this to an AsyncTask that:
+        //    - has a fixed number of retries
+        //    - update UI to inform user of the progress
+        //    - set switch to appropriate state when service fails to come online
+        while (!m_isNfdServiceConnected) {
+          G.Log("Retrying connection to NFD Service ...");
+          bindNfdService();
+
+          try {
+            Thread.sleep(1000);
+          } catch (InterruptedException e) {
+            // Nothing to do here; Keep going.
+          }
+        }
+
+        G.Log("Reconnection to NFD Service is successful.");
+      }
+    }.start();
+  }
+
+  //////////////////////////////////////////////////////////////////////////////
+
+  /** Button that starts and stops the NFD */
+  private Switch m_nfdStartStopSwitch;
+
+  /** Flag that marks that application is bound to the NfdService */
+  private boolean m_isNfdServiceBound = false;
+
+  /** Flag that marks that application is connected to the NfdService */
+  private boolean m_isNfdServiceConnected = false;
+
+  /** Client Message Handler */
+  private final Messenger m_clientMessenger = new Messenger(new ClientHandler());
+
+  /** Messenger connection to NfdService */
+  private Messenger m_nfdServiceMessenger = null;
+
+  /** Flag that marks if the NFD is running */
+  private boolean m_isNfdRunning = false;
+}
diff --git a/app/src/main/java/net/named_data/nfd/RouteCreateDialog.java b/app/src/main/java/net/named_data/nfd/RouteCreateDialog.java
deleted file mode 100644
index aef371a..0000000
--- a/app/src/main/java/net/named_data/nfd/RouteCreateDialog.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
- * See AUTHORS.md for complete list of NFD Android authors and contributors.
- *
- * NFD Android is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.named_data.nfd;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.content.DialogInterface;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.WindowManager;
-import android.widget.EditText;
-
-import net.named_data.jndn.Name;
-import net.named_data.jndn_xx.util.FaceUri;
-import net.named_data.nfd.utils.Nfdc;
-import net.named_data.nfd.utils.NfdcAsyncTask;
-
-public class RouteCreateDialog extends DialogFragment
-{
-  @Override
-  public Dialog
-  onCreateDialog(Bundle savedInstanceState) {
-    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
-    LayoutInflater inflater = getActivity().getLayoutInflater();
-    builder
-      .setView(inflater.inflate(R.layout.create_route, null))
-      .setPositiveButton("Create route", new DialogInterface.OnClickListener()
-      {
-        @Override
-        public void onClick(DialogInterface dialog, int id)
-        {
-          EditText prefixBox = (EditText)getDialog().findViewById(R.id.prefix);
-          EditText uriBox = (EditText)getDialog().findViewById(R.id.faceUri);
-          final String prefix = prefixBox.getText().toString();
-          final String uri = uriBox.getText().toString();
-          new NfdcAsyncTask(getActivity(),
-                            new NfdcAsyncTask.Task()
-                            {
-                              public String
-                              runTask() throws Exception
-                              {
-                                try {
-                                  Nfdc nfdc = new Nfdc();
-                                  int faceId = nfdc.faceCreate(m_uri);
-                                  boolean ok = nfdc.ribRegisterPrefix(new Name(prefix), faceId, 10, true, false);
-                                  nfdc.shutdown();
-                                  if (ok) {
-                                    return "OK";
-                                  }
-                                  else {
-                                    return "Failed register prefix";
-                                  }
-                                } catch (FaceUri.CanonizeError e) {
-                                  return "Error creating face (" + e.getMessage() + ")";
-                                } catch (FaceUri.Error e) {
-                                  return "Error creating face (" + e.getMessage() + ")";
-                                }
-                              }
-
-                              ///////////////////////////
-                              private String m_uri = uri;
-                            }).execute();
-        }
-      })
-      .setNegativeButton("Cancel", new DialogInterface.OnClickListener()
-      {
-        public void onClick(DialogInterface dialog, int id)
-        {
-          RouteCreateDialog.this.getDialog().cancel();
-        }
-      })
-    ;
-
-    Dialog faceCreateDialog = builder.create();
-    faceCreateDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
-    return faceCreateDialog;
-  }
-}
diff --git a/app/src/main/java/net/named_data/nfd/RouteCreateDialogFragment.java b/app/src/main/java/net/named_data/nfd/RouteCreateDialogFragment.java
new file mode 100644
index 0000000..6517b32
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/RouteCreateDialogFragment.java
@@ -0,0 +1,77 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.v4.app.DialogFragment;
+import android.view.LayoutInflater;
+import android.view.WindowManager;
+import android.widget.EditText;
+
+import net.named_data.jndn.Name;
+
+public class RouteCreateDialogFragment extends DialogFragment
+{
+  public static interface OnRouteCreateRequested {
+    public void
+    createRoute(Name prefix, String faceUri);
+  }
+
+  public static RouteCreateDialogFragment
+  newInstance() {
+    return new RouteCreateDialogFragment();
+  }
+
+  @NonNull @Override
+  public Dialog
+  onCreateDialog(Bundle savedInstanceState) {
+    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+    LayoutInflater inflater = getActivity().getLayoutInflater();
+    builder
+      .setView(inflater.inflate(R.layout.create_route, null))
+      .setPositiveButton(R.string.route_add_dialog_create_route, new DialogInterface.OnClickListener() {
+        @Override
+        public void onClick(DialogInterface dialog, int id)
+        {
+          EditText prefixBox = (EditText) getDialog().findViewById(R.id.prefix);
+          EditText uriBox = (EditText) getDialog().findViewById(R.id.faceUri);
+          final String prefix = prefixBox.getText().toString();
+          final String uri = uriBox.getText().toString();
+
+          ((OnRouteCreateRequested)getTargetFragment()).createRoute(new Name(prefix), uri);
+        }
+      })
+      .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+        public void onClick(DialogInterface dialog, int id)
+        {
+          RouteCreateDialogFragment.this.getDialog().cancel();
+        }
+      })
+    ;
+
+    Dialog faceCreateDialog = builder.create();
+    faceCreateDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
+    return faceCreateDialog;
+  }
+}
diff --git a/app/src/main/java/net/named_data/nfd/RouteListActivity.java b/app/src/main/java/net/named_data/nfd/RouteListActivity.java
deleted file mode 100644
index 5eca4cd..0000000
--- a/app/src/main/java/net/named_data/nfd/RouteListActivity.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
- * See AUTHORS.md for complete list of NFD Android authors and contributors.
- *
- * NFD Android is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.named_data.nfd;
-
-import android.app.Activity;
-import android.app.FragmentManager;
-import android.app.FragmentTransaction;
-import android.app.ListFragment;
-import android.content.Context;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.BaseAdapter;
-import android.widget.TextView;
-
-import com.intel.jndn.management.types.RibEntry;
-import com.intel.jndn.management.types.Route;
-
-import net.named_data.nfd.utils.Nfdc;
-import net.named_data.nfd.utils.NfdcAsyncTask;
-
-import org.apache.commons.lang.StringUtils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class RouteListActivity extends Activity
-{
-  @Override
-  public void
-  onCreate(Bundle savedInstanceState)
-  {
-    super.onCreate(savedInstanceState);
-
-    FragmentManager fm = getFragmentManager();
-    FragmentTransaction ft = fm.beginTransaction();
-    if (fm.findFragmentById(android.R.id.content) == null) {
-      ft.add(android.R.id.content, m_routeListFragment);
-    }
-    else {
-      ft.replace(android.R.id.content, m_routeListFragment);
-    }
-    ft.commit();
-  }
-
-  public static class RouteListFragment extends ListFragment {
-    @Override
-    public void onActivityCreated(Bundle savedInstanceState)
-    {
-      super.onActivityCreated(savedInstanceState);
-
-      RouteListAdapter adapter = new RouteListAdapter(getActivity());
-      setListAdapter(adapter);
-
-      adapter.updateFaceList();
-    }
-
-    private class RouteListAdapter extends BaseAdapter
-    {
-      public RouteListAdapter(Context context)
-      {
-        this.m_inflater = LayoutInflater.from(context);
-        this.m_context = context;
-      }
-
-      public void
-      updateFaceList()
-      {
-        new NfdcAsyncTask(m_context,
-                          new NfdcAsyncTask.Task() {
-                            public String
-                            runTask() throws Exception
-                            {
-                              synchronized (m_routesLock) {
-                                Nfdc nfdc = new Nfdc();
-                                m_routes = nfdc.ribList();
-                                nfdc.shutdown();
-                              }
-
-                              getActivity().runOnUiThread(new Runnable() {
-                                @Override
-                                public void run()
-                                {
-                                  notifyDataSetChanged();
-                                }
-                              });
-                              return null;
-                            }
-                          }).execute();
-      }
-
-      @Override
-      public int
-      getCount()
-      {
-        synchronized (m_routesLock) {
-          if (m_routes == null)
-            return 0;
-          else
-            return m_routes.size();
-        }
-      }
-
-      @Override
-      public Object
-      getItem(int position)
-      {
-        synchronized (m_routesLock) {
-          assert m_routes != null && position < m_routes.size();
-          return m_routes.get(position);
-        }
-      }
-
-      @Override
-      public long
-      getItemId(int position)
-      {
-        return position;
-      }
-
-      @Override
-      public View
-      getView(int position, View convertView, ViewGroup parent)
-      {
-        RouteListItemViewHolder holder;
-        if (convertView == null) {
-          convertView = this.m_inflater.inflate(android.R.layout.simple_list_item_2, parent, false);
-          holder = new RouteListItemViewHolder(convertView);
-          convertView.setTag(holder);
-        } else {
-          holder = (RouteListItemViewHolder)convertView.getTag();
-        }
-
-        RibEntry e;
-        synchronized (m_routesLock) {
-          e = m_routes.get(position);
-        }
-        holder.text1.setText(e.getName().toUri());
-
-        List<String> faceList = new ArrayList<>();
-        for (Route r : e.getRoutes()) {
-          faceList.add(String.valueOf(r.getFaceId()));
-        }
-        holder.text2.setText(StringUtils.join(faceList, ", "));
-
-        return convertView;
-      }
-
-      /////////////////////////////////////////////////////////////////////////
-      private LayoutInflater m_inflater;
-      private Context m_context;
-      private List<RibEntry> m_routes;
-      private final Object m_routesLock = new Object();
-
-    }
-
-    private static class RouteListItemViewHolder
-    {
-      RouteListItemViewHolder(View v)
-      {
-        text1 = (TextView)v.findViewById(android.R.id.text1);
-        text2 = (TextView)v.findViewById(android.R.id.text2);
-      }
-
-      /////////////////////////////////////////////////////////////////////////
-      public TextView text1;
-      public TextView text2;
-    }
-  }
-
-  /////////////////////////////////////////////////////////////////////////////
-  private RouteListFragment m_routeListFragment = new RouteListFragment();
-}
diff --git a/app/src/main/java/net/named_data/nfd/RouteListFragment.java b/app/src/main/java/net/named_data/nfd/RouteListFragment.java
new file mode 100644
index 0000000..f6c787f
--- /dev/null
+++ b/app/src/main/java/net/named_data/nfd/RouteListFragment.java
@@ -0,0 +1,375 @@
+/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2015 Regents of the University of California
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
+ * See AUTHORS.md for complete list of NFD Android authors and contributors.
+ *
+ * NFD Android is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.named_data.nfd;
+
+import android.content.Context;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.v4.app.ListFragment;
+import android.text.TextUtils;
+import android.util.Pair;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.intel.jndn.management.types.RibEntry;
+import com.intel.jndn.management.types.Route;
+
+import net.named_data.jndn.Name;
+import net.named_data.jndn_xx.util.FaceUri;
+import net.named_data.nfd.utils.Nfdc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class RouteListFragment extends ListFragment implements RouteCreateDialogFragment.OnRouteCreateRequested {
+
+  public static RouteListFragment
+  newInstance() {
+    return new RouteListFragment();
+  }
+
+  @Override
+  public void
+  onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+
+    setListAdapter(new RouteListAdapter(getActivity()));
+  }
+
+  @Override
+  public View
+  onCreateView(LayoutInflater inflater,
+                           ViewGroup container,
+                           Bundle savedInstanceState)
+  {
+    View v = inflater.inflate(R.layout.fragment_route_list, null);
+    m_routeListInfoUnavailableView = v.findViewById(R.id.route_list_info_unavailable);
+
+    // Get progress bar spinner view
+    m_reloadingListProgressBar
+      = (ProgressBar)v.findViewById(R.id.route_list_reloading_list_progress_bar);
+
+    Button refreshRouteListButton = (Button) v.findViewById(R.id.route_list_refresh_button);
+    refreshRouteListButton.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View v) {
+        retrieveRouteList();
+      }
+    });
+
+    Button addRouteButton = (Button)v.findViewById(R.id.route_list_add_button);
+    addRouteButton.setOnClickListener(new View.OnClickListener() {
+      @Override
+      public void onClick(View view)
+      {
+        RouteCreateDialogFragment dialog = RouteCreateDialogFragment.newInstance();
+        dialog.setTargetFragment(RouteListFragment.this, 0);
+        dialog.show(getFragmentManager(), "RouteCreateFragment");
+      }
+    });
+
+    return v;
+  }
+
+  @Override
+  public void
+  onResume() {
+    super.onResume();
+    startRouteListInfoRetrievalTask();
+  }
+
+  @Override
+  public void
+  onPause() {
+    super.onPause();
+    stopRouteListInfoRetrievalTask();
+
+    if (m_routeCreateAsyncTask != null) {
+      m_routeCreateAsyncTask.cancel(false);
+      m_routeCreateAsyncTask = null;
+    }
+  }
+
+  @Override
+  public void
+  createRoute(Name prefix, String faceUri)
+  {
+    m_routeCreateAsyncTask = new RouteCreateAsyncTask(prefix, faceUri);
+    m_routeCreateAsyncTask.execute();
+  }
+
+
+  /////////////////////////////////////////////////////////////////////////
+
+  /**
+   * Updates the underlying adapter with the given list of RibEntry.
+   *
+   * Note: This method should only be called from the UI thread.
+   *
+   * @param list Update ListView with the given List&lt;RibEntry&gt;
+   */
+  private void updateRouteList(List<RibEntry> list) {
+    if (list == null) {
+      m_routeListInfoUnavailableView.setVisibility(View.VISIBLE);
+      return;
+    }
+
+    ((RouteListAdapter)getListAdapter()).updateList(list);
+  }
+
+  /**
+   * Convenience method that starts the AsyncTask that retrieves the
+   * list of available routes.
+   */
+  private void retrieveRouteList() {
+    // Update UI
+    m_routeListInfoUnavailableView.setVisibility(View.GONE);
+
+    // Stop if running; before starting the new Task
+    stopRouteListInfoRetrievalTask();
+    startRouteListInfoRetrievalTask();
+  }
+
+  /**
+   * Create a new AsynTask for route list information retrieval.
+   */
+  private void startRouteListInfoRetrievalTask() {
+    m_routeListAsyncTask = new RouteListAsyncTask();
+    m_routeListAsyncTask.execute();
+  }
+
+  /**
+   * Stops a previously started AsyncTask.
+   */
+  private void stopRouteListInfoRetrievalTask() {
+    if (m_routeListAsyncTask != null) {
+      m_routeListAsyncTask.cancel(false);
+      m_routeListAsyncTask = null;
+    }
+  }
+
+  /////////////////////////////////////////////////////////////////////////
+
+  private static class RouteListAdapter extends BaseAdapter {
+
+    public RouteListAdapter(Context context) {
+      m_layoutInflater = LayoutInflater.from(context);
+    }
+
+    public void
+    updateList(List<RibEntry> ribEntries) {
+      m_ribEntries = ribEntries;
+      notifyDataSetChanged();
+    }
+
+    @Override
+    public int getCount()
+    {
+      return (m_ribEntries == null) ? 0 : m_ribEntries.size();
+    }
+
+    @Override
+    public RibEntry
+    getItem(int i)
+    {
+      assert m_ribEntries != null;
+      return m_ribEntries.get(i);
+    }
+
+    @Override
+    public long
+    getItemId(int i)
+    {
+      return i;
+    }
+
+    @Override
+    public View
+    getView(int position, View convertView, ViewGroup parent) {
+      RouteItemHolder holder;
+
+      if (convertView == null) {
+        holder = new RouteItemHolder();
+
+        convertView = m_layoutInflater.inflate(R.layout.list_item_route_item, null);
+        convertView.setTag(holder);
+
+        holder.m_uri = (TextView) convertView.findViewById(R.id.list_item_route_uri);
+        holder.m_faceList = (TextView) convertView.findViewById(R.id.list_item_face_list);
+      } else {
+        holder = (RouteItemHolder) convertView.getTag();
+      }
+
+      RibEntry entry = getItem(position);
+
+      // Prefix
+      holder.m_uri.setText(entry.getName().toUri());
+
+      // List of faces
+      List<String> faceList = new ArrayList<>();
+      for (Route r : entry.getRoutes()) {
+        faceList.add(String.valueOf(r.getFaceId()));
+      }
+      holder.m_faceList.setText(TextUtils.join(", ", faceList));
+
+      return convertView;
+    }
+
+    private static class RouteItemHolder {
+      private TextView m_uri;
+      private TextView m_faceList;
+    }
+
+    private final LayoutInflater m_layoutInflater;
+    private List<RibEntry> m_ribEntries;
+  }
+
+  private class RouteListAsyncTask extends AsyncTask<Void, Void, Pair<List<RibEntry>, Exception>> {
+    @Override
+    protected void
+    onPreExecute() {
+      // Display progress bar
+      m_reloadingListProgressBar.setVisibility(View.VISIBLE);
+    }
+
+    @Override
+    protected Pair<List<RibEntry>, Exception>
+    doInBackground(Void... params) {
+      Nfdc nfdc = new Nfdc();
+      Exception returnException = null;
+      List<RibEntry> routes = null;
+      try {
+        routes = nfdc.ribList();
+      }
+      catch (Exception e) {
+        returnException = e;
+      }
+      nfdc.shutdown();
+      return new Pair<>(routes, returnException);
+    }
+
+    @Override
+    protected void onCancelled() {
+      // Remove progress bar
+      m_reloadingListProgressBar.setVisibility(View.GONE);
+    }
+
+    @Override
+    protected void onPostExecute(Pair<List<RibEntry>, Exception> result) {
+      // Remove progress bar
+      m_reloadingListProgressBar.setVisibility(View.GONE);
+
+      if (result.second != null) {
+        Toast.makeText(getActivity(),
+                       "Error communicating with NFD (" + result.second.getMessage() + ")",
+                       Toast.LENGTH_LONG).show();
+      }
+
+      updateRouteList(result.first);
+    }
+  }
+
+
+  private class RouteCreateAsyncTask extends AsyncTask<Void, Void, String> {
+    public
+    RouteCreateAsyncTask(Name prefix, String faceUri)
+    {
+      m_prefix = prefix;
+      m_faceUri = faceUri;
+    }
+
+    @Override
+    protected String
+    doInBackground(Void... params)
+    {
+      try {
+        Nfdc nfdc = new Nfdc();
+        int faceId = nfdc.faceCreate(m_faceUri);
+        boolean ok = nfdc.ribRegisterPrefix(new Name(m_prefix), faceId, 10, true, false);
+        nfdc.shutdown();
+        if (ok) {
+          return "OK";
+        }
+        else {
+          return "Failed register prefix";
+        }
+      } catch (FaceUri.CanonizeError e) {
+        return "Error creating face (" + e.getMessage() + ")";
+      } catch (FaceUri.Error e) {
+        return "Error creating face (" + e.getMessage() + ")";
+      }
+      catch (Exception e) {
+        return "Error communicating with NFD (" + e.getMessage() + ")";
+      }
+    }
+
+    @Override
+    protected void
+    onPreExecute()
+    {
+      // Display progress bar
+      m_reloadingListProgressBar.setVisibility(View.VISIBLE);
+    }
+
+    @Override
+    protected void
+    onPostExecute(String status)
+    {
+      // Display progress bar
+      m_reloadingListProgressBar.setVisibility(View.VISIBLE);
+      Toast.makeText(getActivity(), status, Toast.LENGTH_LONG).show();
+
+      retrieveRouteList();
+    }
+
+    @Override
+    protected void
+    onCancelled()
+    {
+      // Remove progress bar
+      m_reloadingListProgressBar.setVisibility(View.GONE);
+    }
+
+    ///////////////////////////////////////////////////////////////////////////
+
+    private Name m_prefix;
+    private String m_faceUri;
+  }
+
+  /////////////////////////////////////////////////////////////////////////////
+
+  /** Reference to the most recent AsyncTask that was created for listing routes */
+  private RouteListAsyncTask m_routeListAsyncTask;
+
+  /** Reference to the view to be displayed when no information is available */
+  private View m_routeListInfoUnavailableView;
+
+  /** Progress bar spinner to display to user when destroying faces */
+  private ProgressBar m_reloadingListProgressBar;
+
+  /** Reference to the most recent AsyncTask that was created for creating a route */
+  private RouteCreateAsyncTask m_routeCreateAsyncTask;
+}
\ No newline at end of file
diff --git a/app/src/main/java/net/named_data/nfd/service/NfdService.java b/app/src/main/java/net/named_data/nfd/service/NfdService.java
index 2657790..069356b 100644
--- a/app/src/main/java/net/named_data/nfd/service/NfdService.java
+++ b/app/src/main/java/net/named_data/nfd/service/NfdService.java
@@ -32,7 +32,7 @@
 /**
  * NfdService that runs the native NFD.
  *
- * NfdSevice runs as an independent process within the Android OS that provides
+ * NfdService runs as an independent process within the Android OS that provides
  * service level features to start and stop the NFD native code through the
  * NFD JNI wrapper.
  *
@@ -44,7 +44,7 @@
    */
   static {
     // At least on Galaxy S3 (4.1.1), all shared library dependencies that are located
-    // in app's lib folder (not in /system/lib) need to be expliclity loaded.
+    // in app's lib folder (not in /system/lib) need to be explicitly loaded.
     // The script https://gist.github.com/cawka/11fe9c23b7a13960330b can be used to
     // calculate proper dependency load list.
     // For example:
@@ -144,7 +144,7 @@
    * started flag.
    */
   private synchronized void serviceStartNfd() {
-    if (m_isNfdStarted == false) {
+    if (!m_isNfdStarted) {
       m_isNfdStarted = true;
       startNfd(getFilesDir().getAbsolutePath());
 
@@ -165,7 +165,7 @@
    * started flag.
    */
   private synchronized void serviceStopNfd() {
-    if (m_isNfdStarted == true) {
+    if (m_isNfdStarted) {
       m_isNfdStarted = false;
 
       // TODO: Save NFD and NRD in memory data structures.
@@ -188,7 +188,7 @@
   /**
    * Message handler for the the NFD Service.
    */
-  class NfdServiceMessageHandler extends Handler {
+  private class NfdServiceMessageHandler extends Handler {
 
     @Override
     public void handleMessage(Message message) {
diff --git a/app/src/main/java/net/named_data/nfd/utils/LogcatTags.java b/app/src/main/java/net/named_data/nfd/utils/LogcatTags.java
deleted file mode 100644
index 8d20321..0000000
--- a/app/src/main/java/net/named_data/nfd/utils/LogcatTags.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
- * See AUTHORS.md for complete list of NFD Android authors and contributors.
- *
- * NFD Android is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.named_data.nfd.utils;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.text.TextUtils;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Utility class to generate and retrieve log tags
- */
-public class LogcatTags
-{
-
-  /**
-   * Get tags that are stored for the given application's context.
-   *
-   * The method returns a string representation of tags that should be displayed
-   * to the UI. These tags and their output levels have been saved by the settings
-   * UI in the given context.
-   *
-   * An example of the return string is as such:
-   *
-   * <pre>
-   *    NFDService:S Strategy:S TcpChannel:S TcpFactory:S TcpLocalFace:S UdpFactory:S *:S
-   * </pre>
-   *
-   * @param context Current application context to retrieve log tags for
-   * @return String representation of log tags ready for use as arguments
-   *         to logcat.
-   */
-  public static String getTags(Context context) {
-    SharedPreferences preferences = context.getSharedPreferences(
-        PREFERENCE_NFD_TAGS_FILENAME, Context.MODE_PRIVATE);
-    String tagsString = preferences.getString(PREFERENCE_NFD_TAGS_KEY, "");
-
-    G.Log("loadCommand(): " + tagsString);
-
-    return tagsString;
-  }
-
-  /**
-   * Save tags as a string to the current context's preference.
-   *
-   * An example of a tag string that should be saved is shown as follows:
-   *
-   * <pre>
-   *    NFDService:S Strategy:S TcpChannel:S TcpFactory:S TcpLocalFace:S UdpFactory:S *:S
-   * </pre>
-   *
-   * NdfLogTagUtil.TagBuilder provides convenient methods to generate tag strings.
-   *
-   * @param context Current application context to save tag string to
-   * @param tagsString String representation of the tags to be saved
-   */
-  public static void saveTags(Context context, String tagsString) {
-    // Save preferred log level
-    SharedPreferences.Editor editor
-        = context.getSharedPreferences(
-        PREFERENCE_NFD_TAGS_FILENAME, Context.MODE_PRIVATE).edit();
-    editor.putString(PREFERENCE_NFD_TAGS_KEY, tagsString);
-    editor.commit();
-
-    G.Log("saveTags(): " + tagsString);
-  }
-
-  /**
-   * Convenience class to create and generate tags for use as arguments
-   * to logcat.
-   */
-  public static class TagBuilder {
-
-    private TagBuilder() {
-      m_tagMap = new HashMap<CharSequence, CharSequence>();
-    }
-
-    /**
-     * Get a new instance of a TagBuilder object.
-     *
-     * @return New TagBuilder ojbect for use.
-     */
-    public static TagBuilder getTagBuilder() {
-      return new TagBuilder();
-    }
-
-    /**
-     * @bried Add a tag with an associated log level value.
-     *
-     * Tag can be any tag for the logger to filter.
-     *
-     * The log level should be one of the following form:
-     * <pre>
-     *     Log Level | Meaning
-     *     ===================
-     *       V       : Verbose
-     *       D       : Debug
-     *       I       : Info
-     *       W       : Warning
-     *       E       : Error
-     *       F       : Fatal
-     *       S       : Silent
-     * </pre>
-     *
-     * @param tag Tag for the logger to filter for.
-     * @param logLevel Log level for specified tag.
-     */
-    public void addTag(CharSequence tag, CharSequence logLevel) {
-      m_tagMap.put(tag, logLevel);
-    }
-
-    /**
-     * Silence all tags that are not added to the current TagBuilder
-     * object.
-     */
-    public synchronized  void addSilenceNonRelatedTags() {
-      m_silenceNonRelatedTags = true;
-    }
-
-    /**
-     * Generate a string representing all the tags to be filtered and the
-     * relevant log levels.
-     *
-     * An example of a string returned by this method is:
-     *
-     * <pre>
-     *    NFDService:S Strategy:S TcpChannel:S TcpFactory:S TcpLocalFace:S UdpFactory:S *:S
-     * </pre>
-     *
-     * @return String representation of the tags and their relevant log levels to be
-     * filtered.
-     */
-    public String generateTagString() {
-      ArrayList<String> tags = new ArrayList<String>();
-      for (Map.Entry<CharSequence, CharSequence> item : m_tagMap.entrySet()) {
-        tags.add(String.format("%s:%s", item.getKey(), item.getValue()));
-      }
-
-      Collections.sort(tags);
-
-      if (m_silenceNonRelatedTags) {
-        tags.add("*:S");
-      }
-
-      return TextUtils.join(" ", tags);
-    }
-
-    /** Mapping of tag and log levels */
-    private Map<CharSequence, CharSequence> m_tagMap;
-
-    /** Flag that determines if all non related tags should be silenced */
-    private boolean m_silenceNonRelatedTags;
-  }
-
-  /** Preference filename */
-  private static final String PREFERENCE_NFD_TAGS_FILENAME = "NFD_TAGS_PREFERENCE_FILE";
-
-  /** Key in SharedPreference that stores the string of tags */
-  private static final String PREFERENCE_NFD_TAGS_KEY = "NFD_TAGS";
-}
diff --git a/app/src/main/java/net/named_data/nfd/utils/NfdcAsyncTask.java b/app/src/main/java/net/named_data/nfd/utils/NfdcAsyncTask.java
deleted file mode 100644
index cbf1406..0000000
--- a/app/src/main/java/net/named_data/nfd/utils/NfdcAsyncTask.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2015 Regents of the University of California
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
- * See AUTHORS.md for complete list of NFD Android authors and contributors.
- *
- * NFD Android is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NFD Android is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NFD Android, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package net.named_data.nfd.utils;
-
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.os.AsyncTask;
-import android.widget.Toast;
-
-
-public class NfdcAsyncTask extends AsyncTask<Void, Void, String> {
-
-  public NfdcAsyncTask(Context context, Task task)
-  {
-    m_context = context;
-    m_progressBar = new ProgressDialog(m_context);
-    m_task = task;
-  }
-
-  public interface Task {
-    public String
-    runTask() throws Exception;
-  }
-
-  @Override
-  protected String
-  doInBackground(Void... params)
-  {
-    try {
-      return m_task.runTask();
-    }
-    catch (Exception e) {
-      return "Error communicating with NFD (" + e.getMessage() + ")";
-    }
-  }
-
-  @Override
-  protected void
-  onPostExecute(String result)
-  {
-    m_progressBar.dismiss();
-    if (result != null)
-      Toast.makeText(m_context.getApplicationContext(), result, Toast.LENGTH_LONG).show();
-  }
-
-  @Override
-  protected void
-  onPreExecute()
-  {
-    m_progressBar.setMessage("Communicating with NFD...");
-    m_progressBar.show();
-  }
-
-  @Override
-  protected void
-  onProgressUpdate(Void... values)
-  {
-  }
-
-  /////////////////////////////////////////////////////////////////////////////
-
-  private Context m_context = null;
-  private ProgressDialog m_progressBar = null;
-  private Task m_task = null;
-}
diff --git a/app/src/main/res/drawable/custom_white_button.xml b/app/src/main/res/drawable/custom_white_button.xml
new file mode 100644
index 0000000..8edfc54
--- /dev/null
+++ b/app/src/main/res/drawable/custom_white_button.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:state_pressed="true"
+        android:drawable="@android:color/darker_gray"
+        />
+    <item
+        android:state_pressed="false"
+        android:drawable="@android:color/transparent"
+        />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/drawer_item_background_activated.xml b/app/src/main/res/drawable/drawer_item_background_activated.xml
new file mode 100644
index 0000000..1b497c0
--- /dev/null
+++ b/app/src/main/res/drawable/drawer_item_background_activated.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:state_activated="true"
+        android:drawable="@color/ndn_color_fire_bush"
+        />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/face_list_item_background_activated.xml b/app/src/main/res/drawable/face_list_item_background_activated.xml
new file mode 100644
index 0000000..f6a9b13
--- /dev/null
+++ b/app/src/main/res/drawable/face_list_item_background_activated.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:state_activated="true"
+        android:drawable="@android:color/darker_gray"
+        />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/item_background_activated.xml b/app/src/main/res/drawable/item_background_activated.xml
new file mode 100644
index 0000000..f6a9b13
--- /dev/null
+++ b/app/src/main/res/drawable/item_background_activated.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:state_activated="true"
+        android:drawable="@android:color/darker_gray"
+        />
+</selector>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_fragment.xml b/app/src/main/res/layout/activity_fragment.xml
new file mode 100644
index 0000000..98ee139
--- /dev/null
+++ b/app/src/main/res/layout/activity_fragment.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/fragment_container"
+    android:layout_height="match_parent"
+    android:layout_width="match_parent"
+    >
+
+</FrameLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..6d8b08a
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v4.widget.DrawerLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/drawer_layout"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".MainActivity">
+
+    <!-- Main container for fragments to be presented in -->
+    <FrameLayout
+        android:id="@+id/main_fragment_container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        />
+
+    <!-- DrawerFragment for user navigation -->
+    <FrameLayout
+        android:id="@+id/navigation_drawer"
+        android:layout_width="@dimen/drawer_width"
+        android:layout_height="match_parent"
+        android:layout_gravity="start"
+        tools:layout="@layout/activity_main_drawer_listview"
+        />
+
+</android.support.v4.widget.DrawerLayout>
diff --git a/app/src/main/res/layout/activity_main_drawer_listview.xml b/app/src/main/res/layout/activity_main_drawer_listview.xml
new file mode 100644
index 0000000..7ca3700
--- /dev/null
+++ b/app/src/main/res/layout/activity_main_drawer_listview.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+          xmlns:tools="http://schemas.android.com/tools"
+          android:layout_width="match_parent"
+          android:layout_height="match_parent"
+          android:choiceMode="singleChoice"
+          android:divider="@android:color/transparent"
+          android:dividerHeight="0dp"
+          android:background="#cccc"
+          tools:context=".DrawerFragment"
+/>
diff --git a/app/src/main/res/layout/create_face.xml b/app/src/main/res/layout/create_face.xml
index 6588dcc..02d40a6 100644
--- a/app/src/main/res/layout/create_face.xml
+++ b/app/src/main/res/layout/create_face.xml
@@ -7,7 +7,7 @@
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        style="@style/dialog_margin"
+        style="@style/default_dialog_margin"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:text="Enter FaceUri for the remote NDN daemon"
         android:layout_gravity="center_horizontal"/>
@@ -16,7 +16,7 @@
         android:id="@+id/faceUri"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        style="@style/dialog_margin"
+        style="@style/default_dialog_margin"
         android:hint="Face URI"
         android:inputType="text"
         android:focusable="true"
diff --git a/app/src/main/res/layout/create_route.xml b/app/src/main/res/layout/create_route.xml
index ddf7fb2..67c7677 100644
--- a/app/src/main/res/layout/create_route.xml
+++ b/app/src/main/res/layout/create_route.xml
@@ -7,7 +7,7 @@
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        style="@style/dialog_margin"
+        style="@style/default_dialog_margin"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:text="Enter prefix and FaceUri to register with NDN daemon"
         android:layout_gravity="center_horizontal"/>
@@ -16,7 +16,7 @@
         android:id="@+id/prefix"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        style="@style/dialog_margin"
+        style="@style/default_dialog_margin"
         android:hint="Prefix"
         android:inputType="text"
         android:focusable="true"
@@ -29,7 +29,7 @@
         android:id="@+id/faceUri"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        style="@style/dialog_margin"
+        style="@style/default_dialog_margin"
         android:hint="Face URI"
         android:inputType="text"
         android:focusable="true"
diff --git a/app/src/main/res/layout/face_status_item.xml b/app/src/main/res/layout/face_status_item.xml
deleted file mode 100644
index 9fd2a6b..0000000
--- a/app/src/main/res/layout/face_status_item.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="horizontal"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:padding="10dp">
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:text="Title"
-        android:id="@+id/title"
-        android:textColor="@android:color/primary_text_light"/>
-
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:text="Value"
-        android:id="@+id/value"
-        android:textAlignment="gravity"
-        android:gravity="right"
-        android:textColor="@android:color/secondary_text_dark"
-        android:layout_gravity="right"/>
-</LinearLayout>
diff --git a/app/src/main/res/layout/fragment_face_detail.xml b/app/src/main/res/layout/fragment_face_detail.xml
new file mode 100644
index 0000000..c251036
--- /dev/null
+++ b/app/src/main/res/layout/fragment_face_detail.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    style="@style/default_linear_layout_padding"
+    >
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/fragment_face_details_title"
+        style="?android:listSeparatorTextViewStyle"
+        />
+
+    <include
+        layout="@android:layout/list_content"
+        />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_face_list.xml b/app/src/main/res/layout/fragment_face_list.xml
new file mode 100644
index 0000000..f7c2388
--- /dev/null
+++ b/app/src/main/res/layout/fragment_face_list.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    style="@style/default_linear_layout_padding"
+    >
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/face_list_actions_title"
+        style="?android:listSeparatorTextViewStyle"
+        />
+
+    <Button
+        android:id="@+id/face_list_refresh_button"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/face_list_refresh_face_list"
+        style="@style/default_custom_white_button"
+        />
+    <Button
+        android:id="@+id/face_list_add_button"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/face_list_add_face"
+        style="@style/default_custom_white_button"
+        />
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/face_list_list_of_faces_title"
+        style="?android:listSeparatorTextViewStyle"
+        />
+
+    <FrameLayout
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        >
+
+        <ProgressBar
+            android:id="@+id/face_list_reloading_list_progress_bar"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:visibility="gone"
+            />
+
+        <LinearLayout
+            android:id="@+id/face_list_info_unavailable"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            android:visibility="gone"
+            >
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/oops"
+                />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:text="@string/error_cannot_communicate_with_nfd"
+                />
+
+        </LinearLayout>
+
+        <include
+            layout="@android:layout/list_content"
+            />
+
+    </FrameLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_log.xml b/app/src/main/res/layout/fragment_logcat_output.xml
similarity index 100%
rename from app/src/main/res/layout/activity_log.xml
rename to app/src/main/res/layout/fragment_logcat_output.xml
diff --git a/app/src/main/res/layout/fragment_logcat_tags_list.xml b/app/src/main/res/layout/fragment_logcat_tags_list.xml
new file mode 100644
index 0000000..2688e0d
--- /dev/null
+++ b/app/src/main/res/layout/fragment_logcat_tags_list.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    style="@style/default_linear_layout_padding"
+    >
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/fragment_logcat_general_operations_category"
+        style="?android:listSeparatorTextViewStyle"
+        />
+
+    <Button
+        android:id="@+id/logcat_reset_loglevel_defaults"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/logcat_reset_log_level_defaults"
+        style="@style/default_custom_white_button"
+        />
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/fragment_logcat_tags_n_log_levels"
+        style="?android:listSeparatorTextViewStyle"
+        />
+
+    <include
+        layout="@android:layout/list_content"
+        />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml
new file mode 100644
index 0000000..9fa4afa
--- /dev/null
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    style="@style/default_linear_layout_padding"
+    >
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/pref_category_title_general"
+        style="?android:listSeparatorTextViewStyle"
+        />
+
+    <Switch
+        android:id="@+id/nfd_start_stop_switch"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_horizontal"
+        android:text="@string/checking_on_nfd"
+        />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_route_list.xml b/app/src/main/res/layout/fragment_route_list.xml
new file mode 100644
index 0000000..b1d481b
--- /dev/null
+++ b/app/src/main/res/layout/fragment_route_list.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    style="@style/default_linear_layout_padding"
+    >
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/route_list_actions_title"
+        style="?android:listSeparatorTextViewStyle"
+        />
+
+    <Button
+        android:id="@+id/route_list_refresh_button"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/route_list_refresh_route_list"
+        style="@style/default_custom_white_button"
+        />
+    <Button
+        android:id="@+id/route_list_add_button"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/route_list_add_route"
+        style="@style/default_custom_white_button"
+        />
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/route_list_list_of_routes_title"
+        style="?android:listSeparatorTextViewStyle"
+        />
+
+    <FrameLayout
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        >
+
+        <ProgressBar
+            android:id="@+id/route_list_reloading_list_progress_bar"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:visibility="gone"
+            />
+
+        <LinearLayout
+            android:id="@+id/route_list_info_unavailable"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            android:visibility="gone"
+            >
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/oops"
+                />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:text="@string/error_cannot_communicate_with_nfd"
+                />
+
+        </LinearLayout>
+
+        <include
+            layout="@android:layout/list_content"
+            />
+
+    </FrameLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_item_drawer_item.xml b/app/src/main/res/layout/list_item_drawer_item.xml
new file mode 100644
index 0000000..08a598b
--- /dev/null
+++ b/app/src/main/res/layout/list_item_drawer_item.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:orientation="horizontal"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:background="@drawable/drawer_item_background_activated"
+              android:paddingLeft="@dimen/default_padding_left"
+              android:paddingRight="@dimen/default_padding_right"
+    >
+
+    <ImageView
+        android:id="@+id/drawer_item_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
+        />
+
+    <TextView
+        android:id="@+id/drawer_item_text"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:textAppearance="?android:attr/textAppearanceListItemSmall"
+        android:minHeight="?android:attr/listPreferredItemHeightSmall"
+        android:gravity="center_vertical"
+        />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_item_face_generic_item.xml b/app/src/main/res/layout/list_item_face_generic_item.xml
new file mode 100644
index 0000000..7683c68
--- /dev/null
+++ b/app/src/main/res/layout/list_item_face_generic_item.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="horizontal"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    >
+
+    <TextView
+        android:id="@+id/list_item_generic_title"
+        android:text="Title"
+        style="@style/two_column_item_title"
+        />
+
+    <TextView
+        android:id="@+id/list_item_generic_value"
+        android:text="Value"
+        style="@style/two_column_item_secondary"
+        />
+
+</LinearLayout>
diff --git a/app/src/main/res/layout/list_item_face_status_item.xml b/app/src/main/res/layout/list_item_face_status_item.xml
new file mode 100644
index 0000000..0b6a1d0
--- /dev/null
+++ b/app/src/main/res/layout/list_item_face_status_item.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/item_background_activated"
+    >
+
+    <TextView
+        android:id="@+id/list_item_face_uri"
+        android:text="FaceUri"
+        style="@style/two_row_item_title"
+        />
+
+    <TextView
+        android:id="@+id/list_item_face_id"
+        android:text="FaceId"
+        style="@style/two_row_item_secondary"
+        />
+
+</LinearLayout>
diff --git a/app/src/main/res/layout/log_item.xml b/app/src/main/res/layout/list_item_log.xml
similarity index 100%
rename from app/src/main/res/layout/log_item.xml
rename to app/src/main/res/layout/list_item_log.xml
diff --git a/app/src/main/res/layout/list_item_route_item.xml b/app/src/main/res/layout/list_item_route_item.xml
new file mode 100644
index 0000000..baa6da0
--- /dev/null
+++ b/app/src/main/res/layout/list_item_route_item.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/item_background_activated"
+    >
+
+    <TextView
+        android:id="@+id/list_item_route_uri"
+        android:text="Route"
+        style="@style/two_row_item_title"
+        />
+
+    <TextView
+        android:id="@+id/list_item_face_list"
+        android:text="Faces"
+        style="@style/two_row_item_secondary"
+        />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/list_item_setting_item.xml b/app/src/main/res/layout/list_item_setting_item.xml
new file mode 100644
index 0000000..4d8498b
--- /dev/null
+++ b/app/src/main/res/layout/list_item_setting_item.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/item_background_activated"
+    >
+
+    <TextView
+        android:id="@+id/list_item_log_tag"
+        style="@style/two_row_item_title"
+        />
+
+    <TextView
+        android:id="@+id/list_item_setting_log_level"
+        style="@style/two_row_item_secondary"
+        />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_face_list_multiple_modal_menu.xml b/app/src/main/res/menu/menu_face_list_multiple_modal_menu.xml
new file mode 100644
index 0000000..1664611
--- /dev/null
+++ b/app/src/main/res/menu/menu_face_list_multiple_modal_menu.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+      xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <item
+        android:id="@+id/menu_item_delete_face_item"
+        android:icon="@android:drawable/ic_menu_delete"
+        android:title="@string/menu_item_delete_face_item"
+        app:showAsAction="ifRoom|withText"
+        />
+
+</menu>
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_log.xml b/app/src/main/res/menu/menu_log.xml
index b749bbe..a530929 100644
--- a/app/src/main/res/menu/menu_log.xml
+++ b/app/src/main/res/menu/menu_log.xml
@@ -7,6 +7,7 @@
         android:id="@+id/action_log_settings"
         android:title="@string/log_settings"
         android:orderInCategory="100"
-        app:showAsAction="never" />
+        app:showAsAction="never"
+        />
 
 </menu>
diff --git a/app/src/main/res/menu/menu_logcat_settings_multiple_modal_menu.xml b/app/src/main/res/menu/menu_logcat_settings_multiple_modal_menu.xml
new file mode 100644
index 0000000..2bbf336
--- /dev/null
+++ b/app/src/main/res/menu/menu_logcat_settings_multiple_modal_menu.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+      xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <item
+        android:id="@+id/menu_item_delete_setting_item"
+        android:icon="@android:drawable/ic_menu_delete"
+        android:title="@string/menu_item_delete_setting_item"
+        app:showAsAction="ifRoom|withText"
+        />
+
+</menu>
\ No newline at end of file
diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml
new file mode 100644
index 0000000..a125d29
--- /dev/null
+++ b/app/src/main/res/values-sw600dp/dimens.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <dimen name="default_padding_left">48dp</dimen>
+    <dimen name="default_padding_right">48dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..92b2b4b
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <item name="ndn_color_fire_bush" type="color">#DB9710</item>
+    <item name="ndn_color_grenadier" type="color">#C04818</item>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 47c8224..5d96952 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -2,4 +2,8 @@
     <!-- Default screen margins, per the Android Design guidelines. -->
     <dimen name="activity_horizontal_margin">16dp</dimen>
     <dimen name="activity_vertical_margin">16dp</dimen>
+
+    <dimen name="default_padding_left">16dp</dimen>
+    <dimen name="default_padding_right">16dp</dimen>
+    <dimen name="drawer_width">192dp</dimen>
 </resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index a8f78fd..dc86688 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -2,15 +2,56 @@
     <string name="app_name">NFD</string>
     <string name="service_name">NFD Service</string>
     <string name="action_settings">Settings</string>
-    <string name="stop_nfd">Stop NFD</string>
-    <string name="start_nfd">Start NFD</string>
-    <string name="reconnecting_to_nfd">Please wait while we connect to the NFD Service.</string>
-    <string name="stopping_nfd">Stopping NFD ...</string>
-    <string name="starting_nfd">Starting NFD ...</string>
-    <string name="reconnect_to_nfd">Reconnecting to NFD Service</string>
-    <string name="loading_logger">Loading logger ...</string>
-    <string name="nfd_logger">NFD Logger</string>
+    <string name="nfd_stopped">NFD is stopped</string>
+    <string name="nfd_started">NFD is started</string>
+    <string name="stopping_nfd">Stopping NFD …</string>
+    <string name="starting_nfd">Starting NFD …</string>
+    <string name="reconnect_to_nfd">Reconnecting to NFD Service …</string>
+    <string name="loading_logger">Loading logger …</string>
     <string name="log_settings">Log Settings</string>
-    <string name="nfd_log_settings">NFD Log Settings</string>
-    <string name="checking_on_nfd">Checking on NFD Service ...</string>
+    <string name="checking_on_nfd">Checking on NFD Service …</string>
+    <string name="accessibility_open_drawer">Open NFD Navigation Drawer</string>
+    <string name="accessibility_close_drawer">Close NFD Navigation Drawer</string>
+    <string name="drawer_item_general">General</string>
+    <string name="drawer_item_faces">Faces</string>
+    <string name="drawer_item_routes">Routes</string>
+    <string name="drawer_item_strategies">Strategies</string>
+    <string name="drawer_item_logcat">Logcat</string>
+    <string name="menu_item_delete_setting_item">Delete</string>
+    <string name="fragment_logcat_general_operations_category">General Actions</string>
+    <string name="fragment_logcat_tags_n_log_levels">Tags &amp; Log Levels</string>
+    <string name="logcat_reset_log_level_defaults">Reset Log Level Defaults</string>
+    <string name="reset_log_level_dialog_title">Select default value for all tags</string>
+    <string name="route_list_actions_title">Route List Actions</string>
+    <string name="oops">Oops!</string>
+    <string name="error_cannot_communicate_with_nfd">Not available, check that NFD is started</string>
+    <string name="route_list_list_of_routes_title">List of Routes</string>
+    <string name="route_list_refresh_route_list">Refresh Route List</string>
+    <string name="route_list_add_route">Add Route</string>
+    <string name="face_list_actions_title">Face List Actions</string>
+    <string name="face_list_refresh_face_list">Refresh Face List</string>
+    <string name="face_list_add_face">Add Face</string>
+    <string name="face_list_list_of_faces_title">List of Faces</string>
+    <string name="fragment_face_details_title">Face Details</string>
+    <string name="menu_item_delete_face_item">Delete</string>
+    <string name="expire_never">Never</string>
+
+    <string-array name="face_scopes">
+        <item>Local</item>
+        <item>Non-local</item>
+    </string-array>
+
+    <string-array name="face_persistency">
+        <item>Persistent</item>
+        <item>On-demand</item>
+        <item>Permanent</item>
+    </string-array>
+
+    <string-array name="face_link_types">
+        <item>Point-to-point</item>
+        <item>Multi-access</item>
+    </string-array>
+
+    <string name="face_add_dialog_create_face">Create face</string>
+    <string name="route_add_dialog_create_route">Create route</string>
 </resources>
diff --git a/app/src/main/res/values/strings_logcat_settings_activity.xml b/app/src/main/res/values/strings_logcat_settings_activity.xml
index 36e89a7..47d5221 100644
--- a/app/src/main/res/values/strings_logcat_settings_activity.xml
+++ b/app/src/main/res/values/strings_logcat_settings_activity.xml
@@ -2,56 +2,8 @@
 
     <!-- Strings related to NFD Log Settings -->
 
-    <!-- Set all tags log level -->
-    <string name="pref_tags_log_level_title_key">All_Log_Levels_Key</string>
-    <string name="pref_tags_log_level_title">All Log Levels</string>
-    <string name="pref_tags_log_level_key">Reset_All_Tags_Log_Level_Key</string>
-    <string name="pref_tags_log_level">Reset</string>
-
-    <!-- Tags -->
-    <string name="pref_category_title_tags">NFD Tags &amp; Log Levels</string>
-    <string name="pref_category_title_tags_key">NFD_Tags_Key</string>
-
-    <!-- Tag Display Names -->
-    <string name="pref_tag_commandvalidator">CommandValidator</string>
-    <string name="pref_tag_facemanager">FaceManager</string>
-    <string name="pref_tag_facetable">FaceTable</string>
-    <string name="pref_tag_fibmanager">FibManager</string>
-    <string name="pref_tag_generalconfigsection">GeneralConfigSection</string>
-    <string name="pref_tag_internalface">InternalFace</string>
-    <string name="pref_tag_managerbase">ManagerBase</string>
-    <string name="pref_tag_privilegehelper">PrivilegeHelper</string>
-    <string name="pref_tag_remoteregistrator">RemoteRegistrator</string>
-    <string name="pref_tag_ribmanager">RibManager</string>
-    <string name="pref_tag_strategy">Strategy</string>
-    <string name="pref_tag_strategychoice">StrategyChoice</string>
-    <string name="pref_tag_tablesconfigsection">TablesConfigSection</string>
-    <string name="pref_tag_tcpchannel">TcpChannel</string>
-    <string name="pref_tag_tcpfactory">TcpFactory</string>
-    <string name="pref_tag_tcplocalface">TcpLocalFace</string>
-    <string name="pref_tag_udpfactory">UdpFactory</string>
-
-    <!-- Tag Keys -->
-    <string name="pref_tag_commandvalidator_key">CommandValidator</string>
-    <string name="pref_tag_facemanager_key">FaceManager</string>
-    <string name="pref_tag_facetable_key">FaceTable</string>
-    <string name="pref_tag_fibmanager_key">FibManager</string>
-    <string name="pref_tag_generalconfigsection_key">GeneralConfigSection</string>
-    <string name="pref_tag_internalface_key">InternalFace</string>
-    <string name="pref_tag_managerbase_key">ManagerBase</string>
-    <string name="pref_tag_privilegehelper_key">PrivilegeHelper</string>
-    <string name="pref_tag_remoteregistrator_key">RemoteRegistrator</string>
-    <string name="pref_tag_ribmanager_key">RibManager</string>
-    <string name="pref_tag_strategy_key">Strategy</string>
-    <string name="pref_tag_strategychoice_key">StrategyChoice</string>
-    <string name="pref_tag_tablesconfigsection_key">TablesConfigSection</string>
-    <string name="pref_tag_tcpchannel_key">TcpChannel</string>
-    <string name="pref_tag_tcpfactory_key">TcpFactory</string>
-    <string name="pref_tag_tcplocalface_key">TcpLocalFace</string>
-    <string name="pref_tag_udpfactory_key">UdpFactory</string>
-
     <!-- Log Levels -->
-    <string-array name="pref_log_levels">
+    <string-array name="reset_log_level_values">
         <item>Verbose</item>
         <item>Debug</item>
         <item>Info</item>
@@ -61,15 +13,40 @@
         <item>Silent</item>
     </string-array>
 
-    <!-- Log Level Command Tag-->
-    <string-array name="pref_log_level_values">
-        <item>V</item>
-        <item>D</item>
-        <item>I</item>
-        <item>W</item>
-        <item>E</item>
-        <item>F</item>
-        <item>S</item>
+    <!-- Log Level Mapping -->
+    <!--
+     This mapping is used for Logcat arguments and should be in the format of:
+        <display description>:<logcat priority value>
+    -->
+    <string-array name="logcat_log_level_map">
+        <item>Verbose:V</item>
+        <item>Debug:D</item>
+        <item>Info:I</item>
+        <item>Warn:W</item>
+        <item>Error:E</item>
+        <item>Fatal:F</item>
+        <item>Silent:S</item>
+    </string-array>
+
+    <!-- Default lag tags and log levels when no previous settings are found -->
+    <string-array name="default_log_tags_and_levels">
+        <item>CommandValidator:V</item>
+        <item>FaceManager:V</item>
+        <item>FaceTable:V</item>
+        <item>FibManager:V</item>
+        <item>GeneralConfigSection:V</item>
+        <item>InternalFace:V</item>
+        <item>ManagerBase:V</item>
+        <item>PrivilegeHelper:V</item>
+        <item>RemoteRegistrator:V</item>
+        <item>RibManager:V</item>
+        <item>Strategy:V</item>
+        <item>StrategyChoice:V</item>
+        <item>TablesConfigSection:V</item>
+        <item>TcpChannel:V</item>
+        <item>TcpFactory:V</item>
+        <item>TcpLocalFace:V</item>
+        <item>UdpFactory:V</item>
     </string-array>
 
 </resources>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 9484591..08a8a5c 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -5,11 +5,57 @@
         <!-- Customize your theme here. -->
     </style>
 
-    <style name="dialog_margin">
+    <style name="default_dialog_margin">
         <item name="android:layout_marginTop">16dp</item>
         <item name="android:layout_marginLeft">4dp</item>
         <item name="android:layout_marginRight">4dp</item>
         <item name="android:layout_marginBottom">4dp</item>
     </style>
 
+    <style name="default_linear_layout_padding">
+        <item name="android:paddingLeft">@dimen/default_padding_left</item>
+        <item name="android:paddingRight">@dimen/default_padding_right</item>
+    </style>
+    
+    <style name="default_custom_white_button">
+        <item name="android:gravity">left|center_vertical</item>
+        <item name="android:background">@drawable/custom_white_button</item>
+        <item name="android:textColor">@android:color/primary_text_light</item>
+        <item name="android:textAppearance">?android:textAppearanceSmall</item>
+    </style>
+
+    <style name="item_title">
+        <item name="android:textAppearance">?android:textAppearanceSmall</item>
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:textColor">@android:color/primary_text_light</item>
+    </style>
+
+    <style name="item_secondary">
+        <item name="android:textAppearance">?android:textAppearanceSmall</item>
+        <item name="android:textColor">@android:color/secondary_text_dark</item>
+    </style>
+
+    <style name="two_row_item_title" parent="item_title">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
+
+    <style name="two_row_item_secondary" parent="item_secondary">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
+
+    <style name="two_column_item_title" parent="item_title">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
+
+    <style name="two_column_item_secondary" parent="item_secondary">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:gravity">right</item>
+        <item name="android:layout_gravity">right</item>
+    </style>
+
 </resources>
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
deleted file mode 100644
index 7195806..0000000
--- a/app/src/main/res/xml/pref_general.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-  <!-- General section -->
-  <PreferenceCategory
-      android:key="@string/pref_category_title_general"
-      android:title="@string/pref_category_title_general">
-
-    <Preference
-      android:title="@string/start_nfd"
-      android:key="start_stop" />
-
-    <PreferenceScreen
-      android:title="NFD log"
-      android:key="nfd_log">
-        <intent
-            android:action="android.intent.action.VIEW"
-            android:targetPackage="net.named_data.nfd"
-            android:targetClass="net.named_data.nfd.LogcatActivity" />
-    </PreferenceScreen>
-
-  </PreferenceCategory>
-</PreferenceScreen>
diff --git a/app/src/main/res/xml/pref_nfd_log.xml b/app/src/main/res/xml/pref_nfd_log.xml
deleted file mode 100644
index 37a0432..0000000
--- a/app/src/main/res/xml/pref_nfd_log.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-    <PreferenceCategory
-        android:key="@string/pref_tags_log_level_title_key"
-        android:title="@string/pref_tags_log_level_title">
-
-        <ListPreference
-            android:key="@string/pref_tags_log_level_key"
-            android:title="@string/pref_tags_log_level"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-    </PreferenceCategory>
-
-    <PreferenceCategory
-        android:key="@string/pref_category_title_tags_key"
-        android:title="@string/pref_category_title_tags">
-
-        <ListPreference
-            android:key="@string/pref_tag_commandvalidator_key"
-            android:title="@string/pref_tag_commandvalidator"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_facemanager_key"
-            android:title="@string/pref_tag_facemanager"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_facetable_key"
-            android:title="@string/pref_tag_facetable"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_fibmanager_key"
-            android:title="@string/pref_tag_fibmanager"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_generalconfigsection_key"
-            android:title="@string/pref_tag_generalconfigsection"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_internalface_key"
-            android:title="@string/pref_tag_internalface"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_managerbase_key"
-            android:title="@string/pref_tag_managerbase"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_privilegehelper_key"
-            android:title="@string/pref_tag_privilegehelper"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_remoteregistrator_key"
-            android:title="@string/pref_tag_remoteregistrator"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_ribmanager_key"
-            android:title="@string/pref_tag_ribmanager"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_strategy_key"
-            android:title="@string/pref_tag_strategy"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_strategychoice_key"
-            android:title="@string/pref_tag_strategychoice"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_tablesconfigsection_key"
-            android:title="@string/pref_tag_tablesconfigsection"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_tcpchannel_key"
-            android:title="@string/pref_tag_tcpchannel"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_tcpfactory_key"
-            android:title="@string/pref_tag_tcpfactory"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_tcplocalface_key"
-            android:title="@string/pref_tag_tcplocalface"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-        <ListPreference
-            android:key="@string/pref_tag_udpfactory_key"
-            android:title="@string/pref_tag_udpfactory"
-            android:entries="@array/pref_log_levels"
-            android:entryValues="@array/pref_log_level_values"
-            android:defaultValue="I"
-            android:negativeButtonText="@null"
-            android:positiveButtonText="@null" />
-
-    </PreferenceCategory>
-</PreferenceScreen>
