diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 948b73b..51c923b 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -3,11 +3,11 @@
     package="net.named_data.nfd" >
 
     <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.READ_LOGS" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 
diff --git a/app/src/main/java/net/named_data/nfd/FaceStatusFragment.java b/app/src/main/java/net/named_data/nfd/FaceStatusFragment.java
index 143ed58..0d58cd3 100644
--- a/app/src/main/java/net/named_data/nfd/FaceStatusFragment.java
+++ b/app/src/main/java/net/named_data/nfd/FaceStatusFragment.java
@@ -1,6 +1,6 @@
 /* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2015-2017 Regents of the University of California
+ * Copyright (c) 2015-2018 Regents of the University of California
  * <p/>
  * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
  * See AUTHORS.md for complete list of NFD Android authors and contributors.
@@ -125,10 +125,10 @@
       listItems.add(new ListItem(R.string.link_type, getLinkType(faceStatus.getLinkType())));
       listItems.add(new ListItem(R.string.in_interests, String.valueOf(
         faceStatus.getNInInterests())));
-      listItems.add(new ListItem(R.string.in_data, String.valueOf(faceStatus.getNInDatas())));
+      listItems.add(new ListItem(R.string.in_data, String.valueOf(faceStatus.getNInData())));
       listItems.add(new ListItem(R.string.out_interests, String.valueOf(
         faceStatus.getNOutInterests())));
-      listItems.add(new ListItem(R.string.out_data, String.valueOf(faceStatus.getNOutDatas())));
+      listItems.add(new ListItem(R.string.out_data, String.valueOf(faceStatus.getNOutData())));
       listItems.add(new ListItem(R.string.in_bytes, String.valueOf(faceStatus.getNInBytes())));
       listItems.add(new ListItem(R.string.out_bytes, String.valueOf(faceStatus.getNOutBytes())));
 
diff --git a/app/src/main/java/net/named_data/nfd/LogcatFragment.java b/app/src/main/java/net/named_data/nfd/LogcatFragment.java
deleted file mode 100644
index ed4b1e8..0000000
--- a/app/src/main/java/net/named_data/nfd/LogcatFragment.java
+++ /dev/null
@@ -1,340 +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.annotation.SuppressLint;
-import android.app.Activity;
-import android.os.Bundle;
-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;
-import android.widget.BaseAdapter;
-import android.widget.ListView;
-import android.widget.TextView;
-
-import net.named_data.nfd.utils.G;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-
-/**
- * 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 LogcatFragment extends Fragment {
-
-  public static Fragment newInstance() {
-    return new LogcatFragment();
-  }
-
-  @Override
-  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:
-        m_callbacks.onDisplayLogcatSettings();
-        return true;
-      default:
-        return super.onOptionsItemSelected(item);
-    }
-  }
-
-  @Override
-  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
-  public void onDetach() {
-    super.onDetach();
-    m_callbacks = null;
-  }
-
-  //////////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Starts logging by spawning a new thread to capture logs.
-   */
-  private void startLogging() {
-    // Clear output, update UI and get tag arguments
-    clearLogOutput();
-    appendLogText(getString(R.string.loading_logger));
-    m_tagArguments = LogcatSettingsManager.get(getActivity()).getTags();
-
-    new Thread(){
-      @Override
-      public void run() {
-        captureLog();
-        G.Log("Thread done capturing logs.");
-      }
-    }.start();
-  }
-
-  /**
-   * Stops the logging by killing the process running logcat.
-   */
-  private void stopLogging() {
-    // Kill process
-    m_logProcess.destroy();
-  }
-
-  /**
-   * Clear log adapter and update UI.
-   */
-  private void clearLogOutput() {
-    m_logListAdapter.clearMessages();
-  }
-
-  /**
-   * Convenience method to append a message to the log output
-   * and scroll to the bottom of the log.
-   *
-   * @param message String message to be posted to the text view.
-   */
-  private void appendLogText(String message) {
-    m_logListAdapter.addMessage(message);
-    m_logListView.setSelection(m_logListAdapter.getCount() - 1);
-  }
-
-  /**
-   * Convenience method to capture the output from logcat.
-   */
-  private void captureLog() {
-    try {
-      /**
-       * NOTE: The use of the 'time' log output format is hard
-       * coded for now. This option is similar to that of the
-       * log output that is seen in Android Studio and Eclipse.
-       *
-       * In the future this value can be user configurable or
-       * placed in the log preference settings.
-       */
-      // Build command for execution
-      String cmd = String.format("%s -v time %s *:S",
-          "logcat",
-          m_tagArguments);
-
-      G.Log("LogCat Command: " + cmd);
-
-      m_logProcess =  Runtime.getRuntime().exec(cmd);
-      BufferedReader in = new BufferedReader(
-          new InputStreamReader(m_logProcess.getInputStream()));
-
-      String line;
-      while ((line = in.readLine()) != null) {
-        final String message = line;
-        getActivity().runOnUiThread(new Runnable() {
-          @Override
-          public void run() {
-            appendLogText(message);
-          }
-        });
-      }
-
-      // Wait for process to join this thread
-      m_logProcess.waitFor();
-    } catch (IOException | InterruptedException e) {
-      G.Log("captureLog(): " + e);
-    }
-  }
-
-  //////////////////////////////////////////////////////////////////////////////
-
-  /**
-   * Custom LogListAdapter to limit the number of log lines that
-   * is being stored and displayed.
-   */
-  private static class LogListAdapter extends BaseAdapter {
-
-    /**
-     * Create a ListView compatible adapter with an
-     * upper bound on the maximum number of entries that will
-     * be displayed in the ListView.
-     *
-     * @param maxLines Maximum number of entries allowed in
-     *                 the ListView for this adapter.
-     */
-    public LogListAdapter(LayoutInflater layoutInflater, int maxLines) {
-      m_data = new ArrayList<>();
-      m_layoutInflater = layoutInflater;
-      m_maxLines = maxLines;
-    }
-
-    /**
-     * Add a message to be displayed in the log's list view.
-     *
-     * @param message Message to be added to the underlying data store
-     *                and displayed on thi UI.
-     */
-    public void addMessage(String message) {
-      if (m_data.size() == m_maxLines) {
-        m_data.get(0);
-      }
-
-      m_data.add(message);
-      notifyDataSetChanged();
-    }
-
-    /**
-     * Convenience method to clear all messages from the underlying
-     * data store and update the UI.
-     */
-    public void clearMessages() {
-      m_data.clear();
-      this.notifyDataSetChanged();
-    }
-
-    @Override
-    public int getCount() {
-      return m_data.size();
-    }
-
-    @Override
-    public Object getItem(int position) {
-      return m_data.get(position);
-    }
-
-    @Override
-    public long getItemId(int position) {
-      return position;
-    }
-
-    @SuppressLint("InflateParams")
-    @Override
-    public View getView(int position, View convertView, ViewGroup parent) {
-      LogEntryViewHolder holder;
-
-      if (convertView == null) {
-        holder = new LogEntryViewHolder();
-
-        convertView = m_layoutInflater.inflate(R.layout.list_item_log, null);
-        convertView.setTag(holder);
-
-        holder.logLineTextView = (TextView) convertView.findViewById(R.id.log_line);
-      } else {
-        holder = (LogEntryViewHolder) convertView.getTag();
-      }
-
-      holder.logLineTextView.setText(m_data.get(position));
-      return convertView;
-    }
-
-    /** Underlying message data store for log messages*/
-    private final ArrayList<String> m_data;
-
-    /** Layout inflater for inflating views */
-    private final LayoutInflater m_layoutInflater;
-
-    /** Maximum number of log lines to display */
-    private final int m_maxLines;
-  }
-
-  /**
-   * Log entry view holder object for holding the output.
-   */
-  private static class LogEntryViewHolder {
-    public TextView logLineTextView;
-  }
-
-  //////////////////////////////////////////////////////////////////////////////
-
-  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 */
-  private Process m_logProcess;
-
-  /** ListView for displaying log output in */
-  private ListView m_logListView;
-
-  /** Customized ListAdapter for controlling log output */
-  private LogListAdapter m_logListAdapter;
-
-  /** 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
deleted file mode 100644
index d5a3fff..0000000
--- a/app/src/main/java/net/named_data/nfd/LogcatSettingItem.java
+++ /dev/null
@@ -1,61 +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;
-
-/**
- * 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/LogcatSettingsFragment.java b/app/src/main/java/net/named_data/nfd/LogcatSettingsFragment.java
deleted file mode 100644
index 1cb1b82..0000000
--- a/app/src/main/java/net/named_data/nfd/LogcatSettingsFragment.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2015-2017 Regents of the University of California
- * <p/>
- * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
- * See AUTHORS.md for complete list of NFD Android authors and contributors.
- * <p/>
- * 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.
- * <p/>
- * 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.
- * <p/>
- * 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.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.annotation.Nullable;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.ListFragment;
-import android.support.v4.content.ContextCompat;
-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.ArrayAdapter;
-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);
-
-    setHasOptionsMenu(true);
-  }
-
-  @Override
-  public void onViewCreated(View view, Bundle savedInstanceState)
-  {
-    super.onViewCreated(view, savedInstanceState);
-
-    View v = getLayoutInflater().inflate(R.layout.fragment_logcat_tags_list_header, getListView(), false);
-    getListView().addHeaderView(v, null, false);
-    getListView().setDivider(ContextCompat.getDrawable(getContext(), R.drawable.list_item_divider));
-
-    // @TODO implement log item removal
-    //    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
-    //      }
-    //    });
-  }
-
-  @Override
-  public void onActivityCreated(@Nullable Bundle savedInstanceState)
-  {
-    super.onActivityCreated(savedInstanceState);
-
-    if (m_adapter == null) {
-      m_logcatSettingsManager = LogcatSettingsManager.get(getActivity());
-      m_logcatSettingItems = m_logcatSettingsManager.getLogcatSettingItems();
-
-      m_adapter = new LogcatSettingsAdapter(getActivity(), m_logcatSettingItems);
-    }
-    // setListAdapter must be called after addHeaderView.  Otherwise, there is an exception on some platforms.
-    // http://stackoverflow.com/a/8141537/2150331
-    setListAdapter(m_adapter);
-  }
-
-  @Override
-  public void onDestroyView()
-  {
-    super.onDestroyView();
-    setListAdapter(null);
-  }
-
-  @Override
-  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
-  {
-    super.onCreateOptionsMenu(menu, inflater);
-    inflater.inflate(R.menu.menu_logcat_settings, menu);
-  }
-
-  @Override
-  public boolean onOptionsItemSelected(MenuItem item)
-  {
-    switch (item.getItemId()) {
-      case R.id.action_log_settings:
-        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);
-
-        return true;
-      default:
-        return super.onOptionsItemSelected(item);
-    }
-  }
-
-  @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> {
-
-    LogcatSettingsAdapter(Context context, ArrayList<LogcatSettingItem> objects) {
-      super(context, 0, objects);
-      m_layoutInflater = LayoutInflater.from(context);
-    }
-
-    @Override @NonNull
-    public View getView(int position, View convertView, @NonNull ViewGroup parent) {
-      SettingItemHolder holder;
-
-      if (convertView == null) {
-        holder = new SettingItemHolder();
-
-        convertView = m_layoutInflater.inflate(R.layout.list_item_setting_item, parent, false);
-        convertView.setTag(holder);
-
-        holder.m_logTag = convertView.findViewById(R.id.list_item_log_tag);
-        holder.m_logLevel = convertView.findViewById(R.id.list_item_setting_log_level);
-      } else {
-        holder = (SettingItemHolder) convertView.getTag();
-      }
-
-      LogcatSettingItem item = getItem(position);
-      if (item != null) {
-        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";
-
-  private ArrayAdapter<LogcatSettingItem> m_adapter;
-}
diff --git a/app/src/main/java/net/named_data/nfd/LogcatSettingsManager.java b/app/src/main/java/net/named_data/nfd/LogcatSettingsManager.java
deleted file mode 100644
index e6bffcb..0000000
--- a/app/src/main/java/net/named_data/nfd/LogcatSettingsManager.java
+++ /dev/null
@@ -1,391 +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.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 c3a13ba..a1de558 100644
--- a/app/src/main/java/net/named_data/nfd/MainActivity.java
+++ b/app/src/main/java/net/named_data/nfd/MainActivity.java
@@ -1,6 +1,6 @@
 /* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2015-2017 Regents of the University of California
+ * Copyright (c) 2015-2018 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.
@@ -41,7 +41,6 @@
  */
 public class MainActivity extends AppCompatActivity
     implements DrawerFragment.DrawerCallbacks,
