gui: Refactoring and integration of nfd start/stop and log viewer under main activity

Change-Id: Iad1a7a4f85b74dd488d992107fc1ae7eb5f87f11
Refs: #2434
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index ee8e9b5..0000000
--- a/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    tools:context=".MainActivity">
-
-    <Button
-        android:id="@+id/nfd_button"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:onClick="toggleNfdState"
-        android:enabled="false"
-        android:text="@string/checking_on_nfd" />
-
-    <Button
-        android:id="@+id/launch_logger"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/nfd_button"
-        android:onClick="launchLogActivity"
-        android:text="@string/launch_logger" />
-
-</RelativeLayout>
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
deleted file mode 100644
index e80d2f5..0000000
--- a/app/src/main/res/menu/menu_main.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    tools:context=".MainActivity">
-
-    <item android:id="@+id/action_settings"
-        android:title="@string/action_settings"
-        android:orderInCategory="100"
-        app:showAsAction="never" />
-
-</menu>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4e48935..a8f78fd 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -9,17 +9,8 @@
     <string name="starting_nfd">Starting NFD ...</string>
     <string name="reconnect_to_nfd">Reconnecting to NFD Service</string>
     <string name="loading_logger">Loading logger ...</string>
-    <string name="log_level_verbose">Verbose</string>
-    <string name="log_level_debug">Debug</string>
-    <string name="log_level_info">Info</string>
-    <string name="log_level_warn">Warn</string>
-    <string name="log_level_error">Error</string>
-    <string name="log_level_assert">Assert</string>
-    <string name="log_level_fatal">Fatal</string>
-    <string name="log_level_silent">Silent</string>
     <string name="nfd_logger">NFD Logger</string>
     <string name="log_settings">Log Settings</string>
     <string name="nfd_log_settings">NFD Log Settings</string>
     <string name="checking_on_nfd">Checking on NFD Service ...</string>
-    <string name="launch_logger">Launch Logger!</string>
 </resources>
diff --git a/app/src/main/res/values/strings_activity_nfd_settings.xml b/app/src/main/res/values/strings_logcat_settings_activity.xml
similarity index 95%
rename from app/src/main/res/values/strings_activity_nfd_settings.xml
rename to app/src/main/res/values/strings_logcat_settings_activity.xml
index e55844b..36e89a7 100644
--- a/app/src/main/res/values/strings_activity_nfd_settings.xml
+++ b/app/src/main/res/values/strings_logcat_settings_activity.xml
@@ -2,10 +2,6 @@
 
     <!-- Strings related to NFD Log Settings -->
 
-    <!-- General -->
-    <string name="pref_category_title_general">General</string>
-    <string name="pref_category_title_general_key">General_Key</string>
-
     <!-- Set all tags log level -->
     <string name="pref_tags_log_level_title_key">All_Log_Levels_Key</string>
     <string name="pref_tags_log_level_title">All Log Levels</string>
diff --git a/app/src/main/res/values/strings_main_activity.xml b/app/src/main/res/values/strings_main_activity.xml
new file mode 100644
index 0000000..9a41a2f
--- /dev/null
+++ b/app/src/main/res/values/strings_main_activity.xml
@@ -0,0 +1,63 @@
+<resources>
+    <!-- General -->
+    <string name="pref_category_title_general">General</string>
+    <string name="pref_category_title_general_key">General_Key</string>
+
+    <string-array name="pref_sync_face_titles">
+        <item>localhost</item>
+    </string-array>
+
+    <string-array name="pref_sync_face_values">
+        <item>localhost</item>
+    </string-array>
+
+    <string name="pref_title_system_settings">System settings</string>
+    <string name="pref_title_rib_settings">RIB settings</string>
+    <string name="pref_title_strategy_settings">Strategy settings</string>
+    <string name="pref_title_Face_settings">Face settings</string>
+    <string name="pref_title_Face_group">Face Group</string>
+    <string name="pref_title_FIB_group">FIB Group</string>
+    <string name="pref_title_RIB_group">RIB Group</string>
+    <string name="pref_title_Strategy_group">Strategy Group</string>
+
+    <!-- Example settings for Notifications -->
+    <string name="pref_header_notifications">NFD Face</string>
+
+    <string name="pref_header_face">NFD Face</string>
+    <string name="pref_header_rib">NFD RIB</string>
+    <string name="pref_header_fib">NFD FIB</string>
+    <string name="pref_header_strategy">NFD Strategy</string>
+    <string name="pref_title_add_uri">Pick uri</string>
+
+    <string-array name="pref_uri_list_titles">
+        <item>None</item>
+    </string-array>
+    <string-array name="pref_uri_list_values">
+        <item>1</item>
+    </string-array>
+
+    <string-array name="pref_strategy_entries">
+        <item>ndn:/localhost/nfd/strategy/best-route</item>
+        <item>ndn:/localhost/nfd/strategy/broadcast</item>
+        <item>ndn:/localhost/nfd/strategy/client-control</item>
+        <item>ndn:/localhost/nfd/strategy/ncc</item>
+    </string-array>
+
+    <string name="pref_uri_display_name">URI</string>
+    <string name="pref_default_uri_name">udp4://127.0.0.1:6363</string>
+
+    <string name="pref_route_display_name">Route</string>
+    <string name="pref_default_route_name">localhost</string>
+    <string name="pref_cost_display_name">Cost</string>
+    <string name="pref_default_cost_name">0</string>
+    <string name="pref_face_display_name">Face Id</string>
+    <string name="pref_default_face_name">localhost</string>
+    <string name="pref_prefix_display_name">Prefix</string>
+    <string name="pref_default_prefix_name">localhost</string>
+    <string name="pref_strategy_display_name">Strategy</string>
+    <string name="pref_default_strategy_name">localhost</string>
+    <string name="pref_addNextHop_display_name">Next Hop</string>
+    <string name="pref_default_addNextHop_name">localhost</string>
+    <string name="pref_nfd_dialog_title">URI Selection</string>
+    <string name="pref_nfd_summary">Select an URI</string>
+</resources>
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
new file mode 100644
index 0000000..7195806
--- /dev/null
+++ b/app/src/main/res/xml/pref_general.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+  <!-- General section -->
+  <PreferenceCategory
+      android:key="@string/pref_category_title_general"
+      android:title="@string/pref_category_title_general">
+
+    <Preference
+      android:title="@string/start_nfd"
+      android:key="start_stop" />
+
+    <PreferenceScreen
+      android:title="NFD log"
+      android:key="nfd_log">
+        <intent
+            android:action="android.intent.action.VIEW"
+            android:targetPackage="net.named_data.nfd"
+            android:targetClass="net.named_data.nfd.LogcatActivity" />
+    </PreferenceScreen>
+
+  </PreferenceCategory>
+</PreferenceScreen>