-               LogcatFragment.Callbacks,
                FaceListFragment.Callbacks,
                RouteListFragment.Callbacks
 {
@@ -70,8 +69,6 @@
                                               DRAWER_ITEM_PING));
       //    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));
       items.add(new DrawerFragment.DrawerItem(R.string.drawer_item_wifidirect, 0, DRAWER_ITEM_WIFIDIRECT));
 
       // TODO here we are preloading the NDNController singleton to avoid UI slowdown
@@ -161,9 +158,6 @@
         // TODO: Placeholders; Fill these in when their fragments have been created
         //    case DRAWER_ITEM_STRATEGIES:
         //      break;
-        case DRAWER_ITEM_LOGCAT:
-          fragment = LogcatFragment.newInstance();
-          break;
         case DRAWER_ITEM_WIFIDIRECT:
           fragment = WiFiDirectFragment.newInstance();
           break;
@@ -182,11 +176,6 @@
   }
 
   @Override
-  public void onDisplayLogcatSettings() {
-    replaceContentFragmentWithBackstack(LogcatSettingsFragment.newInstance());
-  }
-
-  @Override
   public void onFaceItemSelected(FaceStatus faceStatus) {
     replaceContentFragmentWithBackstack(FaceStatusFragment.newInstance(faceStatus));
   }
@@ -210,7 +199,6 @@
   public static final int DRAWER_ITEM_FACES = 2;
   public static final int DRAWER_ITEM_ROUTES = 3;
   public static final int DRAWER_ITEM_PING = 4;
-  //public static final int DRAWER_ITEM_STRATEGIES = 4;
-  public static final int DRAWER_ITEM_LOGCAT = 5;
-  public static final int DRAWER_ITEM_WIFIDIRECT = 6;
+  //public static final int DRAWER_ITEM_STRATEGIES = X;
+  public static final int DRAWER_ITEM_WIFIDIRECT = 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
index 276c6e1..0c6d4ee 100644
--- a/app/src/main/java/net/named_data/nfd/MainFragment.java
+++ b/app/src/main/java/net/named_data/nfd/MainFragment.java
@@ -1,6 +1,6 @@
 /* -*- Mode:jde; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2015-2017 Regents of the University of California
+ * Copyright (c) 2015-2018 Regents of the University of California
  * <p>
  * This file is part of NFD (Named Data Networking Forwarding Daemon) Android.
  * See AUTHORS.md for complete list of NFD Android authors and contributors.
@@ -390,8 +390,8 @@
         m_inInterestsView.setText(String.valueOf(fs.getNInInterests()));
         m_outInterestsView.setText(String.valueOf(fs.getNOutInterests()));
 
-        m_inDataView.setText(String.valueOf(fs.getNInDatas()));
-        m_outDataView.setText(String.valueOf(fs.getNOutDatas()));
+        m_inDataView.setText(String.valueOf(fs.getNInData()));
+        m_outDataView.setText(String.valueOf(fs.getNOutData()));
 
         m_inNacksView.setText(String.valueOf(fs.getNInNacks()));
         m_outNacksView.setText(String.valueOf(fs.getNOutNacks()));
diff --git a/app/src/main/jni/Android.mk b/app/src/main/jni/Android.mk
index 762c358..9310d31 100644
--- a/app/src/main/jni/Android.mk
+++ b/app/src/main/jni/Android.mk
@@ -4,9 +4,9 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE := nfd-wrapper
 LOCAL_SRC_FILES := nfd-wrapper.cpp
-LOCAL_SHARED_LIBRARIES := nfd-daemon ndn-cxx boost_system_shared boost_thread_shared
+LOCAL_SHARED_LIBRARIES := nfd_shared ndn_cxx_shared boost_system_shared boost_thread_shared boost_log_shared
 LOCAL_LDLIBS := -llog -latomic
+LOCAL_CFLAGS := -DBOOST_LOG_DYN_LINK=1
 include $(BUILD_SHARED_LIBRARY)
 
-include $(LOCAL_PATH_SAVED)/ndn-cxx.mk
-include $(LOCAL_PATH_SAVED)/nfd.mk
+$(call import-module,../packages/nfd/0.6.2-11-gd657d53)
diff --git a/app/src/main/jni/Application.mk b/app/src/main/jni/Application.mk
index 793e7c4..b0e4094 100644
--- a/app/src/main/jni/Application.mk
+++ b/app/src/main/jni/Application.mk
@@ -1,8 +1,8 @@
 APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
 
-APP_STL := gnustl_shared
-APP_CPPFLAGS += -fexceptions -frtti -std=c++11
+APP_STL := c++_shared
+APP_CPPFLAGS += -fexceptions -frtti -std=c++14
 # -Wno-deprecated-declarations
 
-NDK_TOOLCHAIN_VERSION := 4.9
+NDK_TOOLCHAIN_VERSION := clang
 APP_PLATFORM := android-23
diff --git a/app/src/main/jni/NFD b/app/src/main/jni/NFD
deleted file mode 160000
index e5abc94..0000000
--- a/app/src/main/jni/NFD
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit e5abc94540a8987ab8c2fc83f28d6073e2be0b96
diff --git a/app/src/main/jni/ndn-cxx b/app/src/main/jni/ndn-cxx
deleted file mode 160000
index f2e7a03..0000000
--- a/app/src/main/jni/ndn-cxx
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f2e7a0391eed1670691c1e0a7c644bc2430bb01c
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp
deleted file mode 100644
index e79c69d..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef W_SRC_NDN_CXX_CONFIG_HPP_WAF
-#define W_SRC_NDN_CXX_CONFIG_HPP_WAF
-
-// Uncomment this after switch to clang/libc++
-// #define NDN_CXX_HAVE_STD_TO_STRING 1
-
-#define NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR 1
-#define NDN_CXX_HAVE_IS_DEFAULT_CONSTRUCTIBLE 1
-#define NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE 1
-#define NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE 1
-#define NDN_CXX_HAVE_PTHREAD 1
-#define NDN_CXX_HAVE_RT 1
-#define NDN_CXX_HAVE_RTNETLINK 1
-#define NDN_CXX_HAVE_SQLITE3 1
-#define NDN_CXX_HAVE_OPENSSL 1
-#define NDN_CXX_SYSCONFDIR "./etc"
-#define NDN_CXX_NDEBUG 1
-#define NDEBUG 1
-#define HAVE_NDN_CXX_CUSTOM_LOGGER 1
-
-#endif /* W_SRC_NDN_CXX_CONFIG_HPP_WAF */
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp
deleted file mode 100644
index 41cae15..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx-custom-logger.hpp"
-#include "ndn-cxx-custom-logging.hpp"
-
-#include <cinttypes>
-#include <stdio.h>
-#include <type_traits>
-
-namespace ndn {
-namespace util {
-
-std::ostream&
-operator<<(std::ostream& os, LogLevel level)
-{
-  switch (level) {
-  case LogLevel::FATAL:
-    return os << "FATAL";
-  case LogLevel::NONE:
-    return os << "NONE";
-  case LogLevel::ERROR:
-    return os << "ERROR";
-  case LogLevel::WARN:
-    return os << "WARN";
-  case LogLevel::INFO:
-    return os << "INFO";
-  case LogLevel::DEBUG:
-    return os << "DEBUG";
-  case LogLevel::TRACE:
-    return os << "TRACE";
-  case LogLevel::ALL:
-    return os << "ALL";
-  }
-
-  BOOST_THROW_EXCEPTION(std::invalid_argument("unknown log level " + to_string(static_cast<int>(level))));
-}
-
-LogLevel
-parseLogLevel(const std::string& s)
-{
-  if (s == "FATAL")
-    return LogLevel::FATAL;
-  else if (s == "NONE")
-    return LogLevel::NONE;
-  else if (s == "ERROR")
-    return LogLevel::ERROR;
-  else if (s == "WARN")
-    return LogLevel::WARN;
-  else if (s == "INFO")
-    return LogLevel::INFO;
-  else if (s == "DEBUG")
-    return LogLevel::DEBUG;
-  else if (s == "TRACE")
-    return LogLevel::TRACE;
-  else if (s == "ALL")
-    return LogLevel::ALL;
-
-  BOOST_THROW_EXCEPTION(std::invalid_argument("unrecognized log level '" + s + "'"));
-}
-
-Logger::Logger(const std::string& name)
-  : m_moduleName(name)
-{
-  this->setLevel(LogLevel::NONE);
-  Logging::addLogger(*this);
-}
-
-} // namespace util
-} // namespace ndn
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp
deleted file mode 100644
index c8595fe..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
-#define NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
-
-#include "common.hpp"
-#include <sstream>
-#include <atomic>
-#include <android/log.h>
-
-namespace ndn {
-namespace util {
-
-/** \brief indicates the severity level of a log message
- */
-enum class LogLevel {
-  FATAL   = -1,   ///< fatal (will be logged unconditionally)
-  NONE    = 0,    ///< no messages
-  ERROR   = 1,    ///< serious error messages
-  WARN    = 2,    ///< warning messages
-  INFO    = 3,    ///< informational messages
-  DEBUG   = 4,    ///< debug messages
-  TRACE   = 5,    ///< trace messages (most verbose)
-  ALL     = 255   ///< all messages
-};
-
-/** \brief output LogLevel as string
- *  \throw std::invalid_argument unknown \p level
- */
-std::ostream&
-operator<<(std::ostream& os, LogLevel level);
-
-/** \brief parse LogLevel from string
- *  \throw std::invalid_argument unknown level name
- */
-LogLevel
-parseLogLevel(const std::string& s);
-
-/** \brief represents a logger in logging facility
- *  \note User should declare a new logger with \p NDN_LOG_INIT macro.
- */
-class Logger
-{
-public:
-  explicit
-  Logger(const std::string& name);
-
-  const std::string&
-  getModuleName() const
-  {
-    return m_moduleName;
-  }
-
-  bool
-  isLevelEnabled(LogLevel level) const
-  {
-    return m_currentLevel.load(std::memory_order_relaxed) >= level;
-  }
-
-  void
-  setLevel(LogLevel level)
-  {
-    m_currentLevel.store(level, std::memory_order_relaxed);
-  }
-
-private:
-  const std::string m_moduleName;
-  std::atomic<LogLevel> m_currentLevel;
-};
-
-/** \brief declare a log module
- */
-#define NDN_LOG_INIT(name) \
-  namespace { \
-    inline ::ndn::util::Logger& getNdnCxxLogger() \
-    { \
-      static ::ndn::util::Logger logger(BOOST_STRINGIZE(name)); \
-      return logger; \
-    } \
-  } \
-  struct ndn_cxx__allow_trailing_semicolon
-
-#define NDN_LOG(level, androidLevel, msg, expression)   \
-  do { \
-      if (getNdnCxxLogger().isLevelEnabled(::ndn::util::LogLevel::level)) {           \
-      std::ostringstream os;                                              \
-      os << expression;                                                   \
-      __android_log_print(ANDROID_LOG_##androidLevel,                     \
-                          getNdnCxxLogger().getModuleName().c_str(), "%s", os.str().c_str()); \
-    }                                                                     \
-  } while (false)
-
-#define NDN_LOG_TRACE(expression) NDN_LOG(TRACE, VERBOSE, TRACE, expression)
-#define NDN_LOG_DEBUG(expression) NDN_LOG(DEBUG, DEBUG, DEBUG,   expression)
-#define NDN_LOG_INFO(expression)  NDN_LOG(INFO,  INFO,  INFO,    expression)
-#define NDN_LOG_WARN(expression)  NDN_LOG(WARN,  WARN,  WARNING, expression)
-#define NDN_LOG_ERROR(expression) NDN_LOG(ERROR, ERROR, ERROR,   expression)
-#define NDN_LOG_FATAL(expression) NDN_LOG(FATAL, FATAL, FATAL,   expression)
-
-} // namespace util
-} // namespace ndn
-
-#endif // NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp
deleted file mode 100644
index 845d412..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "ndn-cxx-custom-logging.hpp"
-#include "ndn-cxx-custom-logger.hpp"
-
-#include <cstdlib>
-#include <sstream>
-
-namespace ndn {
-namespace util {
-
-static const LogLevel INITIAL_DEFAULT_LEVEL = LogLevel::NONE;
-
-Logging&
-Logging::get()
-{
-  // Initialization of block-scope variables with static storage duration is thread-safe.
-  // See ISO C++ standard [stmt.dcl]/4
-  static Logging instance;
-  return instance;
-}
-
-Logging::Logging()
-{
-}
-
-void
-Logging::addLoggerImpl(Logger& logger)
-{
-  std::lock_guard<std::mutex> lock(m_mutex);
-
-  const std::string& moduleName = logger.getModuleName();
-  m_loggers.insert({moduleName, &logger});
-
-  auto levelIt = m_enabledLevel.find(moduleName);
-  if (levelIt == m_enabledLevel.end()) {
-    levelIt = m_enabledLevel.find("*");
-  }
-  LogLevel level = levelIt == m_enabledLevel.end() ? INITIAL_DEFAULT_LEVEL : levelIt->second;
-  logger.setLevel(level);
-}
-
-void
-Logging::setLevelImpl(const std::string& moduleName, LogLevel level)
-{
-  std::lock_guard<std::mutex> lock(m_mutex);
-
-  if (moduleName == "*") {
-    this->setDefaultLevel(level);
-    return;
-  }
-
-  m_enabledLevel[moduleName] = level;
-  auto range = m_loggers.equal_range(moduleName);
-  for (auto i = range.first; i != range.second; ++i) {
-    i->second->setLevel(level);
-  }
-}
-
-void
-Logging::setDefaultLevel(LogLevel level)
-{
-  m_enabledLevel.clear();
-  m_enabledLevel["*"] = level;
-
-  for (auto i = m_loggers.begin(); i != m_loggers.end(); ++i) {
-    i->second->setLevel(level);
-  }
-}
-
-void
-Logging::setLevelImpl(const std::string& config)
-{
-  std::stringstream ss(config);
-  std::string configModule;
-  while (std::getline(ss, configModule, ':')) {
-    size_t ind = configModule.find('=');
-    if (ind == std::string::npos) {
-      BOOST_THROW_EXCEPTION(std::invalid_argument("malformed logging config: '=' is missing"));
-    }
-
-    std::string moduleName = configModule.substr(0, ind);
-    LogLevel level = parseLogLevel(configModule.substr(ind+1));
-
-    this->setLevelImpl(moduleName, level);
-  }
-}
-
-} // namespace util
-} // namespace ndn
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp
deleted file mode 100644
index b59b927..0000000
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
-#define NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
-
-#include "common.hpp"
-
-#include <mutex>
-#include <unordered_map>
-
-namespace ndn {
-namespace util {
-
-enum class LogLevel;
-class Logger;
-
-/** \brief controls the logging facility
- *
- *  \note Public static methods are thread safe.
- *        Non-public methods are not guaranteed to be thread safe.
- */
-class Logging : noncopyable
-{
-public:
-  /** \brief register a new logger
-   *  \note App should declare a new logger with \p NDN_LOG_INIT macro.
-   */
-  static void
-  addLogger(Logger& logger);
-
-  /** \brief set severity level
-   *  \param moduleName logger name, or "*" for default level
-   *  \param level minimum severity level
-   *
-   *  Log messages are output only if its severity is greater than the set minimum severity level.
-   *  Initial default severity level is \p LogLevel::NONE which enables FATAL only.
-   *
-   *  Changing the default level overwrites individual settings.
-   */
-  static void
-  setLevel(const std::string& moduleName, LogLevel level);
-
-  /** \brief set severity levels with a config string
-   *  \param config colon-separate key=value pairs
-   *  \throw std::invalid_argument config string is malformed
-   *
-   *  \code
-   *  Logging::setSeverityLevels("*=INFO:Face=DEBUG:NfdController=WARN");
-   *  \endcode
-   *  is equivalent to
-   *  \code
-   *  Logging::setSeverityLevel("*", LogLevel::INFO);
-   *  Logging::setSeverityLevel("Face", LogLevel::DEBUG);
-   *  Logging::setSeverityLevel("NfdController", LogLevel::WARN);
-   *  \endcode
-   */
-  static void
-  setLevel(const std::string& config);
-
-private:
-  Logging();
-
-  void
-  addLoggerImpl(Logger& logger);
-
-  void
-  setLevelImpl(const std::string& moduleName, LogLevel level);
-
-  void
-  setDefaultLevel(LogLevel level);
-
-  void
-  setLevelImpl(const std::string& config);
-
-NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-  static Logging&
-  get();
-
-private:
-  std::mutex m_mutex;
-  std::unordered_map<std::string, LogLevel> m_enabledLevel; ///< moduleName => minimum level
-  std::unordered_multimap<std::string, Logger*> m_loggers; ///< moduleName => logger
-};
-
-inline void
-Logging::addLogger(Logger& logger)
-{
-  get().addLoggerImpl(logger);
-}
-
-inline void
-Logging::setLevel(const std::string& moduleName, LogLevel level)
-{
-  get().setLevelImpl(moduleName, level);
-}
-
-inline void
-Logging::setLevel(const std::string& config)
-{
-  get().setLevelImpl(config);
-}
-
-
-} // namespace util
-} // namespace ndn
-
-#endif // NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
diff --git a/app/src/main/jni/ndn-cxx-android/version.hpp b/app/src/main/jni/ndn-cxx-android/version.hpp
deleted file mode 100644
index 4ab8d5d..0000000
--- a/app/src/main/jni/ndn-cxx-android/version.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#ifndef NDN_VERSION_HPP
-#define NDN_VERSION_HPP
-
-namespace ndn {
-
-/** ndn-cxx version follows Semantic Versioning 2.0.0 specification
- *  http://semver.org/
- */
-
-/** \brief ndn-cxx version represented as an integer
- *
- *  MAJOR*1000000 + MINOR*1000 + PATCH
- */
-#define NDN_CXX_VERSION 6000
-
-/** \brief ndn-cxx version represented as a string
- *
- *  MAJOR.MINOR.PATCH
- */
-#define NDN_CXX_VERSION_STRING "0.6.0"
-
-/** \brief ndn-cxx version string, including git commit information, if ndn-cxx is build from
- *         specific git commit
- *
- * NDN_CXX_VERSION_BUILD_STRING is obtained using the following command (`ndn-cxx-` prefix is
- * afterwards removed):
- *
- *    `git describe --match 'ndn-cxx-*'`
- *
- * When ndn-cxx is built not from git, NDN_CXX_VERSION_BUILD_STRING equals NDN_CXX_VERSION_STRING
- *
- * MAJOR.MINOR.PATCH(-release-candidate-tag)(-(number-of-commits-since-tag)-COMMIT-HASH)
- *
- * Example, 0.1.0-rc1-1-g5c86570
- */
-#define NDN_CXX_VERSION_BUILD_STRING "0.6.0"
-
-/// MAJOR version
-#define NDN_CXX_VERSION_MAJOR 0
-/// MINOR version
-#define NDN_CXX_VERSION_MINOR 6
-/// PATCH version
-#define NDN_CXX_VERSION_PATCH 0
-
-} // namespace ndn
-
-#endif // NDN_VERSION_HPP
diff --git a/app/src/main/jni/ndn-cxx.mk b/app/src/main/jni/ndn-cxx.mk
deleted file mode 100644
index d12a5b6..0000000
--- a/app/src/main/jni/ndn-cxx.mk
+++ /dev/null
@@ -1,173 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-LOCAL_PATH_SAVED := $(LOCAL_PATH)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := ndn-cxx
-NDN_CXX_BOOST_LIBS = system filesystem date_time iostreams program_options chrono random
-LOCAL_SHARED_LIBRARIES := libcrypto_shared libssl_shared $(addsuffix _shared,$(addprefix boost_,$(NDN_CXX_BOOST_LIBS)))
-LOCAL_STATIC_LIBRARIES := sqlite3_static boost_regex_static
-NDN_CXX_SRC_FILES := \
-    data.cpp \
-    delegation-list.cpp \
-    delegation.cpp \
-    encoding/block-helpers.cpp \
-    encoding/block.cpp \
-    encoding/buffer-stream.cpp \
-    encoding/buffer.cpp \
-    encoding/encoder.cpp \
-    encoding/estimator.cpp \
-    encoding/nfd-constants.cpp \
-    encoding/tlv.cpp \
-    exclude.cpp \
-    face.cpp \
-    ims/in-memory-storage-entry.cpp \
-    ims/in-memory-storage-fifo.cpp \
-    ims/in-memory-storage-lfu.cpp \
-    ims/in-memory-storage-lru.cpp \
-    ims/in-memory-storage-persistent.cpp \
-    ims/in-memory-storage.cpp \
-    interest-filter.cpp \
-    interest.cpp \
-    key-locator.cpp \
-    link.cpp \
-    lp/cache-policy.cpp \
-    lp/nack-header.cpp \
-    lp/nack.cpp \
-    lp/packet.cpp \
-    meta-info.cpp \
-    mgmt/control-response.cpp \
-    mgmt/dispatcher.cpp \
-    mgmt/nfd/channel-status.cpp \
-    mgmt/nfd/command-options.cpp \
-    mgmt/nfd/control-command.cpp \
-    mgmt/nfd/control-parameters.cpp \
-    mgmt/nfd/controller.cpp \
-    mgmt/nfd/face-event-notification.cpp \
-    mgmt/nfd/face-monitor.cpp \
-    mgmt/nfd/face-query-filter.cpp \
-    mgmt/nfd/face-status.cpp \
-    mgmt/nfd/fib-entry.cpp \
-    mgmt/nfd/forwarder-status.cpp \
-    mgmt/nfd/rib-entry.cpp \
-    mgmt/nfd/status-dataset.cpp \
-    mgmt/nfd/strategy-choice.cpp \
-    mgmt/status-dataset-context.cpp \
-    name-component.cpp \
-    name.cpp \
-    net/address-converter.cpp \
-    net/detail/link-type-helper.cpp \
-    net/detail/linux-if-constants.cpp \
-    net/detail/network-monitor-impl-rtnl.cpp \
-    net/dns.cpp \
-    net/ethernet.cpp \
-    net/face-uri.cpp \
-    net/network-address.cpp \
-    net/network-interface.cpp \
-    net/network-monitor-stub.cpp \
-    net/network-monitor.cpp \
-    packet-base.cpp \
-    security/command-interest-signer.cpp \
-    security/detail/openssl-helper.cpp \
-    security/digest-sha256.cpp \
-    security/key-params.cpp \
-    security/pib/certificate-container.cpp \
-    security/pib/detail/identity-impl.cpp \
-    security/pib/detail/key-impl.cpp \
-    security/pib/identity-container.cpp \
-    security/pib/identity.cpp \
-    security/pib/key-container.cpp \
-    security/pib/key.cpp \
-    security/pib/pib-memory.cpp \
-    security/pib/pib-sqlite3.cpp \
-    security/pib/pib.cpp \
-    security/safe-bag.cpp \
-    security/security-common.cpp \
-    security/signature-sha256-with-ecdsa.cpp \
-    security/signature-sha256-with-rsa.cpp \
-    security/signing-helpers.cpp \
-    security/signing-info.cpp \
-    security/tpm/back-end-file.cpp \
-    security/tpm/back-end-mem.cpp \
-    security/tpm/back-end.cpp \
-    security/tpm/key-handle-mem.cpp \
-    security/tpm/key-handle.cpp \
-    security/tpm/tpm.cpp \
-    security/transform/base64-decode.cpp \
-    security/transform/base64-encode.cpp \
-    security/transform/block-cipher.cpp \
-    security/transform/bool-sink.cpp \
-    security/transform/buffer-source.cpp \
-    security/transform/digest-filter.cpp \
-    security/transform/hex-decode.cpp \
-    security/transform/hex-encode.cpp \
-    security/transform/hmac-filter.cpp \
-    security/transform/private-key.cpp \
-    security/transform/public-key.cpp \
-    security/transform/signer-filter.cpp \
-    security/transform/step-source.cpp \
-    security/transform/stream-sink.cpp \
-    security/transform/stream-source.cpp \
-    security/transform/strip-space.cpp \
-    security/transform/transform-base.cpp \
-    security/transform/verifier-filter.cpp \
-    security/v2/additional-description.cpp \
-    security/v2/certificate-bundle-fetcher.cpp \
-    security/v2/certificate-cache.cpp \
-    security/v2/certificate-fetcher-direct-fetch.cpp \
-    security/v2/certificate-fetcher-from-network.cpp \
-    security/v2/certificate-fetcher-offline.cpp \
-    security/v2/certificate-fetcher.cpp \
-    security/v2/certificate-storage.cpp \
-    security/v2/certificate.cpp \
-    security/v2/key-chain.cpp \
-    security/v2/trust-anchor-container.cpp \
-    security/v2/trust-anchor-group.cpp \
-    security/v2/validation-error.cpp \
-    security/v2/validation-policy-command-interest.cpp \
-    security/v2/validation-policy-config.cpp \
-    security/v2/validation-policy-simple-hierarchy.cpp \
-    security/v2/validation-policy.cpp \
-    security/v2/validation-state.cpp \
-    security/v2/validator-config/checker.cpp \
-    security/v2/validator-config/filter.cpp \
-    security/v2/validator-config/name-relation.cpp \
-    security/v2/validator-config/rule.cpp \
-    security/v2/validator.cpp \
-    security/validator-config.cpp \
-    security/validator-null.cpp \
-    security/validity-period.cpp \
-    security/verification-helpers.cpp \
-    selectors.cpp \
-    signature-info.cpp \
-    signature.cpp \
-    transport/tcp-transport.cpp \
-    transport/transport.cpp \
-    transport/unix-transport.cpp \
-    util/config-file.cpp \
-    util/dummy-client-face.cpp \
-    util/indented-stream.cpp \
-    util/io.cpp \
-    util/notification-subscriber.cpp \
-    util/random.cpp \
-    util/regex/regex-top-matcher.cpp \
-    util/scheduler-scoped-event-id.cpp \
-    util/scheduler.cpp \
-    util/segment-fetcher.cpp \
-    util/sha256.cpp \
-    util/signal/connection.cpp \
-    util/signal/scoped-connection.cpp \
-    util/sqlite3-statement.cpp \
-    util/string-helper.cpp \
-    util/time-unit-test-clock.cpp \
-    util/time.cpp \
-    ../../ndn-cxx-android/ndn-cxx-custom-logger.cpp \
-    ../../ndn-cxx-android/ndn-cxx-custom-logging.cpp
-LOCAL_SRC_FILES := $(addprefix ndn-cxx/src/,$(NDN_CXX_SRC_FILES))
-LOCAL_CPPFLAGS := -I$(LOCAL_PATH)/ndn-cxx/src -I$(LOCAL_PATH)/ndn-cxx-android -I$(LOCAL_PATH)/../../../build/generated/source/ndn-cxx
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ndn-cxx-android $(LOCAL_PATH)/../../../build/generated/source/include
-LOCAL_LDLIBS := -llog -latomic
-include $(BUILD_SHARED_LIBRARY)
-
-$(call import-module,../packages/boost/1.65.1)
-$(call import-module,../packages/sqlite/3.18.0)
-$(call import-module,../packages/openssl/1.0.2m)
diff --git a/app/src/main/jni/nfd-android/core/config.hpp b/app/src/main/jni/nfd-android/core/config.hpp
deleted file mode 100644
index 30c61c2..0000000
--- a/app/src/main/jni/nfd-android/core/config.hpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef W_CONFIG_HPP_WAF
-#define W_CONFIG_HPP_WAF
-
-#define HAVE_IS_DEFAULT_CONSTRUCTIBLE 1
-#define HAVE_IS_MOVE_CONSTRUCTIBLE 1
-#define HAVE_LIBRT
-#define HAVE_LIBRESOLV
-// #define HAVE_IFADDRS_H 1
-/*#undef HAVE_UNIX_SOCKETS*/
-#define HAVE_WEBSOCKET 1
-#define _WEBSOCKETPP_CPP11_STL_ 1
-#define DEFAULT_CONFIG_FILE "./nfd.conf"
-#define HAVE_CUSTOM_LOGGER 1
-#define NDEBUG 1
-
-#define BOOST_LOG_DYN_LINK 1
-
-#endif /* W_CONFIG_HPP_WAF */
diff --git a/app/src/main/jni/nfd-android/core/version.hpp b/app/src/main/jni/nfd-android/core/version.hpp
deleted file mode 100644
index 19a9d22..0000000
--- a/app/src/main/jni/nfd-android/core/version.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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 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, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_CORE_VERSION_HPP
-#define NFD_CORE_VERSION_HPP
-
-namespace nfd {
-
-/** NFD version follows Semantic Versioning 2.0.0 specification
- *  http://semver.org/
- */
-
-// To change version number, modify VERSION variable in top-level wscript.
-
-/** \brief NFD version represented as an integer
- *
- *  MAJOR*1000000 + MINOR*1000 + PATCH
- */
-#define NFD_VERSION 6000
-
-/** \brief NFD version represented as a string
- *
- *  MAJOR.MINOR.PATCH
- */
-#define NFD_VERSION_STRING "0.6.0"
-
-/** \brief NFD version string, including git commit information, if NFD is build from
- *         specific git commit
- *
- * NFD_VERSION_BUILD_STRING is obtained using the following command (`NFD-` prefix is
- * afterwards removed):
- *
- *    `git describe --match 'NFD-*'`
- *
- * When NFD is built not from git, NFD_VERSION_BUILD_STRING equals NFD_VERSION_STRING
- *
- * MAJOR.MINOR.PATCH(-release-candidate-tag)(-(number-of-commits-since-tag)-COMMIT-HASH)
- *
- * Example, 0.1.0-rc1-1-g5c86570
- */
-#define NFD_VERSION_BUILD_STRING "0.6.0"
-
-/// MAJOR version
-#define NFD_VERSION_MAJOR 0
-/// MINOR version
-#define NFD_VERSION_MINOR 6
-/// PATCH version
-#define NFD_VERSION_PATCH 0
-
-} // namespace nfd
-
-#endif // NFD_CORE_VERSION_HPP
diff --git a/app/src/main/jni/nfd-android/custom-logger-factory.cpp b/app/src/main/jni/nfd-android/custom-logger-factory.cpp
deleted file mode 100644
index 436bdf1..0000000
--- a/app/src/main/jni/nfd-android/custom-logger-factory.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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 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, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "custom-logger-factory.hpp"
-
-#include <boost/algorithm/string/case_conv.hpp>
-
-namespace nfd {
-
-NFD_LOG_INIT("LoggerFactory");
-
-LoggerFactory&
-LoggerFactory::getInstance()
-{
-  static LoggerFactory globalLoggerFactory;
-
-  return globalLoggerFactory;
-}
-
-LoggerFactory::LoggerFactory()
-  : m_defaultLevel(LOG_INFO)
-{
-  m_levelNames["NONE"] = LOG_NONE;
-  m_levelNames["ERROR"] = LOG_ERROR;
-  m_levelNames["WARN"] = LOG_WARN;
-  m_levelNames["INFO"] = LOG_INFO;
-  m_levelNames["DEBUG"] = LOG_DEBUG;
-  m_levelNames["TRACE"] = LOG_TRACE;
-  m_levelNames["ALL"] = LOG_ALL;
-}
-
-void
-LoggerFactory::setConfigFile(ConfigFile& config)
-{
-  config.addSectionHandler("log", bind(&LoggerFactory::onConfig, this, _1, _2, _3));
-}
-
-LogLevel
-LoggerFactory::parseLevel(const std::string& level)
-{
-  std::string upperLevel = level;
-  boost::to_upper(upperLevel);
-
-  // std::cerr << "parsing level: " << upperLevel << std::endl;;
-  // std::cerr << "# levels: " << m_levelNames.size() << std::endl;
-  // std::cerr << m_levelNames.begin()->first << std::endl;
-
-  LevelMap::const_iterator levelIt = m_levelNames.find(upperLevel);
-  if (levelIt != m_levelNames.end()) {
-    return levelIt->second;
-  }
-  try {
-    uint32_t levelNo = boost::lexical_cast<uint32_t>(level);
-
-    if ((boost::lexical_cast<uint32_t>(LOG_NONE) <= levelNo &&
-         levelNo <= boost::lexical_cast<uint32_t>(LOG_TRACE)) ||
-        levelNo == LOG_ALL) {
-      return static_cast<LogLevel>(levelNo);
-    }
-  }
-  catch (const boost::bad_lexical_cast& error) {
-  }
-  throw LoggerFactory::Error("Unsupported logging level \"" + level + "\"");
-}
-
-LogLevel
-LoggerFactory::extractLevel(const ConfigSection& item, const std::string& key)
-{
-  std::string levelString;
-  try {
-    levelString = item.get_value<std::string>();
-  }
-  catch (const boost::property_tree::ptree_error& error) {
-  }
-
-  if (levelString.empty()) {
-    throw LoggerFactory::Error("No logging level found for option \"" + key + "\"");
-  }
-
-  return parseLevel(levelString);
-}
-
-void
-LoggerFactory::onConfig(const ConfigSection& section,
-                        bool isDryRun,
-                        const std::string& filename)
-{
-// log
-// {
-//   ; default_level specifies the logging level for modules
-//   ; that are not explicitly named. All debugging levels
-//   ; listed above the selected value are enabled.
-//
-//   default_level INFO
-//
-//   ; You may also override the default for specific modules:
-//
-//   FibManager DEBUG
-//   Forwarder WARN
-// }
-
-  if (!isDryRun) {
-    ConfigSection::const_assoc_iterator item = section.find("default_level");
-    if (item != section.not_found()) {
-      LogLevel level = extractLevel(item->second, "default_level");
-      setDefaultLevel(level);
-    }
-    else {
-      setDefaultLevel(LOG_INFO);
-    }
-  }
-
-  for (ConfigSection::const_iterator item = section.begin();
-       item != section.end();
-       ++item) {
-    LogLevel level = extractLevel(item->second, item->first);
-
-    if (item->first == "default_level") {
-      // do nothing
-    }
-    else {
-      LoggerMap::iterator loggerIt = m_loggers.find(item->first);
-      if (loggerIt == m_loggers.end()) {
-        NFD_LOG_DEBUG("Failed to configure logging level for module \"" <<
-                      item->first << "\" (module not found)");
-      }
-      else if (!isDryRun) {
-        // std::cerr << "changing level for module " << item->first << " to " << level << std::endl;
-        loggerIt->second.setLogLevel(level);
-      }
-    }
-  }
-}
-
-void
-LoggerFactory::setDefaultLevel(LogLevel level)
-{
-  // std::cerr << "changing to default_level " << level << std::endl;
-
-  m_defaultLevel = level;
-  for (LoggerMap::iterator i = m_loggers.begin(); i != m_loggers.end(); ++i) {
-    // std::cerr << "changing " << i->first << " to default " << m_defaultLevel << std::endl;
-    i->second.setLogLevel(m_defaultLevel);
-  }
-}
-
-Logger&
-LoggerFactory::create(const std::string& moduleName)
-{
-  return LoggerFactory::getInstance().createLogger(moduleName);
-}
-
-Logger&
-LoggerFactory::createLogger(const std::string& moduleName)
-{
-  // std::cerr << "creating logger for " << moduleName
-  //           << " with level " << m_defaultLevel << std::endl;
-
-  std::pair<LoggerMap::iterator, bool> loggerIt =
-    m_loggers.insert(NameAndLogger(moduleName, Logger(moduleName, m_defaultLevel)));
-
-  return loggerIt.first->second;
-}
-
-std::list<std::string>
-LoggerFactory::getModules() const
-{
-  std::list<std::string> modules;
-  for (LoggerMap::const_iterator i = m_loggers.begin(); i != m_loggers.end(); ++i) {
-    modules.push_back(i->first);
-  }
-
-  return modules;
-}
-
-} // namespace nfd
diff --git a/app/src/main/jni/nfd-android/custom-logger-factory.hpp b/app/src/main/jni/nfd-android/custom-logger-factory.hpp
deleted file mode 100644
index f158b81..0000000
--- a/app/src/main/jni/nfd-android/custom-logger-factory.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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 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, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_ANDROID_CUSTOM_LOGGER_FACTORY_HPP
-#define NFD_ANDROID_CUSTOM_LOGGER_FACTORY_HPP
-
-#include "core/common.hpp"
-
-#include "core/config-file.hpp"
-#include "core/logger.hpp"
-
-namespace nfd {
-
-class LoggerFactory : noncopyable
-{
-public:
-
-  class Error : public std::runtime_error
-  {
-  public:
-    explicit
-    Error(const std::string& error)
-      : std::runtime_error(error)
-    {
-    }
-  };
-
-  static LoggerFactory&
-  getInstance();
-
-  void
-  setConfigFile(ConfigFile& config);
-
-  void
-  onConfig(const ConfigSection& section, bool isDryRun, const std::string& filename);
-
-  std::list<std::string>
-  getModules() const;
-
-  static Logger&
-  create(const std::string& moduleName);
-
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-
-  // these methods are used during unit-testing
-
-  LogLevel
-  getDefaultLevel() const;
-
-  void
-  setDefaultLevel(LogLevel level);
-
-private:
-
-  LoggerFactory();
-
-  Logger&
-  createLogger(const std::string& moduleName);
-
-  LogLevel
-  parseLevel(const std::string& level);
-
-  LogLevel
-  extractLevel(const ConfigSection& item, const std::string& key);
-
-private:
-
-  typedef std::map<std::string, LogLevel> LevelMap;
-  typedef std::pair<std::string, LogLevel> NameAndLevel;
-
-  LevelMap m_levelNames;
-
-  typedef std::map<std::string, Logger> LoggerMap;
-  typedef std::pair<std::string, Logger> NameAndLogger;
-
-  LoggerMap m_loggers;
-
-  LogLevel m_defaultLevel;
-};
-
-inline LogLevel
-LoggerFactory::getDefaultLevel() const
-{
-  return m_defaultLevel;
-}
-
-} // namespace nfd
-
-#endif // NFD_ANDROID_CUSTOM_LOGGER_FACTORY_HPP
diff --git a/app/src/main/jni/nfd-android/custom-logger.cpp b/app/src/main/jni/nfd-android/custom-logger.cpp
deleted file mode 100644
index d5e7ca1..0000000
--- a/app/src/main/jni/nfd-android/custom-logger.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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 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, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "custom-logger.hpp"
-
-namespace nfd {
-
-Logger::Logger(const std::string& name, LogLevel level)
-  : m_moduleName(name)
-  , m_enabledLogLevel(level)
-{
-}
-
-} // namespace nfd
diff --git a/app/src/main/jni/nfd-android/custom-logger.hpp b/app/src/main/jni/nfd-android/custom-logger.hpp
deleted file mode 100644
index 86ed64c..0000000
--- a/app/src/main/jni/nfd-android/custom-logger.hpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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 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, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_ANDROID_CUSTOM_LOGGER_HPP
-#define NFD_ANDROID_CUSTOM_LOGGER_HPP
-
-#include "core/common.hpp"
-#include <sstream>
-#include <android/log.h>
-
-namespace nfd {
-
-/** \brief indicates a log level
- *  \note This type is internal. Logger should be accessed through NFD_LOG_* macros.
- */
-enum LogLevel {
-  LOG_FATAL          = -1, // fatal (will be logged unconditionally)
-  LOG_NONE           = 0, // no messages
-  LOG_ERROR          = 1, // serious error messages
-  LOG_WARN           = 2, // warning messages
-  LOG_INFO           = 3, // informational messages
-  LOG_DEBUG          = 4, // debug messages
-  LOG_TRACE          = 5, // trace messages (most verbose)
-  LOG_ALL            = 255 // all messages
-};
-
-/** \brief provides logging for a module
- *  \note This type is internal. Logger should be accessed through NFD_LOG_* macros.
- *  \note This type is copyable because logger can be declared as a field of
- *        (usually template) classes, and shouldn't prevent those classes to be copyable.
- */
-class Logger
-{
-public:
-  Logger(const std::string& name, LogLevel level);
-
-  bool
-  isEnabled(LogLevel level) const
-  {
-    return m_enabledLogLevel >= level;
-  }
-
-  void
-  setLogLevel(LogLevel level)
-  {
-    m_enabledLogLevel = level;
-  }
-
-  const std::string&
-  getName() const
-  {
-    return m_moduleName;
-  }
-
-  void
-  setName(const std::string& name)
-  {
-    m_moduleName = name;
-  }
-
-private:
-  std::string m_moduleName;
-  LogLevel    m_enabledLogLevel;
-};
-
-inline std::ostream&
-operator<<(std::ostream& output, const Logger& logger)
-{
-  output << logger.getName();
-  return output;
-}
-
-} // namespace nfd
-
-#include "core/logger-factory.hpp"
-
-namespace nfd {
-
-#define NFD_LOG_INIT(name) \
-static nfd::Logger& g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_DECLARE() \
-static nfd::Logger& g_logger
-
-#define NFD_LOG_INCLASS_DEFINE(cls, name) \
-nfd::Logger& cls::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_TEMPLATE_DEFINE(cls, name) \
-template<class T>                                  \
-nfd::Logger& cls<T>::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(cls, specialization, name) \
-template<>                                                                        \
-nfd::Logger& cls<specialization>::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(cls, s1, s2, name) \
-template<>                                                                 \
-nfd::Logger& cls<s1, s2>::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG(nfdLevel, androidLevel, msg, expression)                \
-do {                                                                    \
-  if (g_logger.isEnabled(::nfd::LOG_##nfdLevel)) {                      \
-    std::ostringstream os;                                              \
-    os << expression;                                                   \
-    __android_log_print(ANDROID_LOG_##androidLevel,                     \
-                        g_logger.getName().c_str(), "%s", os.str().c_str()); \
-  }                                                                     \
-} while (false)
-
-#define NFD_LOG_TRACE(expression) NFD_LOG(TRACE, VERBOSE, TRACE, expression)
-#define NFD_LOG_DEBUG(expression) NFD_LOG(DEBUG, DEBUG, DEBUG,   expression)
-#define NFD_LOG_INFO(expression)  NFD_LOG(INFO,  INFO,  INFO,    expression)
-#define NFD_LOG_WARN(expression)  NFD_LOG(WARN,  WARN,  WARNING, expression)
-#define NFD_LOG_ERROR(expression) NFD_LOG(ERROR, ERROR, ERROR,   expression)
-#define NFD_LOG_FATAL(expression) NFD_LOG(FATAL, FATAL, FATAL,   expression)
-
-} // namespace nfd
-
-#endif // NFD_ANDROID_CUSTOM_LOGGER_HPP
diff --git a/app/src/main/jni/nfd-wrapper.cpp b/app/src/main/jni/nfd-wrapper.cpp
index a04585e..918efce 100644
--- a/app/src/main/jni/nfd-wrapper.cpp
+++ b/app/src/main/jni/nfd-wrapper.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2015-2016 Regents of the University of California
+ * Copyright (c) 2015-2018 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.
@@ -22,17 +22,18 @@
 #include "daemon/nfd.hpp"
 #include "rib/service.hpp"
 
-#include "core/global-io.hpp"
 #include "core/config-file.hpp"
+#include "core/global-io.hpp"
 #include "core/logger.hpp"
 #include "core/privilege-helper.hpp"
 
-#include <stdlib.h>
 #include <boost/property_tree/info_parser.hpp>
 #include <boost/thread.hpp>
 #include <mutex>
+#include <ndn-cxx/util/logging.hpp>
+#include <stdlib.h>
 
-NFD_LOG_INIT("NfdWrapper");
+NFD_LOG_INIT(NfdWrapper);
 
 namespace nfd {
 
@@ -48,104 +49,67 @@
 void
 resetGlobalIoService();
 
-
 class Runner
 {
 public:
   Runner()
     : m_io(nullptr)
   {
-    std::string initialConfig =
-      "general\n"
-      "{\n"
-      "}\n"
-      "\n"
-      "log\n"
-      "{\n"
-      "  default_level ALL\n"
-      "  NameTree INFO\n"
-      "  BestRouteStrategy2 INFO\n"
-      "  InternalFace INFO\n"
-      "  Forwarder INFO\n"
-      "  ContentStore INFO\n"
-      "  DeadNonceList INFO\n"
-      "}\n"
-      "tables\n"
-      "{\n"
-      "  cs_max_packets 100\n"
-      "\n"
-      "  strategy_choice\n"
-      "  {\n"
-      "    /               /localhost/nfd/strategy/best-route\n"
-      "    /localhost      /localhost/nfd/strategy/multicast\n"
-      "    /localhost/nfd  /localhost/nfd/strategy/best-route\n"
-      "    /ndn/broadcast  /localhost/nfd/strategy/multicast\n"
-      "    /ndn/multicast  /localhost/nfd/strategy/multicast\n"
-      "  }\n"
-      "}\n"
-      "\n"
-      "face_system\n"
-      "{\n"
-      "  tcp\n"
-      "  {\n"
-      "    listen yes\n"
-      "    port 6363\n"
-      "    enable_v4 yes\n"
-      "    enable_v6 yes\n"
-      "  }\n"
-      "\n"
-      "  udp\n"
-      "  {\n"
-      "    port 6363\n"
-      "    enable_v4 yes\n"
-      "    enable_v6 yes\n"
-      "    idle_timeout 600\n"
-      "    keep_alive_interval 25\n"
-      "    mcast no\n"
-      "  }\n"
-      "  websocket\n"
-      "  {\n"
-      "    listen yes\n"
-      "    port 9696\n"
-      "    enable_v4 yes\n"
-      "    enable_v6 yes\n"
-      "  }\n"
-      "}\n"
-      "\n"
-      "authorizations\n"
-      "{\n"
-      "  authorize\n"
-      "  {\n"
-      "    certfile any\n"
-      "    privileges\n"
-      "    {\n"
-      "      faces\n"
-      "      fib\n"
-      "      strategy-choice\n"
-      "    }\n"
-      "  }\n"
-      "}\n"
-      "\n"
-      "rib\n"
-      "{\n"
-      "  localhost_security\n"
-      "  {\n"
-      "    trust-anchor\n"
-      "    {\n"
-      "      type any\n"
-      "    }\n"
-      "  }\n"
-      "\n"
-      "  auto_prefix_propagate\n"
-      "  {\n"
-      "    cost 15\n"
-      "    timeout 10000\n"
-      "    refresh_interval 300\n"
-      "    base_retry_wait 50\n"
-      "    max_retry_wait 3600\n"
-      "  }\n"
-      "}\n"
-      "\n";
+    std::string initialConfig = R"CONF(
+      log
+      {
+        default_level ALL
+      }
+      tables
+      {
+        cs_max_packets 100
+        strategy_choice
+        {
+          /               /localhost/nfd/strategy/best-route
+          /localhost      /localhost/nfd/strategy/multicast
+          /localhost/nfd  /localhost/nfd/strategy/best-route
+          /ndn/broadcast  /localhost/nfd/strategy/multicast
+          /ndn/multicast  /localhost/nfd/strategy/multicast
+        }
+      }
+      face_system
+      {
+        tcp
+        udp
+        {
+          mcast no
+        }
+        websocket
+      }
+      authorizations
+      {
+        authorize
+        {
+          certfile any
+          privileges
+          {
+            faces
+            fib
+            cs
+            strategy-choice
+          }
+        }
+      }
+      rib
+      {
+        localhost_security
+        {
+          trust-anchor
+          {
+            type any
+          }
+        }
+        auto_prefix_propagate
+        {
+          refresh_interval 300
+        }
+      }
+  )CONF";
 
     std::istringstream input(initialConfig);
     boost::property_tree::read_info(input, m_config);
@@ -308,7 +272,7 @@
 
   jobject jModules = env->NewObject(jcLinkedList, jcLinkedListConstructor);
 
-  for (const auto& module : nfd::LoggerFactory::getInstance().getModules()) {
+  for (const auto& module : ndn::util::Logging::getLoggerNames()) {
     jstring jModule = env->NewStringUTF(module.c_str());
     env->CallBooleanMethod(jModules, jcLinkedListAdd, jModule);
   }
diff --git a/app/src/main/jni/nfd.mk b/app/src/main/jni/nfd.mk
deleted file mode 100644
index a2c145e..0000000
--- a/app/src/main/jni/nfd.mk
+++ /dev/null
@@ -1,131 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-LOCAL_PATH_SAVED := $(LOCAL_PATH)
-
-NFD_BOOST_LIBS = system filesystem chrono program_options random thread
-
-# nfd itself
-include $(CLEAR_VARS)
-LOCAL_MODULE := nfd-daemon
-LOCAL_SHARED_LIBRARIES := libssl_shared libcrypto_shared ndn-cxx $(addsuffix _shared,$(addprefix boost_,$(NFD_BOOST_LIBS)))
-NFD_DAEMON_SRC_FILES := \
-    core/city-hash.cpp \
-    core/config-file.cpp \
-    core/global-io.cpp \
-    core/manager-base.cpp \
-    core/network-interface-predicate.cpp \
-    core/network.cpp \
-    core/privilege-helper.cpp \
-    core/random.cpp \
-    core/rtt-estimator.cpp \
-    core/scheduler.cpp \
-    ../nfd-android/custom-logger.cpp \
-    ../nfd-android/custom-logger-factory.cpp \
-    \
-    daemon/face/channel.cpp \
-    daemon/face/face-counters.cpp \
-    daemon/face/face-system.cpp \
-    daemon/face/face.cpp \
-    daemon/face/generic-link-service.cpp \
-    daemon/face/internal-face.cpp \
-    daemon/face/internal-transport.cpp \
-    daemon/face/link-service.cpp \
-    daemon/face/lp-fragmenter.cpp \
-    daemon/face/lp-reassembler.cpp \
-    daemon/face/lp-reliability.cpp \
-    daemon/face/multicast-udp-transport.cpp \
-    daemon/face/null-face.cpp \
-    daemon/face/protocol-factory.cpp \
-    daemon/face/tcp-channel.cpp \
-    daemon/face/tcp-factory.cpp \
-    daemon/face/tcp-transport.cpp \
-    daemon/face/transport.cpp \
-    daemon/face/udp-channel.cpp \
-    daemon/face/udp-factory.cpp \
-    daemon/face/udp-protocol.cpp \
-    daemon/face/unicast-udp-transport.cpp \
-    daemon/face/websocket-channel.cpp \
-    daemon/face/websocket-factory.cpp \
-    daemon/face/websocket-transport.cpp \
-    daemon/fw/access-strategy.cpp \
-    daemon/fw/algorithm.cpp \
-    daemon/fw/asf-measurements.cpp \
-    daemon/fw/asf-probing-module.cpp \
-    daemon/fw/asf-strategy.cpp \
-    daemon/fw/best-route-strategy.cpp \
-    daemon/fw/best-route-strategy2.cpp \
-    daemon/fw/client-control-strategy.cpp \
-    daemon/fw/face-table.cpp \
-    daemon/fw/forwarder.cpp \
-    daemon/fw/multicast-strategy.cpp \
-    daemon/fw/ncc-strategy.cpp \
-    daemon/fw/process-nack-traits.cpp \
-    daemon/fw/retx-suppression-exponential.cpp \
-    daemon/fw/retx-suppression-fixed.cpp \
-    daemon/fw/strategy.cpp \
-    daemon/fw/unsolicited-data-policy.cpp \
-    daemon/main.cpp \
-    daemon/mgmt/command-authenticator.cpp \
-    daemon/mgmt/face-manager.cpp \
-    daemon/mgmt/fib-manager.cpp \
-    daemon/mgmt/forwarder-status-manager.cpp \
-    daemon/mgmt/general-config-section.cpp \
-    daemon/mgmt/nfd-manager-base.cpp \
-    daemon/mgmt/strategy-choice-manager.cpp \
-    daemon/mgmt/tables-config-section.cpp \
-    daemon/nfd.cpp \
-    daemon/table/cleanup.cpp \
-    daemon/table/cs-entry-impl.cpp \
-    daemon/table/cs-entry.cpp \
-    daemon/table/cs-policy-lru.cpp \
-    daemon/table/cs-policy-priority-fifo.cpp \
-    daemon/table/cs-policy.cpp \
-    daemon/table/cs.cpp \
-    daemon/table/dead-nonce-list.cpp \
-    daemon/table/fib-entry.cpp \
-    daemon/table/fib-nexthop.cpp \
-    daemon/table/fib.cpp \
-    daemon/table/measurements-accessor.cpp \
-    daemon/table/measurements-entry.cpp \
-    daemon/table/measurements.cpp \
-    daemon/table/name-tree-entry.cpp \
-    daemon/table/name-tree-hashtable.cpp \
-    daemon/table/name-tree-iterator.cpp \
-    daemon/table/name-tree.cpp \
-    daemon/table/network-region-table.cpp \
-    daemon/table/pit-entry.cpp \
-    daemon/table/pit-face-record.cpp \
-    daemon/table/pit-in-record.cpp \
-    daemon/table/pit-iterator.cpp \
-    daemon/table/pit-out-record.cpp \
-    daemon/table/pit.cpp \
-    daemon/table/strategy-choice-entry.cpp \
-    daemon/table/strategy-choice.cpp \
-    daemon/table/strategy-info-host.cpp \
-    \
-    rib/auto-prefix-propagator.cpp \
-    rib/fib-update.cpp \
-    rib/fib-updater.cpp \
-    rib/propagated-entry.cpp \
-    rib/readvertise/client-to-nlsr-readvertise-policy.cpp \
-    rib/readvertise/nfd-rib-readvertise-destination.cpp \
-    rib/readvertise/readvertise-destination.cpp \
-    rib/readvertise/readvertise.cpp \
-    rib/readvertise/readvertised-route.cpp \
-    rib/rib-entry.cpp \
-    rib/rib-manager.cpp \
-    rib/rib-update-batch.cpp \
-    rib/rib-update.cpp \
-    rib/rib.cpp \
-    rib/route.cpp \
-    rib/service.cpp
-LOCAL_SRC_FILES := $(addprefix NFD/,$(NFD_DAEMON_SRC_FILES))
-LOCAL_CPPFLAGS := \
-    -I$(LOCAL_PATH)/nfd-android \
-    -I$(LOCAL_PATH)/NFD \
-    -I$(LOCAL_PATH)/NFD/core \
-    -I$(LOCAL_PATH)/NFD/daemon \
-    -I$(LOCAL_PATH)/NFD/rib \
-    -I$(LOCAL_PATH)/NFD/websocketpp
-LOCAL_LDLIBS := -llog
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/nfd-android $(LOCAL_PATH)/NFD
-include $(BUILD_SHARED_LIBRARY)
