Browse Source

Merged some views from hostagev2_rc branch

Lars Pandikow 10 years ago
parent
commit
89e24464c0
41 changed files with 1561 additions and 883 deletions
  1. 1 1
      AndroidManifest.xml
  2. BIN
      res/drawable-hdpi/ic_action_cancel_dark.png
  3. BIN
      res/drawable-hdpi/ic_action_refresh.png
  4. BIN
      res/drawable-hdpi/ic_action_save.png
  5. BIN
      res/drawable-hdpi/ic_filter_pressed.png
  6. BIN
      res/drawable-mdpi/ic_action_cancel_dark.png
  7. BIN
      res/drawable-mdpi/ic_action_refresh.png
  8. BIN
      res/drawable-mdpi/ic_action_save.png
  9. BIN
      res/drawable-xhdpi/ic_action_cancel_dark.png
  10. BIN
      res/drawable-xhdpi/ic_action_refresh.png
  11. BIN
      res/drawable-xhdpi/ic_action_save.png
  12. BIN
      res/drawable-xxhdpi/ic_action_cancel_dark.png
  13. BIN
      res/drawable-xxhdpi/ic_action_refresh.png
  14. BIN
      res/drawable-xxhdpi/ic_action_save.png
  15. BIN
      res/drawable-xxxhdpi/ic_swipe_action.png
  16. BIN
      res/drawable/cased_logo.png
  17. 19 0
      res/drawable/panel_help_bg.xml
  18. BIN
      res/drawable/tk_logo.png
  19. BIN
      res/drawable/tud_logo.png
  20. 9 0
      res/layout-land/fragment_statistics.xml
  21. 15 15
      res/layout/activity_loglist.xml
  22. 21 21
      res/layout/date_time_dialog.xml
  23. 32 3
      res/layout/fragment_about.xml
  24. 4 4
      res/layout/fragment_home.xml
  25. 78 69
      res/layout/fragment_record_list.xml
  26. 23 6
      res/layout/fragment_record_overview.xml
  27. 9 0
      res/layout/fragment_statistics.xml
  28. 24 24
      res/layout/loglist_row.xml
  29. 15 7
      res/layout/profile_manager_list_item.xml
  30. 49 0
      res/layout/profile_manager_list_item_help.xml
  31. 51 51
      res/layout/record_list_item.xml
  32. 13 0
      res/menu/records_overview_actions.xml
  33. 29 0
      res/values-de/protocols.xml
  34. 61 28
      res/values-de/strings.xml
  35. 41 6
      res/values/strings.xml
  36. 8 8
      res/xml/profile_preferences.xml
  37. 20 33
      res/xml/settings_preferences.xml
  38. 24 9
      src/de/tudarmstadt/informatik/hostage/logging/LogExport.java
  39. 18 6
      src/de/tudarmstadt/informatik/hostage/ui2/adapter/ExpandableListAdapter.java
  40. 58 58
      src/de/tudarmstadt/informatik/hostage/ui2/adapter/RecordListAdapter.java
  41. 939 534
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/RecordOverviewFragment.java

+ 1 - 1
AndroidManifest.xml

@@ -38,7 +38,7 @@
             android:value="@integer/google_play_services_version" />
         <meta-data
             android:name="com.google.android.maps.v2.API_KEY"
-            android:value="AIzaSyCqh4bb4aMzvDcpDfiqHyXoAWFTQ6iNxe8" />
+            android:value="AIzaSyAnx2pJeNk4Mac72Hwbqq-aZlm2lF1XKeE" />
         
         <meta-data android:name="android.nfc.disable_beam_default"
          	android:value="true" />

BIN
res/drawable-hdpi/ic_action_cancel_dark.png


BIN
res/drawable-hdpi/ic_action_refresh.png


BIN
res/drawable-hdpi/ic_action_save.png


BIN
res/drawable-hdpi/ic_filter_pressed.png


BIN
res/drawable-mdpi/ic_action_cancel_dark.png


BIN
res/drawable-mdpi/ic_action_refresh.png


BIN
res/drawable-mdpi/ic_action_save.png


BIN
res/drawable-xhdpi/ic_action_cancel_dark.png


BIN
res/drawable-xhdpi/ic_action_refresh.png


BIN
res/drawable-xhdpi/ic_action_save.png


BIN
res/drawable-xxhdpi/ic_action_cancel_dark.png


BIN
res/drawable-xxhdpi/ic_action_refresh.png


BIN
res/drawable-xxhdpi/ic_action_save.png


BIN
res/drawable-xxxhdpi/ic_swipe_action.png


BIN
res/drawable/cased_logo.png


+ 19 - 0
res/drawable/panel_help_bg.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+	<!-- Bottom 3dp Shadow -->
+	<item>
+		<shape android:shape="rectangle">
+			<solid android:color="#C7C6C5" />
+		</shape>
+	</item>
+
+	<!-- White Top color -->
+	<item android:bottom="2px" android:top="2px">
+		<shape android:shape="rectangle">
+			<solid android:color="@color/bright_grey" />
+		</shape>
+
+	</item>
+
+</layer-list>

BIN
res/drawable/tk_logo.png


BIN
res/drawable/tud_logo.png


+ 9 - 0
res/layout-land/fragment_statistics.xml

@@ -24,6 +24,15 @@
             android:id="@+id/plot_parent_layout"
             android:layout_weight="0.9">
 
+            <ProgressBar
+                android:id="@+id/progressBar1"
+                style="?android:attr/progressBarStyleLarge"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerHorizontal="true"
+                android:layout_centerVertical="true"
+                android:visibility="gone"/>
+
             <!-- TITLE LAYOUT -->
             <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                 android:orientation="vertical"

+ 15 - 15
res/layout/activity_loglist.xml

@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
-    <ListView
-        android:id="@+id/loglistview"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_alignParentTop="true" >
-
-    </ListView>
-
-</RelativeLayout>
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" >
+
+    <ListView
+        android:id="@+id/loglistview"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentTop="true" >
+
+    </ListView>
+
+</RelativeLayout>

+ 21 - 21
res/layout/date_time_dialog.xml

@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/DateTimePicker"
-    android:layout_width="wrap_content"
-    android:layout_height="fill_parent"
-    android:gravity="center"
-    android:orientation="vertical"
-    android:padding="5dip" >
-
-    <DatePicker
-        android:id="@+id/DatePicker"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-         />
-
-    <TimePicker
-        android:id="@+id/TimePicker"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-         />
-
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/DateTimePicker"
+    android:layout_width="wrap_content"
+    android:layout_height="fill_parent"
+    android:gravity="center"
+    android:orientation="vertical"
+    android:padding="5dip" >
+
+    <DatePicker
+        android:id="@+id/DatePicker"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+         />
+
+    <TimePicker
+        android:id="@+id/TimePicker"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+         />
+
 </LinearLayout>

+ 32 - 3
res/layout/fragment_about.xml

@@ -10,7 +10,6 @@
 			android:layout_height="match_parent"
 			android:id="@+id/imageView" android:src="@drawable/hostage_logo_tilted"
 			android:layout_weight="0.6" android:layout_margin="24dp"/>
-
 	<TextView
 			android:layout_width="wrap_content"
 			android:layout_height="wrap_content"
@@ -25,16 +24,18 @@
 			android:text="a low-interaction honeypot for mobile devices"
 			android:id="@+id/textView7" android:layout_gravity="center_horizontal"
 			/>
+
     <ScrollView android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="15dp"
                 android:layout_marginBottom="10dp"
                 android:layout_marginRight="15dp">
+
 	<RelativeLayout
 			android:orientation="horizontal"
 			android:layout_width="fill_parent"
 			android:layout_height="fill_parent" android:layout_weight="0.7"
-			android:paddingTop="20dp">
+			android:paddingTop="15dp">
 
 		<LinearLayout
 				android:orientation="vertical"
@@ -101,7 +102,7 @@
 			          android:textAlignment="center" android:layout_gravity="right"/>
 			<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"
 			          android:textAppearance="?android:attr/textAppearanceMedium"
-			          android:text="Wulf Pfeiffer" android:id="@+id/record_conversation_type"
+			          android:text="Wulf Pfeiffer" 
 			          android:singleLine="false"
 			          android:autoText="false" android:layout_marginTop="4dp"
 			          android:textAlignment="center" android:layout_gravity="right"/>
@@ -114,4 +115,32 @@
 		</LinearLayout>
 	</RelativeLayout>
     </ScrollView>
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:layout_weight="1"
+        android:paddingTop="5dp"
+        android:layout_marginBottom="5dp">
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/tud_logo"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp"
+            android:layout_weight="0.5"/>
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/cased_logo"
+            android:layout_marginRight="5dp"
+            android:layout_weight="0.5"/>
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/tk_logo"
+            android:layout_marginLeft="5dp"
+            android:layout_marginRight="5dp"
+            android:layout_weight="0.1"/>
+    </LinearLayout>
 </LinearLayout>

+ 4 - 4
res/layout/fragment_home.xml

@@ -91,10 +91,10 @@
                 android:id="@+id/home_button_connection_info"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_alignParentEnd="true"
+                android:src="@android:drawable/ic_menu_info_details"
+                android:layout_alignTop="@+id/home_text_name"
                 android:layout_alignParentRight="true"
-                android:layout_alignParentTop="true"
-                android:src="@android:drawable/ic_menu_info_details" />
+                android:layout_alignParentEnd="true"/>
         </RelativeLayout>
 
         <TextView
@@ -148,7 +148,7 @@
 			        android:src="@drawable/ic_launcher"
 			        android:scaleType="fitCenter"
 			        android:layout_alignBottom="@+id/home_text_profile"
-			        android:layout_toLeftOf="@+id/home_text_profile_header"
+			        android:layout_toLeftOf="@+id/home_text_profile"
 			        android:layout_alignTop="@+id/home_text_profile_header"/>
         </RelativeLayout>
     </LinearLayout>

+ 78 - 69
res/layout/fragment_record_list.xml

@@ -1,69 +1,78 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="@android:color/transparent"
-    >
-
-            <ExpandableListView
-                xmlns:android="http://schemas.android.com/apk/res/android"
-                android:id="@+id/loglistview"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_above="@+id/linearLayout"
-                android:layout_alignParentLeft="true"
-                android:layout_alignParentTop="true"
-                android:layout_marginLeft="0dp"
-                android:layout_marginTop="0dp"
-                android:background="@android:color/transparent"
-                android:choiceMode="singleChoice"
-                android:divider="@android:color/transparent"
-                android:dividerHeight="5dp"
-                android:padding="5dp"
-                android:headerDividersEnabled="false"
-                android:childDivider="@android:color/transparent">
-
-    </ExpandableListView>
-
-    <RelativeLayout
-        style="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"
-        android:orientation="horizontal"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:alpha="0.8"
-        android:id="@+id/linearLayout"
-        android:layout_alignParentBottom="true" android:layout_alignParentLeft="true"
-        android:layout_alignParentStart="true">
-
-        <ImageButton
-            style="@android:style/Widget.DeviceDefault.ActionButton.Overflow"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:id="@+id/SortButton"
-            android:src="@drawable/ic_sort_by_size"
-            android:layout_gravity="right"
-            android:layout_alignParentTop="true"
-            android:layout_alignParentRight="true"
-            android:layout_alignParentEnd="true"/>
-
-        <ImageButton
-            style="@android:style/Widget.DeviceDefault.ActionButton.Overflow"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:id="@+id/FilterButton"
-            android:src="@drawable/ic_filter"
-            android:layout_alignParentTop="true"
-            android:layout_toLeftOf="@+id/GroupButton"/>
-
-        <ImageButton
-            style="@android:style/Widget.DeviceDefault.ActionButton.Overflow"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:id="@+id/GroupButton"
-            android:src="@drawable/ic_device_access_storage"
-            android:layout_alignParentTop="true"
-            android:layout_toLeftOf="@+id/SortButton"/>
-    </RelativeLayout>
-
-
-</RelativeLayout>
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@android:color/transparent"
+    >
+
+    <ProgressBar
+        android:id="@+id/progressBar1"
+        style="?android:attr/progressBarStyleLarge"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_centerVertical="true"
+        android:visibility="gone"/>
+
+            <ExpandableListView
+                xmlns:android="http://schemas.android.com/apk/res/android"
+                android:id="@+id/loglistview"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_above="@+id/linearLayout"
+                android:layout_alignParentLeft="true"
+                android:layout_alignParentTop="true"
+                android:layout_marginLeft="0dp"
+                android:layout_marginTop="0dp"
+                android:background="@android:color/transparent"
+                android:choiceMode="singleChoice"
+                android:divider="@android:color/transparent"
+                android:dividerHeight="5dp"
+                android:padding="5dp"
+                android:headerDividersEnabled="false"
+                android:childDivider="@android:color/transparent">
+
+    </ExpandableListView>
+
+    <RelativeLayout
+        style="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"
+        android:orientation="horizontal"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:alpha="0.8"
+        android:id="@+id/linearLayout"
+        android:layout_alignParentBottom="true" android:layout_alignParentLeft="true"
+        android:layout_alignParentStart="true">
+
+        <ImageButton
+            style="@android:style/Widget.DeviceDefault.ActionButton.Overflow"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/SortButton"
+            android:src="@drawable/ic_sort_by_size"
+            android:layout_gravity="right"
+            android:layout_alignParentTop="true"
+            android:layout_alignParentRight="true"
+            android:layout_alignParentEnd="true"/>
+
+        <ImageButton
+            style="@android:style/Widget.DeviceDefault.ActionButton.Overflow"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/FilterButton"
+            android:src="@drawable/ic_filter"
+            android:layout_alignParentTop="true"
+            android:layout_toLeftOf="@+id/GroupButton"/>
+
+        <ImageButton
+            style="@android:style/Widget.DeviceDefault.ActionButton.Overflow"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/GroupButton"
+            android:src="@drawable/ic_device_access_storage"
+            android:layout_alignParentTop="true"
+            android:layout_toLeftOf="@+id/SortButton"/>
+    </RelativeLayout>
+
+
+</RelativeLayout>

+ 23 - 6
res/layout/fragment_record_overview.xml

@@ -7,12 +7,20 @@
             android:fillViewport="true">
 
 	<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-	              android:orientation="vertical"
-	              android:layout_width="match_parent"
-	              android:layout_height="wrap_content"
-	              android:measureWithLargestChild="false"
-	              android:baselineAligned="true"
-	              android:id="@+id/record_overview_conversation">
+				  android:orientation="vertical"
+				  android:layout_width="match_parent"
+				  android:layout_height="wrap_content"
+				  android:measureWithLargestChild="false"
+				  android:baselineAligned="true"
+				  android:id="@+id/linearLayout3">
+
+		<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+					  android:orientation="vertical"
+					  android:layout_width="match_parent"
+					  android:layout_height="wrap_content"
+					  android:measureWithLargestChild="false"
+					  android:baselineAligned="true"
+					  android:id="@+id/record_overview_conversation">
 
 		<RelativeLayout
 				android:layout_width="match_parent"
@@ -133,5 +141,14 @@
 				android:layout_marginTop="10dp"
 				android:layout_marginBottom="20dp"/>
 
+	</LinearLayout>
+
+
+		<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
+				android:text="@string/delete" android:id="@+id/record_delete_button"
+				android:layout_gravity="center_horizontal" android:layout_weight="0"
+				android:layout_margin="8dp" android:background="@color/holo_red"
+				android:textColor="@android:color/white"/>
+
 	</LinearLayout>
 </ScrollView>

+ 9 - 0
res/layout/fragment_statistics.xml

@@ -21,6 +21,15 @@
                 android:id="@+id/plot_parent_layout"
                 android:layout_weight="0.9">
 
+                <ProgressBar
+                    android:id="@+id/progressBar1"
+                    style="?android:attr/progressBarStyleLarge"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerHorizontal="true"
+                    android:layout_centerVertical="true"
+                    android:visibility="gone"/>
+
                 <!-- TITLE LAYOUT -->
                 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                     android:orientation="vertical"

+ 24 - 24
res/layout/loglist_row.xml

@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<RelativeLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:id="@+id/profile_manager_root_view">
-
-    <ListView
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/profile_manager_listview"
-        android:choiceMode="singleChoice"
-        android:background="#F2F2F2"
-        android:dividerHeight="10dp"
-        android:divider="@android:color/transparent"
-        android:padding="5dp"
-        android:layout_alignParentLeft="true"
-        android:layout_marginLeft="0dp"
-        android:layout_alignParentTop="true"
-        android:layout_marginTop="0dp" />
-
+<?xml version="1.0" encoding="utf-8"?>
+
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:id="@+id/profile_manager_root_view">
+
+    <ListView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        android:id="@+id/profile_manager_listview"
+        android:choiceMode="singleChoice"
+        android:background="#F2F2F2"
+        android:dividerHeight="10dp"
+        android:divider="@android:color/transparent"
+        android:padding="5dp"
+        android:layout_alignParentLeft="true"
+        android:layout_marginLeft="0dp"
+        android:layout_alignParentTop="true"
+        android:layout_marginTop="0dp" />
+
 </RelativeLayout>

+ 15 - 7
res/layout/profile_manager_list_item.xml

@@ -1,8 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:layout_width="wrap_content"
-              android:layout_height="wrap_content">
+	<FrameLayout
+			xmlns:android="http://schemas.android.com/apk/res/android"
+			  android:layout_width="wrap_content"
+              android:layout_height="wrap_content"
+              android:layout_alignParentLeft="true"
+              android:layout_marginLeft="0dp"
+              android:layout_alignParentTop="true"
+              android:layout_marginTop="0dp"
+			>
 
 	<RelativeLayout
         android:id="@+id/swipelist_backview"
@@ -55,7 +61,7 @@
 	<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 	                android:id="@+id/swipelist_frontview"
 	                android:layout_width="match_parent"
-	                android:layout_height="wrap_content"
+	                android:layout_height="match_parent"
 	                android:padding="5dp"
 	                android:baselineAligned="false"
 	                android:background="@drawable/panel_bg_selector">
@@ -117,13 +123,12 @@
 				android:orientation="horizontal"
 				android:layout_width="fill_parent"
 				android:layout_height="fill_parent"
-				android:layout_alignParentBottom="true"
 				android:layout_below="@+id/profile_manager_item_text"
 				android:padding="10dp"
 				f:horizontalSpacing="10dip"
 				f:verticalSpacing="10dip"
 				android:layout_alignParentRight="true"
-				android:layout_alignParentEnd="true"
+				android:layout_alignParentEnd="false"
 				android:id="@+id/badges_container">
 			<TextView
 					android:layout_width="wrap_content"
@@ -163,5 +168,8 @@
 			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/textView7" android:layout_gravity="center_vertical"
 			          android:layout_marginLeft="10dp"/>
 		</de.tudarmstadt.informatik.hostage.ui2.layouts.FlowLayout>
+
 	</RelativeLayout>
-</FrameLayout>
+
+
+	</FrameLayout>

+ 49 - 0
res/layout/profile_manager_list_item_help.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:orientation="vertical"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:id="@+id/swipelist_frontview"
+              android:background="@drawable/panel_help_bg"
+              android:padding="10dp">
+
+	<TextView
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:textAppearance="?android:attr/textAppearanceSmall"
+			android:text="@string/profile_help_swipe"
+			android:id="@+id/textView"
+			android:layout_alignParentTop="true"
+			android:layout_toRightOf="@+id/imageView"
+			android:layout_marginLeft="15dp"
+			android:layout_toLeftOf="@+id/profile_manager_help_dismiss"/>
+
+	<ImageView
+			android:layout_width="50dp"
+			android:layout_height="wrap_content"
+			android:id="@+id/imageView"
+			android:src="@drawable/ic_swipe_action"
+			android:layout_alignParentTop="true"
+			android:layout_alignParentLeft="true"
+			android:layout_alignParentStart="true"
+			android:layout_alignBottom="@+id/textView"
+			android:scaleType="fitCenter"/>
+
+	<FrameLayout
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:id="@+id/swipelist_backview">
+	</FrameLayout>
+
+	<ImageView
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:id="@+id/profile_manager_help_dismiss"
+			android:src="@drawable/ic_action_cancel_dark"
+			android:layout_alignParentTop="true"
+			android:layout_alignParentRight="true"
+			android:layout_alignParentEnd="true"
+			android:layout_alignBottom="@+id/textView"/>
+
+</RelativeLayout>

+ 51 - 51
res/layout/record_list_item.xml

@@ -1,52 +1,52 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:padding="5dp"
-    android:baselineAligned="false"
-    android:background="@drawable/panel_bg">
-
-    <TextView
-        android:id="@+id/RecordTextFieldBSSID"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_alignParentTop="true"
-        android:text="BSSID"
-        android:textAppearance="?android:attr/textAppearanceLarge"
-        android:textColor="#000000" />
-
-    <TextView
-        android:id="@+id/RecordTextFieldSSID"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignLeft="@+id/RecordTextFieldBSSID"
-        android:layout_below="@+id/RecordTextFieldBSSID"
-        android:layout_marginTop="24dp"
-        android:text="ESSID"
-        android:textAppearance="?android:attr/textAppearanceSmall" />
-
-    <TextView
-        android:id="@+id/RecordTextFieldTimestamp"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignBaseline="@+id/RecordTextFieldSSID"
-        android:layout_alignBottom="@+id/RecordTextFieldSSID"
-        android:layout_alignParentRight="true"
-        android:layout_marginRight="5dp"
-        android:text="00:00:00"
-        android:textAppearance="?android:attr/textAppearanceSmall" />
-
-    <TextView
-        android:id="@+id/RecordTextFieldProtocol"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignBaseline="@+id/RecordTextFieldBSSID"
-        android:layout_alignBottom="@+id/RecordTextFieldBSSID"
-        android:layout_alignRight="@+id/RecordTextFieldTimestamp"
-        android:text="Protocol"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:textColor="#000000" />
-
+<?xml version="1.0" encoding="utf-8"?>
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:padding="5dp"
+    android:baselineAligned="false"
+    android:background="@drawable/panel_bg">
+
+    <TextView
+        android:id="@+id/RecordTextFieldBSSID"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentLeft="true"
+        android:layout_alignParentTop="true"
+        android:text="BSSID"
+        android:textAppearance="?android:attr/textAppearanceLarge"
+        android:textColor="#000000" />
+
+    <TextView
+        android:id="@+id/RecordTextFieldSSID"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@+id/RecordTextFieldBSSID"
+        android:layout_below="@+id/RecordTextFieldBSSID"
+        android:layout_marginTop="24dp"
+        android:text="ESSID"
+        android:textAppearance="?android:attr/textAppearanceSmall" />
+
+    <TextView
+        android:id="@+id/RecordTextFieldTimestamp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBaseline="@+id/RecordTextFieldSSID"
+        android:layout_alignBottom="@+id/RecordTextFieldSSID"
+        android:layout_alignParentRight="true"
+        android:layout_marginRight="5dp"
+        android:text="00:00:00"
+        android:textAppearance="?android:attr/textAppearanceSmall" />
+
+    <TextView
+        android:id="@+id/RecordTextFieldProtocol"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBaseline="@+id/RecordTextFieldBSSID"
+        android:layout_alignBottom="@+id/RecordTextFieldBSSID"
+        android:layout_alignRight="@+id/RecordTextFieldTimestamp"
+        android:text="Protocol"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textColor="#000000" />
+
 </RelativeLayout>

+ 13 - 0
res/menu/records_overview_actions.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+	<item android:id="@+id/records_action_export"
+	      android:icon="@drawable/ic_action_save"
+	      android:title="Export to storage"
+	      android:showAsAction="always" />
+
+	<item android:id="@+id/records_action_synchronize"
+	      android:icon="@drawable/ic_action_refresh"
+	      android:title="Synchronize"
+	      android:showAsAction="always" />
+</menu>

+ 29 - 0
res/values-de/protocols.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <string-array name="protocols">
+        <item>ECHO</item>
+        <item>FTP</item>
+        <item>GHOST</item>
+        <item>HTTP</item>
+        <item>HTTPS</item>
+        <item>MySQL</item>
+        <item>SIP</item>
+        <item>SMB</item>
+        <item>SSH</item>
+        <item>TELNET</item>
+    </string-array>
+
+    <string-array name="protocols_description">
+        <item>Protokoll zum testen und messen der round-trip time</item>
+        <item>Protokoll zum Datentransfer zwischen Client/Server und Server/Server</item>
+        <item>Protokoll zum Spiegeln von eingehenden Verbindungen. Antwort erfolgt auf dem selben Port wie die eingegangene Verbindung</item>
+        <item>Datenübertragungsprotokoll für Webseiten</item>
+        <item>Genau wie HTTP mit zusätzlicher Sicherung der Verbindung mittels SSL/TLS</item>
+        <item>Weit verbreitetes relationelles Datenbank Management System</item>
+        <item>Dieses Protokoll wird für VoIP(Voice over IP) Dienste genutzt</item>
+        <item>Protokoll um Daten, Drucker und mehr in einem Netzwerk zu teilen</item>
+        <item>Netzwerkprotokoll das Datenzugriff, Datentransfer und Datenmanagement Funktionen über einen vertrauenswürdigen Datenstrom bereitstellt</item>
+        <item>Netzwerkprotokoll das genutzt wird um eine bidirektionale interaktive Kommunikation in einem virtuellen Terminal zu ermöglichen</item>
+    </string-array>
+</resources>

+ 61 - 28
res/values-de/strings.xml

@@ -9,11 +9,11 @@
     <string name="title_connection_info">Verbindungs Info</string>
     <string name="status">Status</string>
     <string name="paranoid">Paranoid Mode</string>
-    <string name="details">Verbindungs info</string>
+    <string name="details">Verbindungs Info</string>
     <string name="not_connected">Nicht verbunden</string>
     <string name="attack">&#160;Angriff</string>
     <string name="attacks">&#160;Angriffe</string>
-    <string name="portscan">&#160;Portscan</string>
+	<string name="portscan">&#160;Portscan</string>
     <string name="portscans">&#160;Portscans</string>
     <string name="secure">Sicher</string>
     <string name="insecure">Unsicher</string>
@@ -23,14 +23,14 @@
 
     <string name="information">Information</string>
     <string name="wifi_not_connected_msg">Sie sind nicht mit einem WLAN Netzwerk verbunden. \n\nBitte verbinden sie sich mit einem, bevor sie HosTaGe starten.</string>
-	<string name="profile_no_services_msg">Das aktive Profil scheint keine Dienste zu überwachen.\n\nBitte aktivieren Sie Dienste in dem aktiven Profil.</string>
+	<string name="profile_no_services_msg">Das aktive Profil scheint keine Dienste zu &#252;berwachen.\n\nBitte aktivieren Sie Dienste in dem aktiven Profil.</string>
 
-    <string name="monitor_current_connection">Überwache aktuelle Verbindung</string>
+    <string name="monitor_current_connection">&#220;berwache Verbindung</string>
     <string name="active_profile">Aktives Profil: </string>
 
     <string name="ssid">SSID:</string>
     <string name="bssid">BSSID:</string>
-    <string name="protocol">Protokol:</string>
+    <string name="protocol">Protokoll:</string>
     <string name="timestamp">Zeitstempel:</string>
     <string name="location">Ort:</string>
     <string name="internal_ip">Interne IP:</string>
@@ -47,7 +47,7 @@
     <string name="firstAttack">Erster Angriff:</string>
     <string name="lastAttack">Letzter Angriff:</string>
     <string name="clear">Clear</string>
-    <string name="delete">Löschen</string>
+    <string name="delete">L&#246;schen</string>
     <string name="cancel">Abbrechen</string>
     <string name="close">Schließen</string>
     <string name="show_records">Zeige Aufzeichnungen</string>
@@ -61,18 +61,18 @@
     <string name="RecordBSSID">BSSID</string>
     <string name="RecordSSID">SSID</string>
     <string name="RecordTimestamp">Zeitstempel</string>
-    <string name="RecordProtocol">Protokol</string>
+    <string name="RecordProtocol">Protokoll</string>
 
-    <string name="drawer_open">Öffne Navigation</string>
-    <string name="drawer_close">Schließe Navigation</string>
+    <string name="drawer_open">&#214;ffne Navigation</string>
+    <string name="drawer_close">Schlie&#223;e Navigation</string>
 
     <string name="drawer_overview">Übersicht</string>
     <string name="drawer_threat_map">Threat Map</string>
-    <string name="drawer_records">Aufzeichnungen</string>
+    <string name="drawer_records">Aufzeichnung</string>
     <string name="drawer_services">Dienste</string>
     <string name="drawer_settings">Einstellungen</string>
     <string name="drawer_profile_manager">Profile</string>
-    <string name="drawer_app_info">Über diese App</string>
+    <string name="drawer_app_info">&#220;ber diese App</string>
     <string name="drawer_statistics">Statistiken</string>
 
     <string name="hostage_with_url"><a href="http://www.tk.informatik.tu-darmstadt.de/de/research/secure-smart-infrastructures/hostage">HosTaGe</a></string>
@@ -84,38 +84,44 @@
 
     <string name="recorded_attacks">Angriffe: </string>
     <string name="current_connection">aktuelle Verbindung</string>
-    <string name="monitor_services">Überwache Dienste</string>
+    <string name="monitor_services">&#220;berwache Dienste</string>
 
-    <string name="device_rooted">Gerät gerooted</string>
+    <string name="device_rooted">Ger&#228;t gerooted</string>
     <string name="porthack_installed">Porthack installiert</string>
     <string name="yes">Ja</string>
     <string name="no">Nein</string>
 
+    <string name="no_data_notification">Es sind keine Attacken vorhanden. &#220;berpr&#252;fen Sie gegebenenfalls Ihre Filtereinstellungen.</string>
+    <string name="no_data_notification_no_filter">Es sind keine Attacken vorhanden.</string>
+
+
     <string name="ui_dev_by">UI Entwicklung</string>
     <string name="core_dev_by">Core Entwicklung</string>
     <string name="advanced_settings">Erweiterte Einstellungen</string>
-    <string name="change_name_of_profile">Ändere den Namen des Profils</string>
-    <string name="change_desc_of_profile">Ändere die Beschreibung des Profils</string>
-    <string name="change_icon_of_profile">Wähle ein Icon für das Profil</string>
+    <string name="change_name_of_profile">&#196;ndere den Namen des Profils</string>
+    <string name="change_desc_of_profile">&#196;ndere die Beschreibung des Profils</string>
+    <string name="change_icon_of_profile">W&#228;hle ein Icon für das Profil</string>
     <string name="profile_description">Beschreibung</string>
     <string name="general">Allgemein</string>
-    <string name="select_icon">Wähle Icon</string>
-    <string name="delete_profile">Profil löschen</string>
-    <string name="really_want_delete_profiel">Willst du dieses Profil wirklich löschen?</string>
+    <string name="select_icon">W&#228;hle Icon</string>
+    <string name="delete_profile">Profil l&#252;schen</string>
+    <string name="really_want_delete_profiel">Willst du dieses Profil wirklich l&#252;schen?</string>
     <string name="discard">Verwerfen</string>
     <string name="save">Speichern</string>
-    <string name="rec_protocol">Protokol</string>
+    <string name="rec_protocol">Protokoll</string>
+    <string name="ESSID">ESSID</string>
+    <string name="BSSID">BSSID</string>
     <string name="rec_sortby">Sortieren</string>
     <string name="rec_latest">Bis</string>
     <string name="rec_earliest">Von</string>
-    <string name="rec_reset_filter">Zurücksetzen</string>
+    <string name="rec_reset_filter">Zur&#252;cksetzen</string>
     <string name="rec_group_by">Gruppieren</string>
     <string name="rec_filter_by">Filtern</string>
     <string name="rec_time">Zeit</string>
     <string name="rec_set_date">Datum auswählen</string>
     <string name="rec_set">Speichern</string>
     <string name="rec_cancel">Abbrechen</string>
-    <string name="stats_protocols">Protokole</string>
+    <string name="stats_protocols">Protokolle</string>
     <string name="stats_networks">Netzwerke</string>
     <string name="stats_attacks">Angriffe</string>
     <string name="stats_visualize">Visualisierung</string>
@@ -124,16 +130,16 @@
     <string name="stats_line_plot">Liniendiagramm</string>
     <string name="stats_other">Andere</string>
     <string name="stats_attacks_count">Angriffe</string>
-    <string name="stats_select_protocol">Wähle Protokol</string>
+    <string name="stats_select_protocol">W&#228;hle Protokoll</string>
     <string name="stats_attacks_essid">Angriffe pro ESSID</string>
     <string name="stats_attacks_bssid">Angriffe pro BSSID</string>
-    <string name="stats_attacks_time">Angriffe pro Zeit</string>
+    <string name="stats_attacks_time">Angriffe pro Zeit (24h)</string>
     <string name="stats_attacks_date">Angriffe pro Datum</string>
     <string name="stats_uses_protocol">Nutzung pro Protokoll</string>
-    <string name="stats_attacks_protocol">Angriffe pro Protokol</string>
-    <string name="stats_select_attack_data">Wähle Kriterium zum Vergleich</string>
-    <string name="stats_select_network_data">Wähle Kriterium zum Vergleich</string>
-    <string name="stats_select_protocol_data">Wähle Kriterium zum Vergleich</string>
+    <string name="stats_attacks_protocol">Angriffe pro Protokoll</string>
+    <string name="stats_select_attack_data">W&#228;hle Kriterium zum Vergleich</string>
+    <string name="stats_select_network_data">W&#228;hle Kriterium zum Vergleich</string>
+    <string name="stats_select_protocol_data">W&#228;hle Kriterium zum Vergleich</string>
     <string name="stats_per_cent_all">% von allen</string>
     <string name="pie_all">Alle</string>
 
@@ -144,4 +150,31 @@
 	<string name="record_details_nocontent">Kein Inhalt</string>
 	<string name="record_details_remote_ip">REMOTE IP</string>
 	<string name="record_details_conversation">Unterhaltung</string>
+    <string name="profile_vista_desc">Dieses Profil immitiert Windows Vista</string>
+	<string name="profile_seven_desc">Dieses Profil immitiert Windows 7</string>
+    <string name="profile_xp_desc">Dieses Profil aktiviert Dienste die Typisch f&#252;r Windows XP sind</string>
+    <string name="profile_webserv_http_desc">Dieses Profil immitiert einen simplen Webserver, welcher nur den Port für das HTTP Protokoll &#252;berwacht</string>
+	<string name="profile_webserv_apache_desc">Dieses Profil immitiert einen Apache Webserver</string>
+	<string name="profile_webserv_iis_desc">Dieses Profil immitiert einen IIS Webserver</string>
+    <string name="profile_webserv_desc">Dieses Profil immitiert einen simplen Webserver, welcher neben dem HTTP Protokoll auch das HTTPS Protokoll unterst&#252;tzt</string>
+    <string name="profile_unix_desc">Dieses Profil aktiviert Unix-typische Dienste</string>
+    <string name="profile_linux_desc">Dieses Profil immitiert ein Linux System mit entsprechenden Diensten</string>
+	<string name="profile_linux_hard_desc">Dieses Profil immitiert ein Linux System, bei welchem nur SSH aktiv ist</string>
+	<string name="profile_voip_desc">Dieses Profil immitiert einen VOIP Server, welcher das SIP Protokoll &#252;berwacht</string>
+    <string name="profile_random_desc">In diesem Profil werden zuf&#228;llige Protokolle aktiviert</string>
+    <string name="profile_paranoid_desc">Dieses Profil aktiviert alle Protokolle</string>
+    <string name="profile_help_swipe">Swipe von der linken oder rechten Seite um alle Aktionen zu zeigen</string>
+    <string name="profile_monitor_ghost">&#220;berwache GHOST</string>
+    <string name="profile_activate_ghost">Aktiviere GHOST &#220;berwachung</string>
+    <string name="profile_activate_ghost_summary">Dieses Protokoll spiegelt eingehende Verbindungen</string>
+    <string name="profile_mirror_ghost">GHOST Ports</string>
+    <string name="profile_mirror_ghost_summary">Spiegelt den Traffic auf den angegebenen Ports. Trenne die Ports mit \',\'</string>
+    <string name="profile_monitor_protocols">&#220;berwache Protokolle</string>
+    <string name="profile_activate_protocols_summary">Aktiviere die zu &#252;berwachenden Protokolle</string>
+    <string name="profile_warning">Bitte beachte, dass dieses Profil nicht bearbeitet werden kann. Wenn du &#196;nderungen machst und speicherst, so wird ein neues Profil mit diesen Einstellungen erstellt.</string>
+    <string name="rec_choose_export_format">W&#228;hle Exportformat</string>
+    <string name="rec_sync_rec">Synchronisiere Aufzeichungen</string>
+    <string name="rec_via_bt">&#220;ber Bluetooth</string>
+    <string name="rec_via_nfc">&#220;ber NFC</string>
+    <string name="rec_via_online">&#220;ber Online Datenbank</string>
 </resources>

+ 41 - 6
res/values/strings.xml

@@ -13,7 +13,7 @@
     <string name="not_connected">Not connected</string>
     <string name="attack">&#160;attack</string>
     <string name="attacks">&#160;attacks</string>
-    <string name="portscan">&#160;port scan</string>
+	<string name="portscan">&#160;port scan</string>
     <string name="portscans">&#160;port scans</string>
     <string name="secure">Secure</string>
     <string name="insecure">Insecure</string>
@@ -23,8 +23,9 @@
 
     <string name="information">Information</string>
 	<string name="wifi_not_connected_msg">You are not connected to a WiFi network. \n\nPlease connect to one, before trying to activate HosTaGe.</string>
+	<string name="network_not_connected_msg">You are not connected to any network. \n\nPlease connect to one, before trying to activate HosTaGe.</string>
 	<string name="no_network_connection_threatmap_msg">Currently you are not connected to the Internet.\n\nPlease establish a connection to use the Threatmap.</string>
-	<string name="profile_no_services_msg">The current active protocol does not seem to monitor any services.\n\nPlease activate some services to monitor in the profile.</string>
+	<string name="profile_no_services_msg">The current active profile does not seem to monitor any services.\n\nPlease activate some services to monitor in the profile.</string>
 
     <string name="monitor_current_connection">Monitor current connection</string>
     <string name="active_profile">Active profile: </string>
@@ -90,7 +91,11 @@
     <string name="yes">Yes</string>
     <string name="no">No</string>
 
-	<string name="hostage_with_url"><a href="http://www.tk.informatik.tu-darmstadt.de/de/research/secure-smart-infrastructures/hostage">HosTaGe</a></string>
+    <string name="no_data_notification">No Attacks are recorded. Please check your filter option.</string>
+    <string name="no_data_notification_no_filter">No Attacks are recorded.</string>
+
+
+    <string name="hostage_with_url"><a href="http://www.tk.informatik.tu-darmstadt.de/de/research/secure-smart-infrastructures/hostage">HosTaGe</a></string>
     <string name="ui_dev_by">UI developed by</string>
     <string name="core_dev_by">Core developed by</string>
     <string name="advanced_settings">Advanced Settings</string>
@@ -105,6 +110,8 @@
     <string name="save">Save</string>
 	<string name="really_want_delete_profiel">Do you really want to delete this profile?</string>
     <string name="rec_protocol">Protocol</string>
+    <string name="ESSID">ESSID</string>
+    <string name="BSSID">BSSID</string>
     <string name="rec_sortby">Sort by</string>
     <string name="rec_latest">Latest</string>
     <string name="rec_earliest">Earliest</string>
@@ -123,12 +130,12 @@
     <string name="stats_pie_plot">Pie Plot</string>
     <string name="stats_line_plot">Line Plot</string>
     <string name="stats_other">Other</string>
-    <string name="stats_attacks_count">Attacks count</string>
+    <string name="stats_attacks_count">Attack count</string>
     <string name="stats_select_protocol">Select Protocol</string>
     <string name="stats_attacks_essid">Attacks per ESSID</string>
     <string name="stats_attacks_bssid">Attacks per BSSID</string>
-    <string name="stats_attacks_time">Attacks per time</string>
-    <string name="stats_attacks_date">Attacks per date</string>
+    <string name="stats_attacks_time">Attacks over time (24h)</string>
+    <string name="stats_attacks_date">Attacks over date</string>
     <string name="stats_uses_protocol">Uses per protocol</string>
     <string name="stats_attacks_protocol">Attacks per protocol</string>
     <string name="stats_select_attack_data">Select attack data to compare</string>
@@ -144,4 +151,32 @@
 	<string name="record_details_nocontent">No content</string>
 	<string name="record_details_remote_ip">REMOTE IP</string>
 	<string name="record_details_conversation">Conversation</string>
+	<string name="record_details_confirm_delete">Do you really want to delete this record?</string>
+    <string name="profile_vista_desc">This profile will imitate a Windows Vista machine</string>
+	<string name="profile_seven_desc">This profile will imitate a Windows 7 machine</string>
+    <string name="profile_xp_desc">This profile will activate Windows XP typical services</string>
+    <string name="profile_webserv_http_desc">This profile will imitate a simple webserver, which just supports the HTTP protocol</string>
+	<string name="profile_webserv_apache_desc">This profile will imitate an apache web server</string>
+	<string name="profile_webserv_iis_desc">This profile will imitate an IIS web server</string>
+    <string name="profile_webserv_desc">This profile will imitate a simple webserver, which supports both the HTTP and HTTPS protocol</string>
+    <string name="profile_unix_desc">This profile monitors unix typical services</string>
+    <string name="profile_linux_desc">This profile will imitate a linux machine by monitoring linux typical services</string>
+	<string name="profile_linux_hard_desc">This profile will imitate a linux machine which has just SSH activated</string>
+    <string name="profile_voip_desc">This profile imitates a VOIP Server by monitoring the SIP service</string>
+    <string name="profile_random_desc">This profile monitors services randomly</string>
+    <string name="profile_paranoid_desc">This profile monitors all available services</string>
+    <string name="profile_help_swipe">Swipe from the left or right on an item to expose all available actions for an item</string>
+    <string name="profile_monitor_ghost">Monitor GHOST</string>
+    <string name="profile_activate_ghost">Activate GHOST monitoring</string>
+    <string name="profile_activate_ghost_summary">This protocol mirrors an incoming connection back to the attacker on the same port, that it is running on</string>
+    <string name="profile_mirror_ghost">Mirror GHOST ports</string>
+    <string name="profile_mirror_ghost_summary">Mirrors the traffic on the given ports. Separate them by \',\'</string>
+    <string name="profile_monitor_protocols">Monitor protocols</string>
+    <string name="profile_activate_protocols_summary">Activate the protocols that should be monitored by HosTaGe</string>
+    <string name="profile_warning">Please note, that this profile can\'t be edited. If you make any changes to this profile, a new profile will be created.</string>
+    <string name="rec_choose_export_format">Choose export format</string>
+    <string name="rec_sync_rec">Synchronize records</string>
+    <string name="rec_via_bt">Via Bluetooth</string>
+    <string name="rec_via_nfc">Via NFC</string>
+    <string name="rec_via_online">Via Online Database</string>
 </resources>

+ 8 - 8
res/xml/profile_preferences.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-	<Preference android:summary="Please note, that this profile can't be edited. If you make any changes to this profile, a new profile will be created."
+	<Preference android:summary="@string/profile_warning"
 				android:layout="@layout/preference_warning"
 				android:key="pref_profile_warning"
 				android:enabled="false" />
@@ -23,23 +23,23 @@
 		            android:summary="@string/change_icon_of_profile" />
 	</PreferenceCategory>
 
-	<PreferenceCategory android:title="Monitor GHOST"
+	<PreferenceCategory android:title="@string/profile_monitor_ghost"
 	                    android:key="pref_profile_protocols_ghost">
 
 		<CheckBoxPreference android:key="pref_profile_protocols_ghost_active"
-		                    android:title="Activate GHOST monitoring"
-							android:summary="This protocol mirrors an incoming connection back to the attacker on the same port, that it is running on"
+		                    android:title="@string/profile_activate_ghost"
+							android:summary="@string/profile_activate_ghost_summary"
 							android:defaultValue="false" />
 
 		<EditTextPreference android:key="pref_profile_protocols_ghost_text"
-		                    android:title="Mirror GHOST ports"
-		                    android:summary="Mirrors the traffic on the given ports. Separate them by ','"
+		                    android:title="@string/profile_mirror_ghost"
+		                    android:summary="@string/profile_mirror_ghost_summary"
 		                    android:defaultValue=""
 		                    android:dependency="pref_profile_protocols_ghost_active" />
 	</PreferenceCategory>
 
-	<PreferenceCategory android:title="Monitor protocols"
+	<PreferenceCategory android:title="@string/profile_monitor_protocols"
 	                    android:key="pref_profile_protocols_settings">
-		<Preference android:summary="Activate the protocols that should be monitored by HosTaGe" />
+		<Preference android:summary="@string/profile_activate_protocols_summary" />
 	</PreferenceCategory>
 </PreferenceScreen>

+ 20 - 33
res/xml/settings_preferences.xml

@@ -17,44 +17,31 @@
 				android:title="@string/pref_alarm" />
 	</PreferenceCategory>
 
+	<PreferenceCategory android:title="@string/pref_storage" >
+		<EditTextPreference
+				android:key="pref_external_location"
+				android:defaultValue="/HosTaGe/LogFiles/"
+				android:title="@string/pref_external_location_title"
+				/>
+	</PreferenceCategory>
+	<PreferenceCategory android:title="@string/pref_upload" >
+		<CheckBoxPreference
+			android:defaultValue="false"
+			android:key="pref_auto_synchronize"
+			android:summary="@string/pref_auto_synchronize_summ"
+			android:title="@string/pref_auto_synchronize_title" />
+
+		<EditTextPreference
+				android:key="pref_upload_server"
+				android:defaultValue="https://ssi.cased.de"
+				android:title="@string/pref_upload_server" />
+	</PreferenceCategory>
+
 	<PreferenceCategory android:title="@string/advanced_settings">
 		<PreferenceScreen
 				android:key="pref_advanced settings"
 				android:title="@string/advanced_settings"
 				android:persistent="false">
-			<PreferenceCategory android:title="@string/pref_storage" >
-				<CheckBoxPreference
-						android:defaultValue="false"
-						android:key="pref_external_storage"
-						android:summary="@string/pref_external_storage_summ"
-						android:title="@string/pref_external_storage_title" />
-
-				<EditTextPreference
-						android:key="pref_external_location"
-						android:dependency="pref_external_storage"
-						android:defaultValue="/HosTaGe/LogFiles/"
-						android:title="@string/pref_external_location_title"
-						/>
-
-				<Preference
-						android:key="pref_external_export"
-						android:dependency="pref_external_storage"
-				        android:title="@string/export_to_location"
-				        />
-
-			</PreferenceCategory>
-			<PreferenceCategory android:title="@string/pref_upload" >
-			    <CheckBoxPreference
-            			android:defaultValue="false"
-            			android:key="pref_auto_synchronize"
-            			android:summary="@string/pref_auto_synchronize_summ"
-            			android:title="@string/pref_auto_synchronize_title" />
-				<EditTextPreference
-						android:key="pref_upload_server"
-						android:defaultValue="https://ssi.cased.de"
-						android:title="@string/pref_upload_server" />
-
-			</PreferenceCategory>
 			<PreferenceCategory android:title="@string/pref_connection_settings" >
 				<EditTextPreference
 						android:key="pref_max_connections"

+ 24 - 9
src/de/tudarmstadt/informatik/hostage/logging/LogExport.java

@@ -8,9 +8,12 @@ import android.app.IntentService;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.Environment;
+import android.os.Handler;
 import android.preference.PreferenceManager;
 import android.widget.Toast;
+
 import de.tudarmstadt.informatik.hostage.logging.formatter.Formatter;
+import de.tudarmstadt.informatik.hostage.logging.formatter.TraCINgFormatter;
 import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
 
 /**
@@ -21,13 +24,16 @@ import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
 public class LogExport extends IntentService{
 	
 	public static final String ACTION_EXPORT_DATABASE = "de.tudarmstadt.informatik.hostage.logging.ACTION_EXPORT_DATABASE";
-	
+	public static final String FORMAT_EXPORT_DATABASE = "de.tudarmstadt.informatik.hostage.logging.FORMAT_EXPORT_DATABASE";
+
+	Handler mMainThreadHandler = null;
+
 	SharedPreferences pref;
 	HostageDBOpenHelper dbh;
 	
 	public LogExport() {
 		super(LogExport.class.getName());
-
+		mMainThreadHandler = new Handler();
 	}
 	
 	@Override
@@ -46,8 +52,11 @@ public class LogExport extends IntentService{
 	protected void onHandleIntent(Intent intent) {
 		if (intent != null) {
 			final String action = intent.getAction();
+
 			if (ACTION_EXPORT_DATABASE.equals(action)) {
-				exportDatabase(null);
+				final int format = intent.getIntExtra(FORMAT_EXPORT_DATABASE, 0);
+				Formatter formatter = (format == 1 ? TraCINgFormatter.getInstance() : null);
+				exportDatabase(formatter);
 			}
 
 		}	
@@ -62,10 +71,9 @@ public class LogExport extends IntentService{
 	 * @see Record#toString(int)
 	 */
 	private void exportDatabase(Formatter format) {
-		
 		try {
 			FileOutputStream log;
-			String filename = "hostage_" + format + "_"+ System.currentTimeMillis() + ".log";
+			String filename = "hostage_" + (format == null ? "default" : format.toString()) + "_"+ System.currentTimeMillis() + ".log";
 			String externalLocation = pref.getString("pref_external_location", "");
 			String root = Environment.getExternalStorageDirectory().toString();
 			if (root != null && isExternalStorageWritable()) {
@@ -74,7 +82,7 @@ public class LogExport extends IntentService{
 				File file = new File(dir, filename);
 				log = new FileOutputStream(file);
 			} else {
-				Toast.makeText(this, "Could not write to SD Card",Toast.LENGTH_SHORT).show();
+				makeToast("Could not write to SD Card",Toast.LENGTH_SHORT);
 				return;
 			}
 
@@ -84,9 +92,9 @@ public class LogExport extends IntentService{
 			}
 			log.flush();
 			log.close();
-			Toast.makeText(this, filename + " saved on external memory! ", Toast.LENGTH_LONG).show();
+			makeToast(filename + " saved on external memory! ", Toast.LENGTH_LONG);
 		} catch (Exception e) {
-			Toast.makeText(this, "Could not write to SD Card", Toast.LENGTH_SHORT).show();
+			makeToast("Could not write to SD Card", Toast.LENGTH_SHORT);
 			e.printStackTrace();
 		}
 	}
@@ -105,5 +113,12 @@ public class LogExport extends IntentService{
 		return false;
 	}
 
-
+	private void makeToast(final String text, final int length){
+		mMainThreadHandler.post(new Runnable() {
+			@Override
+			public void run() {
+				Toast.makeText(getApplicationContext(), text, length).show();
+			}
+		});
+	}
 }

+ 18 - 6
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ExpandableListAdapter.java

@@ -1,15 +1,14 @@
 package de.tudarmstadt.informatik.hostage.ui2.adapter;
 
+import android.content.Context;
+import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseExpandableListAdapter;
 
 import java.util.ArrayList;
 import java.util.HashMap;
-        import java.util.List;
-
-        import android.content.Context;
-        import android.view.LayoutInflater;
-        import android.view.ViewGroup;
-        import android.widget.BaseExpandableListAdapter;
+import java.util.List;
 
 import de.tudarmstadt.informatik.hostage.ui2.model.ExpandableListItem;
 
@@ -33,6 +32,19 @@ public abstract class ExpandableListAdapter extends BaseExpandableListAdapter {
         this._sectionTitleToChildData = dataMapping;
     }
 
+    public void setData(HashMap<String, ArrayList<ExpandableListItem>> dataMapping){
+        this._sectionTitleToChildData = dataMapping;
+    }
+    public HashMap<String, ArrayList<ExpandableListItem>> getData(){
+        return this._sectionTitleToChildData;
+    }
+    public void setSectionHeader(List<String> listSectionHeaders){
+        this._sectionHeader = listSectionHeaders;
+    }
+    public List<String> getSectionHeaders(){
+        return this._sectionHeader;
+    }
+
     @Override
     public Object getChild(int section, int row) {
         return this._sectionTitleToChildData.get(this._sectionHeader.get(section))

+ 58 - 58
src/de/tudarmstadt/informatik/hostage/ui2/adapter/RecordListAdapter.java

@@ -1,58 +1,58 @@
-package de.tudarmstadt.informatik.hostage.ui2.adapter;
-
-import android.content.Context;
-import android.view.View;
-import android.widget.TextView;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import de.tudarmstadt.informatik.hostage.R;
-import de.tudarmstadt.informatik.hostage.ui2.model.ExpandableListItem;
-
-public class RecordListAdapter extends ExpandableListAdapter {
-
-    public RecordListAdapter(Context context, List<String> listSectionHeaders, HashMap<String, ArrayList<ExpandableListItem>> dataMapping) {
-        super(context, listSectionHeaders, dataMapping);
-    }
-
-
-    /*****************************
-     *
-     *          Required Methods
-     *
-     * ***************************/
-
-    @Override
-    public void configureCellView(View cell, int section, int row) {
-        ExpandableListItem object = this.getDataForRow(section, row);
-        for (String key : object.getId_Mapping().keySet()){
-            int viewID = object.getId_Mapping().get(key);
-            String textualInfo = object.getData().get(key);
-            TextView tView = (TextView) cell.findViewById(viewID);
-            tView.setText(textualInfo);
-        }
-    }
-
-    @Override
-    public void configureSectionHeaderView(View sectionHeader, int section) {
-        int headerLabelID = R.id.sectionHeaderTitle;
-        int valueLabelID = R.id.sectionHeaderValue;
-        TextView tView = (TextView) sectionHeader.findViewById(headerLabelID);
-        TextView vView = (TextView) sectionHeader.findViewById(valueLabelID);
-        int value = this.getChildrenCount(section);
-        tView.setText(this._sectionHeader.get(section));
-        vView.setText("" + value);
-    }
-
-    @Override
-    public int getSectionLayoutID() {
-        return R.layout.expandable_section_header;
-    }
-
-    @Override
-    public int getCellLayoutID() {
-        return R.layout.record_list_item;
-    }
-}
+package de.tudarmstadt.informatik.hostage.ui2.adapter;
+
+import android.content.Context;
+import android.view.View;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import de.tudarmstadt.informatik.hostage.R;
+import de.tudarmstadt.informatik.hostage.ui2.model.ExpandableListItem;
+
+public class RecordListAdapter extends ExpandableListAdapter {
+
+    public RecordListAdapter(Context context, List<String> listSectionHeaders, HashMap<String, ArrayList<ExpandableListItem>> dataMapping) {
+        super(context, listSectionHeaders, dataMapping);
+    }
+
+
+    /*****************************
+     *
+     *          Required Methods
+     *
+     * ***************************/
+
+    @Override
+    public void configureCellView(View cell, int section, int row) {
+        ExpandableListItem object = this.getDataForRow(section, row);
+        for (String key : object.getId_Mapping().keySet()){
+            int viewID = object.getId_Mapping().get(key);
+            String textualInfo = object.getData().get(key);
+            TextView tView = (TextView) cell.findViewById(viewID);
+            tView.setText(textualInfo);
+        }
+    }
+
+    @Override
+    public void configureSectionHeaderView(View sectionHeader, int section) {
+        int headerLabelID = R.id.sectionHeaderTitle;
+        int valueLabelID = R.id.sectionHeaderValue;
+        TextView tView = (TextView) sectionHeader.findViewById(headerLabelID);
+        TextView vView = (TextView) sectionHeader.findViewById(valueLabelID);
+        int value = this.getChildrenCount(section);
+        tView.setText(this._sectionHeader.get(section));
+        vView.setText("" + value);
+    }
+
+    @Override
+    public int getSectionLayoutID() {
+        return R.layout.expandable_section_header;
+    }
+
+    @Override
+    public int getCellLayoutID() {
+        return R.layout.record_list_item;
+    }
+}

+ 939 - 534
src/de/tudarmstadt/informatik/hostage/ui2/fragment/RecordOverviewFragment.java

@@ -1,37 +1,54 @@
 package de.tudarmstadt.informatik.hostage.ui2.fragment;
 
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Random;
-
 import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.app.AlertDialog;
 import android.app.FragmentManager;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.os.Bundle;
+import android.os.Environment;
+import android.preference.PreferenceManager;
 import android.util.Log;
 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.ExpandableListView;
 import android.widget.ImageButton;
+import android.widget.ProgressBar;
+import android.widget.Toast;
 
 import com.google.android.gms.maps.model.LatLng;
 
+import java.io.File;
+import java.io.FileOutputStream;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Random;
+
 import de.tudarmstadt.informatik.hostage.R;
+import de.tudarmstadt.informatik.hostage.commons.HelperUtils;
 import de.tudarmstadt.informatik.hostage.logging.AttackRecord;
+import de.tudarmstadt.informatik.hostage.logging.LogExport;
+import de.tudarmstadt.informatik.hostage.logging.MessageRecord;
 import de.tudarmstadt.informatik.hostage.logging.NetworkRecord;
 import de.tudarmstadt.informatik.hostage.logging.Record;
-import de.tudarmstadt.informatik.hostage.logging.MessageRecord;
+import de.tudarmstadt.informatik.hostage.logging.formatter.TraCINgFormatter;
 import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
+import de.tudarmstadt.informatik.hostage.sync.bluetooth.BluetoothSyncActivity;
+import de.tudarmstadt.informatik.hostage.sync.nfc.NFCSyncActivity;
+import de.tudarmstadt.informatik.hostage.sync.tracing.TracingSyncActivity;
 import de.tudarmstadt.informatik.hostage.ui.LogFilter;
 import de.tudarmstadt.informatik.hostage.ui.LogFilter.SortType;
 import de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity;
@@ -45,328 +62,577 @@ import de.tudarmstadt.informatik.hostage.ui2.popup.SimplePopupItem;
 import de.tudarmstadt.informatik.hostage.ui2.popup.SimplePopupTable;
 import de.tudarmstadt.informatik.hostage.ui2.popup.SplitPopupItem;
 
-public class RecordOverviewFragment extends UpNavigatibleFragment implements ChecklistDialog.ChecklistDialogListener,
-		DateTimeDialogFragment.DateTimeDialogFragmentListener {
+public class RecordOverviewFragment extends UpNavigatibleFragment implements ChecklistDialog.ChecklistDialogListener, DateTimeDialogFragment.DateTimeDialogFragmentListener {
 
 	static final String FILTER_MENU_TITLE_BSSID = "BSSID";
 	static final String FILTER_MENU_TITLE_ESSID = "ESSID";
 	static final String FILTER_MENU_TITLE_PROTOCOLS = MainActivity.getContext().getString(R.string.rec_protocol);
-	static final String FILTER_MENU_TITLE_TIMESTAMP_BELOW = MainActivity.getContext().getString(R.string.rec_latest);
-	static final String FILTER_MENU_TITLE_TIMESTAMP_ABOVE = MainActivity.getContext().getString(R.string.rec_earliest);
+	static final String FILTER_MENU_TITLE_TIMESTAMP_BELOW = MainActivity.getContext().getString(
+			R.string.rec_latest);
+	static final String FILTER_MENU_TITLE_TIMESTAMP_ABOVE = MainActivity.getContext().getString(
+			R.string.rec_earliest);
 	static final String FILTER_MENU_TITLE_SORTING = MainActivity.getContext().getString(R.string.rec_sortby);
 	static final String FILTER_MENU_TITLE_REMOVE = MainActivity.getContext().getString(R.string.rec_reset_filter);
-	static final String FILTER_MENU_TITLE_GROUP = MainActivity.getContext().getString(R.string.rec_group_by);
-	static final String FILTER_MENU_POPUP_TITLE = MainActivity.getContext().getString(R.string.rec_filter_by);
+    static final String FILTER_MENU_TITLE_GROUP = MainActivity.getContext().getString(
+			R.string.rec_group_by);
+    static final String FILTER_MENU_POPUP_TITLE = MainActivity.getContext().getString(
+			R.string.rec_filter_by);
 
-	private boolean wasBelowTimePicker;
+    private boolean wasBelowTimePicker;
 
-	private LogFilter filter;
-	private boolean showFilterButton;
+    private LogFilter filter;
+    private boolean showFilterButton;
+    private View rootView;
 
-	private int mListPosition = -1;
-	private int mItemPosition = -1;
+    private int mListPosition = -1;
+    private int mItemPosition = -1;
 
-	public String groupingKey;
+    public String groupingKey;
 
-	private ExpandableListView expListView;
+    private ExpandableListView expListView;
+    private ProgressBar spinner;
 
-	HostageDBOpenHelper dbh;
+    private Toast noDataNotificationToast;
 
-	private String sectionToOpen = "";
-	private ArrayList<Integer> openSections;
+    HostageDBOpenHelper dbh;
 
-	public void setFilter(LogFilter filter) {
-		this.filter = filter;
-	}
+    private String sectionToOpen = "";
+    private ArrayList<Integer> openSections;
 
-	public RecordOverviewFragment() {
-	}
+	private SharedPreferences pref;
 
-	public void setGroupKey(String key) {
-		this.groupingKey = key;
-	}
+	public void setFilter(LogFilter filter){
+        this.filter = filter;
+    }
 
-	@Override
-	public void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setHasOptionsMenu(true);
-	}
+    Thread loader;
+
+    public RecordOverviewFragment(){}
 
-	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+    public void setGroupKey(String key){
+        this.groupingKey = key;
+    }
 
+
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setHasOptionsMenu(true);
+    }
+
+    @Override
+	public View onCreateView(LayoutInflater inflater, ViewGroup container,
+             Bundle savedInstanceState) {
+
+		setHasOptionsMenu(true);
 		getActivity().setTitle(getResources().getString(R.string.drawer_records));
 
 		dbh = new HostageDBOpenHelper(this.getActivity().getBaseContext());
+	    pref = PreferenceManager.getDefaultSharedPreferences(getActivity());
+        //this.addRecordToDB(5, 2);
 
-		// Get the message from the intent
+	    // Get the message from the intent
 
-		if (this.filter == null) {
-			Intent intent = this.getActivity().getIntent();
-			LogFilter filter = intent.getParcelableExtra(LogFilter.LOG_FILTER_INTENT_KEY);
 
-			if (filter == null) {
-				this.clearFilter();
-			} else {
-				this.filter = filter;
-			}
-		}
+        if (this.filter == null){
+            Intent intent = this.getActivity().getIntent();
+            LogFilter filter = intent.getParcelableExtra(LogFilter.LOG_FILTER_INTENT_KEY);
+
+            if(filter == null){
+                this.clearFilter();
+            } else {
+                this.filter = filter;
+            }
+        }
 
-		if (this.groupingKey == null)
-			this.groupingKey = this.groupingTitles().get(0);
+        if (this.groupingKey == null) this.groupingKey = this.groupingTitles().get(0);
 
-		this.setShowFilterButton(!this.filter.isNotEditable());
-		// this.addRecordToDB();
+	    this.setShowFilterButton(!this.filter.isNotEditable());
 
 		View rootView = inflater.inflate(this.getLayoutId(), container, false);
+        this.rootView = rootView;
 		ExpandableListView mylist = (ExpandableListView) rootView.findViewById(R.id.loglistview);
 
-		this.expListView = mylist;
-		populateListViewFromDB(mylist);
+        this.spinner =(ProgressBar) rootView.findViewById(R.id.progressBar1);
+        this.spinner.setVisibility(View.GONE);
 
-		if (this.openSections != null && this.openSections.size() != 0) {
-			for (int i = 0; i < this.openSections.size(); i++) {
-				int index = this.openSections.get(i);
-				this.expListView.expandGroup(index);
-			}
-		} else {
-			this.openSections = new ArrayList<Integer>();
-		}
+		this.expListView = mylist;
 
-		if (mListPosition != -1 && mItemPosition != -1)
-			this.expListView.setSelectedChild(mListPosition, mItemPosition, true);
-
-		mListPosition = -1;
-		mItemPosition = -1;
-
-		registerListClickCallback(mylist);
-
-		ImageButton filterButton = (ImageButton) rootView.findViewById(R.id.FilterButton);
-		filterButton.setOnClickListener(new View.OnClickListener() {
-			public void onClick(View v) {
-				RecordOverviewFragment.this.openFilterPopupMenuOnView(v);
-			}
-		});
-		filterButton.setVisibility(this.showFilterButton ? View.VISIBLE : View.INVISIBLE);
-
-		ImageButton sortButton = (ImageButton) rootView.findViewById(R.id.SortButton);
-		sortButton.setOnClickListener(new View.OnClickListener() {
-			public void onClick(View v) {
-				// Open SortMenu
-				RecordOverviewFragment.this.openSortingDialog();
-			}
-		});
-
-		ImageButton groupButton = (ImageButton) rootView.findViewById(R.id.GroupButton);
-		groupButton.setOnClickListener(new View.OnClickListener() {
-			public void onClick(View v) {
-				// Open SortMenu
-				RecordOverviewFragment.this.openGroupingDialog();
-			}
-		});
+        this.initialiseListView();
+
+        ImageButton filterButton = (ImageButton) rootView.findViewById(R.id.FilterButton);
+        filterButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+            	RecordOverviewFragment.this.openFilterPopupMenuOnView(v);
+            }
+        });
+        filterButton.setVisibility(this.showFilterButton? View.VISIBLE : View.INVISIBLE);
+
+        ImageButton sortButton = (ImageButton) rootView.findViewById(R.id.SortButton);
+        sortButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                // Open SortMenu
+                RecordOverviewFragment.this.openSortingDialog();
+            }
+        });
+
+        ImageButton groupButton = (ImageButton) rootView.findViewById(R.id.GroupButton);
+        groupButton.setOnClickListener(new View.OnClickListener() {
+            public void onClick(View v) {
+                // Open SortMenu
+                RecordOverviewFragment.this.openGroupingDialog();
+            }
+        });
 
 		return rootView;
-	}
+	 }
+
+
+    /**Initialises the expandable list view in a backgorund thread*/
+    private void initialiseListView(){
+        if (loader != null) loader.interrupt();
+
+        this.spinner.setVisibility(View.VISIBLE);
+
+        loader = new Thread(new Runnable(){
+
+            private void updateUI(final RecordListAdapter currentAdapter)
+            {
+                if(loader.isInterrupted()){
+                    return;
+                }
+                Activity activity = RecordOverviewFragment.this.getActivity();
+
+                if (activity != null){
+                    activity.runOnUiThread(new Runnable() {
+                        @Override
+                        public void run() {
+                            RecordOverviewFragment.this.expListView.setAdapter(currentAdapter);
+                            // Update view and remove loading spinner etc...
+                            RecordListAdapter adapter = (RecordListAdapter) RecordOverviewFragment.this.expListView.getExpandableListAdapter();
+
+                            if (adapter != null){
+                                adapter.notifyDataSetChanged();
+
+                                if (adapter.getGroupCount() == 1){
+                                    RecordOverviewFragment.this.expListView.expandGroup(0);
+                                } else {
+                                    RecordOverviewFragment.this.setSectionToOpen(RecordOverviewFragment.this.sectionToOpen);
+                                }
+                            }
+
+                            if (RecordOverviewFragment.this.openSections != null && RecordOverviewFragment.this.openSections.size() != 0){
+                                for (int i = 0; i < RecordOverviewFragment.this.openSections.size(); i++){
+                                    int index = RecordOverviewFragment.this.openSections.get(i);
+                                    RecordOverviewFragment.this.expListView.expandGroup(index);
+                                }
+                            } else {
+                                RecordOverviewFragment.this.openSections = new ArrayList<Integer>();
+                            }
+
+                            if (mListPosition != -1 && mItemPosition != -1)
+                                RecordOverviewFragment.this.expListView.setSelectedChild(mListPosition, mItemPosition, true);
+
+                            mListPosition = -1;
+                            mItemPosition = -1;
+                            registerListClickCallback(RecordOverviewFragment.this.expListView);
+                            RecordOverviewFragment.this.spinner.setVisibility(View.GONE);
+                            RecordOverviewFragment.this.actualiseFilterButton();
+                            RecordOverviewFragment.this.showEmptyDataNotification();
+                        }
+                    });
+                }
+            }
+
+            private RecordListAdapter doInBackground()
+            {
+                return populateListViewFromDB(RecordOverviewFragment.this.expListView);
+            }
+
+            @Override
+            public void run()
+            {
+                //RecordOverviewFragment.this.addRecordToDB(5, 10);
+                updateUI(doInBackground());
+            }
+
+        });
+
+        loader.start();
+
+        this.actualiseFilterButton();
+    }
+
+
+    /**
+    *  Returns the Fragment layout ID
+    *  @return int The fragment layout ID
+    * */
+    public int getLayoutId(){
+        return R.layout.fragment_record_list;
+    }
+
+    /**
+    * Gets called if the user clicks on item in the filter menu.
+    *
+    * @param  item {@link AbstractPopupItem AbstractPopupItem }
+    * */
+	public void onFilterMenuItemSelected(AbstractPopupItem item) {
+		String title = item.getTitle();
 
-	public int getLayoutId() {
-		return R.layout.fragment_record_list;
+        if (item instanceof SplitPopupItem){
+            SplitPopupItem splitItem = (SplitPopupItem)item;
+            if (splitItem.wasRightTouch){
+                this.openTimestampToFilterDialog();
+            } else {
+                this.openTimestampFromFilterDialog();
+            }
+            return;
+        }
+
+        if (title != null){
+            if(title.equals(FILTER_MENU_TITLE_BSSID)){
+                this.openBSSIDFilterDialog();
+            }
+            if(title.equals(FILTER_MENU_TITLE_ESSID)){
+                this.openESSIDFilterDialog();
+            }
+            if(title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
+                this.openProtocolsFilterDialog();
+            }
+            if(title.equals(FILTER_MENU_TITLE_SORTING)){
+                this.openSortingDialog();
+            }
+            if(title.equals(FILTER_MENU_TITLE_REMOVE)){
+                this.clearFilter();
+                this.actualiseListViewInBackground();
+            }
+            if(title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW)){
+                this.openTimestampToFilterDialog();
+            }
+            if(title.equals(FILTER_MENU_TITLE_TIMESTAMP_ABOVE)){
+                this.openTimestampFromFilterDialog();
+            }
+        }
+		//return super.onOptionsItemSelected(item);
 	}
 
+
+
+    @Override
+    public void onStart() {
+        super.onStart();
+        if (this.expListView.getExpandableListAdapter() != null){
+            if (this.expListView.getExpandableListAdapter().getGroupCount() == 1){
+                this.expListView.expandGroup(0);
+            } else {
+                this.setSectionToOpen(this.sectionToOpen);
+            }
+        }
+
+    }
+
+	@Override
 	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
-		super.onCreateOptionsMenu(menu, inflater);
+		// Inflate the menu items for use in the action bar
+		inflater.inflate(R.menu.records_overview_actions, menu);
 	}
 
-	public void onFilterMenuItemSelected(AbstractPopupItem item) {
-		String title = item.getTitle();
+	@Override
+	public boolean onOptionsItemSelected(MenuItem item) {
+		switch (item.getItemId()) {
+			case R.id.records_action_synchronize:
+
+				AlertDialog.Builder builder = new AlertDialog.Builder(this.getActivity());
+				builder.setTitle(MainActivity.getInstance().getString(R.string.rec_sync_rec));
+				builder.setItems(new String[]{
+						MainActivity.getInstance().getString(R.string.rec_via_bt),
+						MainActivity.getInstance().getString(R.string.rec_via_nfc),
+						MainActivity.getInstance().getString(R.string.rec_via_online)
+				}, new DialogInterface.OnClickListener() {
+					@Override
+					public void onClick(DialogInterface dialog, int position) {
+						switch(position){
+							case 0:
+								getActivity().startActivity(new Intent(getActivity(), BluetoothSyncActivity.class));
+								break;
+							case 1:
+								getActivity().startActivity(new Intent(getActivity(), NFCSyncActivity.class));
+								break;
+
+							case 2:
+								getActivity().startActivity(new Intent(getActivity(), TracingSyncActivity.class));
+								break;
+						}
+					}
+				});
+				builder.create();
+				builder.show();
 
-		if (item instanceof SplitPopupItem) {
-			SplitPopupItem splitItem = (SplitPopupItem) item;
-			if (splitItem.wasRightTouch) {
-				this.openTimestampToFilterDialog();
-			} else {
-				this.openTimestampFromFilterDialog();
-			}
-			return;
-		}
 
-		if (title != null) {
-			if (title.equals(FILTER_MENU_TITLE_BSSID)) {
-				this.openBSSIDFilterDialog();
-			}
-			if (title.equals(FILTER_MENU_TITLE_ESSID)) {
-				this.openESSIDFilterDialog();
-			}
-			if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)) {
-				this.openProtocolsFilterDialog();
-			}
-			if (title.equals(FILTER_MENU_TITLE_SORTING)) {
-				this.openSortingDialog();
-			}
-			if (title.equals(FILTER_MENU_TITLE_REMOVE)) {
-				this.clearFilter();
-				this.populateListViewFromDB(this.expListView);
-			}
-			if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW)) {
-				this.openTimestampToFilterDialog();
-			}
-			if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_ABOVE)) {
-				this.openTimestampFromFilterDialog();
-			}
-		}
-		// return super.onOptionsItemSelected(item);
-	}
+				return true;
+			case R.id.records_action_export:
+				AlertDialog.Builder builderExport = new AlertDialog.Builder(getActivity());
+				builderExport.setTitle(MainActivity.getInstance().getString(R.string.rec_choose_export_format));
+				builderExport.setItems(R.array.format, new DialogInterface.OnClickListener() {
+					@Override
+					public void onClick(DialogInterface dialog, int position) {
+						//RecordOverviewFragment.this.exportDatabase(position);
+						Intent intent = new Intent(getActivity(), LogExport.class);
+						intent.setAction(LogExport.ACTION_EXPORT_DATABASE);
+						intent.putExtra(LogExport.FORMAT_EXPORT_DATABASE, position);
+
+						RecordOverviewFragment.this.getActivity().startService(intent);
+					}
+				});
+				builderExport.create();
+				builderExport.show();
 
-	public void onStart() {
-		super.onStart();
-		// this.populateListViewFromDB(this.expListView);
-		if (this.expListView.getExpandableListAdapter().getGroupCount() == 1) {
-			this.expListView.expandGroup(0);
-		} else {
-			this.setSectionToOpen(this.sectionToOpen);
+				return true;
 		}
+
+		return false;
 	}
 
 	/*****************************
-	 * 
-	 * Public API
-	 * 
+	 *
+	 * 			Public API
+	 *
 	 * ***************************/
 
 	/**
 	 * Group records by SSID and expand given SSID
-	 * 
-	 * @param SSID
-	 *            the SSID
+	 *
+	 * @param SSID the SSID
 	 */
-	public void showDetailsForSSID(Context context, String SSID) {
+	public void showDetailsForSSID(Context context,  String SSID) {
 		Log.e("RecordOverviewFragment", "Implement showDetailsForSSID!!");
-		this.clearFilter();
-		int ESSID_INDEX = 2;
-		ArrayList<String> ssids = new ArrayList<String>();
-		this.sectionToOpen = SSID;
-		this.groupingKey = this.groupingTitles(context).get(ESSID_INDEX);
-	}
+        this.clearFilter();
+        int ESSID_INDEX = 2;
+        ArrayList<String> ssids = new ArrayList<String>();
+        this.sectionToOpen = SSID;
+        this.groupingKey = this.groupingTitles(context).get(ESSID_INDEX);
+  	}
+
 
 	/*****************************
-	 * UglyDbHelper
-	 * 
-	 * ListView Stuff
-	 * 
+	 *
+	 *          ListView Stuff
+	 *
 	 * ***************************/
 
-	private void populateListViewFromDB(ExpandableListView mylist) {
+    /**
+    *  Reloads the data in the ExpandableListView for the given filter object.
+    *  @param  mylist {@link ExpandableListView ExpandableListView}
+    * */
+	private RecordListAdapter populateListViewFromDB(ExpandableListView mylist) {
 
-		HashMap<String, ArrayList<ExpandableListItem>> sectionData = new HashMap<String, ArrayList<ExpandableListItem>>();
+        HashMap<String, ArrayList<ExpandableListItem>> sectionData = new HashMap<String, ArrayList<ExpandableListItem>>();
 
-		ArrayList<Record> data = dbh.getRecordsForFilter(this.filter);
+        ArrayList<Record> data = dbh.getRecordsForFilter(RecordOverviewFragment.this.filter);
 
-		// Adding Items to ListView
-		String keys[] = new String[] { this.getString(R.string.RecordBSSID), this.getString(R.string.RecordSSID), this.getString(R.string.RecordProtocol),
-				this.getString(R.string.RecordTimestamp) };
-		int ids[] = new int[] { R.id.RecordTextFieldBSSID, R.id.RecordTextFieldSSID, R.id.RecordTextFieldProtocol, R.id.RecordTextFieldTimestamp };
+        // Adding Items to ListView
+        String keys[] = new String[] { RecordOverviewFragment.this.getString(R.string.RecordBSSID), RecordOverviewFragment.this.getString(R.string.RecordSSID), RecordOverviewFragment.this.getString(R.string.RecordProtocol), RecordOverviewFragment.this.getString(R.string.RecordTimestamp)};
+        int ids[] = new int[] {R.id.RecordTextFieldBSSID, R.id.RecordTextFieldSSID, R.id.RecordTextFieldProtocol, R.id.RecordTextFieldTimestamp };
 
-		HashMap<String, Integer> mapping = new HashMap<String, Integer>();
-		int i = 0;
-		for (String key : keys) {
-			mapping.put(key, ids[i]);
-			i++;
-		}
+        HashMap<String, Integer> mapping = new HashMap<String, Integer>();
+        int i = 0;
+        for(String key : keys){
+            mapping.put(key, ids[i]);
+            i++;
+        }
 
-		ArrayList<String> groupTitle = new ArrayList<String>();
+        ArrayList<String>groupTitle = new ArrayList<String>();
 
-		for (Record val : data) {
-			// DO GROUPING IN HERE
-			HashMap<String, String> map = new HashMap<String, String>();
-			map.put(this.getString(R.string.RecordBSSID), val.getBssid());
-			map.put(this.getString(R.string.RecordSSID), val.getSsid());
-			map.put(this.getString(R.string.RecordProtocol), val.getProtocol());
-			map.put(this.getString(R.string.RecordTimestamp), this.getDateAsString(val.getTimestamp()));
+        for (Record val : data) {
+            // DO GROUPING IN HERE
+            HashMap<String, String> map = new HashMap<String, String>();
+            map.put(RecordOverviewFragment.this.getString(R.string.RecordBSSID), val.getBssid());
+            map.put(RecordOverviewFragment.this.getString(R.string.RecordSSID), val.getSsid());
+            map.put(RecordOverviewFragment.this.getString(R.string.RecordProtocol), val.getProtocol());
+            map.put(RecordOverviewFragment.this.getString(R.string.RecordTimestamp),
+                    RecordOverviewFragment.this.getDateAsString(val.getTimestamp()));
 
-			ExpandableListItem item = new ExpandableListItem();
-			item.setData(map);
+            ExpandableListItem item = new ExpandableListItem();
+            item.setData(map);
 
-			item.setId_Mapping(mapping);
+            item.setId_Mapping(mapping);
 
-			item.setTag(val.getAttack_id());
+            item.setTag(val.getAttack_id());
 
-			String groupID = this.getGroupValue(val);
+            String groupID = RecordOverviewFragment.this.getGroupValue(val);
 
-			ArrayList<ExpandableListItem> items = sectionData.get(groupID);
-			if (items == null) {
-				items = new ArrayList<ExpandableListItem>();
-				sectionData.put(groupID, items);
-				groupTitle.add(groupID);
-			}
+            ArrayList<ExpandableListItem> items = sectionData.get(groupID);
+            if (items == null) {
+                items = new ArrayList<ExpandableListItem>();
+                sectionData.put(groupID, items);
+                groupTitle.add(groupID);
+            }
 
-			items.add(item);
-		}
 
-		Collections.sort(groupTitle, new Comparator<String>() {
-			@Override
-			public int compare(String s1, String s2) {
-				return s1.compareToIgnoreCase(s2);
-			}
-		});
+            items.add(item);
+        }
 
-		RecordListAdapter adapter = new RecordListAdapter(this.getApplicationContext(), groupTitle, sectionData);
+        Collections.sort(groupTitle, new Comparator<String>() {
+            @Override
+            public int compare(String s1, String s2) {
+                return s1.compareToIgnoreCase(s2);
+            }
+        });
 
-		mylist.setAdapter(adapter);
-	}
 
-	private void setSectionToOpen(String s) {
-		this.sectionToOpen = s;
-		if (this.sectionToOpen != null && this.sectionToOpen.length() != 0) {
-			if (this.getGroupTitle().contains(this.sectionToOpen)) {
-				int section = this.getGroupTitle().indexOf(this.sectionToOpen);
-				this.expListView.expandGroup(section);
-				this.sectionToOpen = "";
-			}
-		}
+        RecordListAdapter adapter = null;
+        if (mylist.getAdapter() != null && mylist.getAdapter() instanceof RecordListAdapter){
+            adapter = (RecordListAdapter) mylist.getAdapter();
+            adapter.setData(sectionData);
+            adapter.setSectionHeader(groupTitle);
+        } else {
+            adapter = new RecordListAdapter( RecordOverviewFragment.this.getApplicationContext(), groupTitle, sectionData);
+        }
+
+        return adapter;
 	}
 
-	private Context getBaseContext() {
+    /**
+     * Actualises the list in a background thread
+     */
+    private void actualiseListViewInBackground(){
+        if (loader != null && loader.isAlive()) loader.interrupt();
+
+        loader = null;
+
+        this.spinner.setVisibility(View.VISIBLE);
+        this.actualiseFilterButton();
+
+        loader = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                this.runOnUiThread(this.doInBackground());
+            }
+
+            private RecordListAdapter doInBackground(){
+                return RecordOverviewFragment.this.populateListViewFromDB(RecordOverviewFragment.this.expListView);
+            }
+
+            private void runOnUiThread(final RecordListAdapter adapter){
+                Activity actv = RecordOverviewFragment.this.getActivity();
+                if (actv != null){
+                    actv.runOnUiThread(new Runnable() {
+                        @Override
+                        public void run() {
+                            this.actualiseUI();
+                        }
+                        private void actualiseUI(){
+                            if (adapter != null){
+                                RecordOverviewFragment.this.expListView.setAdapter(adapter);
+                                adapter.notifyDataSetChanged();
+                                RecordOverviewFragment.this.spinner.setVisibility(View.GONE);
+                            }
+                            RecordOverviewFragment.this.showEmptyDataNotification();
+                        }
+                    });
+                }
+            }
+        });
+        loader.start();
+    }
+
+    /**
+     * Shows a small toast if the data to show is empty (no records).
+     */
+    private void showEmptyDataNotification(){
+        if (RecordOverviewFragment.this.noDataNotificationToast == null){
+            RecordOverviewFragment.this.noDataNotificationToast =  Toast.makeText(getApplicationContext(), R.string.no_data_notification, Toast.LENGTH_SHORT);
+        }
+        RecordListAdapter adapter = (RecordListAdapter) RecordOverviewFragment.this.expListView.getExpandableListAdapter();
+
+        if (this.getFilterButton().getVisibility() == View.VISIBLE && this.filter.isSet()){
+            this.noDataNotificationToast.setText(R.string.no_data_notification);
+        } else {
+            this.noDataNotificationToast.setText(R.string.no_data_notification_no_filter);
+        }
+        if (adapter == null || adapter.getData().isEmpty())
+            RecordOverviewFragment.this.noDataNotificationToast.show();
+
+    }
+
+    /**This will open a section in the ExpandableListView with the same title as the parameter s.
+    *
+    * @param s String (the section title to open)
+    *
+    * */
+    private void setSectionToOpen(String s){
+        this.sectionToOpen = s;
+        if (this.sectionToOpen != null && this.sectionToOpen.length() != 0){
+            if (this.getGroupTitles().contains(this.sectionToOpen)){
+                int section = this.getGroupTitles().indexOf(this.sectionToOpen);
+                this.expListView.expandGroup(section);
+                this.sectionToOpen = "";
+            }
+        }
+    }
+
+    /**
+    * Returns the base context.
+    * @return Context baseContext
+    * */
+	private Context getBaseContext(){
 		return this.getActivity().getBaseContext();
 	}
 
-	private Context getApplicationContext() {
+    /**Returns the application context.
+    * @return Context application context
+    * */
+	private Context getApplicationContext(){
 		return this.getActivity().getApplicationContext();
 	}
 
+    /**Sets the list view listener on the given ExpandableListView.
+    *
+    * @param mylist  {@link ExpandableListView ExpandableListView }
+    * */
 	private void registerListClickCallback(ExpandableListView mylist) {
-		mylist.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
-			@Override
-			public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i2, long l) {
-				RecordListAdapter adapter = (RecordListAdapter) expandableListView.getExpandableListAdapter();
-
-				ExpandableListItem item = (ExpandableListItem) adapter.getChild(i, i2);
-
-				mListPosition = i;
-				mItemPosition = i2;
-				HostageDBOpenHelper dbh = new HostageDBOpenHelper(getBaseContext());
-				Record rec = dbh.getRecordOfAttackId((int) item.getTag());
-				RecordOverviewFragment.this.pushRecordDetailViewForRecord(rec);
-				return true;
-			}
-		});
-		mylist.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
-			@Override
-			public void onGroupExpand(int i) {
-				RecordOverviewFragment.this.openSections.add(new Integer(i));
-			}
-		});
-		mylist.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
-			@Override
-			public void onGroupCollapse(int i) {
-				RecordOverviewFragment.this.openSections.remove(new Integer(i));
-			}
-		});
+        mylist.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
+            @Override
+            public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i2, long l) {
+                RecordListAdapter adapter = (RecordListAdapter)expandableListView.getExpandableListAdapter();
+
+                ExpandableListItem item = (ExpandableListItem)adapter.getChild(i,i2);
+
+                mListPosition = i;
+                mItemPosition = i2;
+	            HostageDBOpenHelper dbh = new HostageDBOpenHelper(getBaseContext());
+                Record rec = dbh.getRecordOfAttackId((int) item.getTag());
+                RecordOverviewFragment.this.pushRecordDetailViewForRecord(rec);
+                return true;
+            }
+        });
+        mylist.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
+            @Override
+            public void onGroupExpand(int i) {
+                RecordOverviewFragment.this.openSections.add(new Integer(i));
+            }
+        });
+        mylist.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
+            @Override
+            public void onGroupCollapse(int i) {
+                RecordOverviewFragment.this.openSections.remove(new Integer(i));
+            }
+        });
 	}
 
+
+
 	/*****************************
-	 * 
-	 * Date Transform
-	 * 
+	 *
+	 *          Date Transform
+	 *
 	 * ***************************/
 
+
+    /**Returns the date format "H:mm d.M.yy" for the given timestamp (long)
+    * @param timeStamp long */
 	@SuppressLint("SimpleDateFormat")
 	private String getDateAsString(long timeStamp) {
 
@@ -379,10 +645,11 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		}
 	}
 
+
 	/*****************************
-	 * 
-	 * Getter / Setter
-	 * 
+	 *
+	 *          Getter / Setter
+	 *
 	 * ***************************/
 
 	public boolean isShowFilterButton() {
@@ -393,430 +660,568 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
 		this.showFilterButton = showFilterButton;
 	}
 
+
+
+
 	/*****************************
-	 * 
-	 * Open Dialog Methods
-	 * 
+	 *
+	 *          Open Dialog Methods
+	 *
 	 * ***************************/
 
-	private void openGroupingDialog() {
-		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_GROUP, this.groupingTitles(), this.selectedGroup(), false, this);
-		newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_GROUP);
-	}
+    /**Opens the grouping dialog*/
+    private void openGroupingDialog(){
+        ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_GROUP, this.groupingTitles(), this.selectedGroup(), false , this);
+        newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_GROUP);
+    }
 
-	private void openBSSIDFilterDialog() {
-		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_BSSID, this.bssids(), this.selectedBSSIDs(), true, this);
-		newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_BSSID);
+    /**opens the bssid filter dialog*/
+	private void openBSSIDFilterDialog(){
+		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_BSSID,this.bssids(), this.selectedBSSIDs(), true , this);
+	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_BSSID);
 	}
 
-	private void openESSIDFilterDialog() {
-		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_ESSID, this.essids(), this.selectedESSIDs(), true, this);
-		newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_ESSID);
+    /**opens the essid filter dialog*/
+	private void openESSIDFilterDialog(){
+		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_ESSID,this.essids(), this.selectedESSIDs(), true , this);
+	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_ESSID);
 	}
 
-	private void openProtocolsFilterDialog() {
-		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_PROTOCOLS, this.protocolTitles(), this.selectedProtocols(), true, this);
-		newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_PROTOCOLS);
+    /**opens the protocol filter dialog*/
+	private void openProtocolsFilterDialog(){
+		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_PROTOCOLS,this.protocolTitles(), this.selectedProtocols(), true , this);
+	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_PROTOCOLS);
 	}
 
-	private void openTimestampFromFilterDialog() {
+    /**opens the timestamp filter dialog (minimal timestamp required)*/
+	private void openTimestampFromFilterDialog(){
 		this.wasBelowTimePicker = false;
 		DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
-		newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
-		if (this.filter.aboveTimestamp != Long.MIN_VALUE)
-			newFragment.setDate(this.filter.aboveTimestamp);
+	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
+        if (this.filter.aboveTimestamp != Long.MIN_VALUE)newFragment.setDate(this.filter.aboveTimestamp);
 	}
 
-	private void openTimestampToFilterDialog() {
+    /**opens time timestamp filter dialog (maximal timestamp required)*/
+	private void openTimestampToFilterDialog(){
 		this.wasBelowTimePicker = true;
 		DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
-		newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
-		if (this.filter.belowTimestamp != Long.MAX_VALUE)
-			newFragment.setDate(this.filter.belowTimestamp);
+	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
+        if (this.filter.belowTimestamp != Long.MAX_VALUE) newFragment.setDate(this.filter.belowTimestamp);
+    }
+
+    /**opens the sorting dialog*/
+	private void openSortingDialog(){
+		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_SORTING,this.sortTypeTiles(), this.selectedSorttype(), false , this);
+	    newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
 	}
 
-	private void openSortingDialog() {
-		ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_SORTING, this.sortTypeTiles(), this.selectedSorttype(), false, this);
-		newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
-	}
-
-	/*****************************
-	 * 
-	 * Grouping Stuff
-	 * 
-	 * ***************************/
+    /*****************************
+     *
+     *          Grouping Stuff
+     *
+     * ***************************/
+
+    /**returns the group title for the given record. Uses the groupingKey to decied which value of the record should be used.
+    * @param  rec {@link Record Record }
+    * @return String grouptitle*/
+    public String getGroupValue(Record rec){
+        int index = this.groupingTitles().indexOf(this.groupingKey);
+        switch (index){
+            case 0:
+                return rec.getProtocol();
+            case 1:
+                return rec.getBssid();
+            case 2:
+                return rec.getSsid();
+            default:
+                return rec.getProtocol();
+        }
+    }
+
+    /**Returns the Group titles for the specified grouping key. e.g. groupingKey is "ESSID" it returns all available essids.
+    * @return ArrayList<String> grouptitles*/
+    public ArrayList<String> getGroupTitles(){
+        int index = this.groupingTitles().indexOf(this.groupingKey);
+        switch (index){
+            case 0:
+                return this.protocolTitles();
+            case 1:
+                return this.bssids();
+            case 2:
+                return this.essids();
+            default:
+                return this.protocolTitles();
+        }
+    }
 
-	public String getGroupValue(Record rec) {
-		int index = this.groupingTitles().indexOf(this.groupingKey);
-		switch (index) {
-		case 0:
-			return rec.getProtocol();
-		case 1:
-			return rec.getBssid();
-		case 2:
-			return rec.getSsid();
-		default:
-			return rec.getProtocol();
-		}
-	}
-
-	public ArrayList<String> getGroupTitle() {
-		int index = this.groupingTitles().indexOf(this.groupingKey);
-		switch (index) {
-		case 0:
-			return this.protocolTitles();
-		case 1:
-			return this.bssids();
-		case 2:
-			return this.essids();
-		default:
-			return this.protocolTitles();
-		}
-	}
 
 	/*****************************
-	 * 
-	 * Filter Stuff
-	 * 
+	 *
+	 *          Filter Stuff
+	 *
 	 * ***************************/
 
-	private void openFilterPopupMenuOnView(View v) {
-
-		SimplePopupTable filterMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
-			public void onItemClick(Object ob) {
-				if (ob instanceof AbstractPopupItem) {
-					AbstractPopupItem item = (AbstractPopupItem) ob;
-					RecordOverviewFragment.this.onFilterMenuItemSelected(item);
-				}
-			}
-		});
-		filterMenu.setTitle(FILTER_MENU_POPUP_TITLE);
-		for (String title : RecordOverviewFragment.this.filterMenuTitles()) {
-			AbstractPopupItem item = null;
-			if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW))
-				continue;
-			if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_ABOVE)) {
-				item = new SplitPopupItem(this.getActivity());
-				item.setValue(SplitPopupItem.RIGHT_TITLE, FILTER_MENU_TITLE_TIMESTAMP_BELOW);
-				item.setValue(SplitPopupItem.LEFT_TITLE, FILTER_MENU_TITLE_TIMESTAMP_ABOVE);
-				if (this.filter.hasBelowTimestamp()) {
-					item.setValue(SplitPopupItem.RIGHT_SUBTITLE, this.getDateAsString(this.filter.belowTimestamp));
-				}
-				if (this.filter.hasAboveTimestamp()) {
-					item.setValue(SplitPopupItem.LEFT_SUBTITLE, this.getDateAsString(this.filter.aboveTimestamp));
-				}
-			} else {
-				item = new SimplePopupItem(this.getActivity());
-				item.setTitle(title);
-				((SimplePopupItem) item).setSelected(this.isFilterSetForTitle(title));
-			}
-
-			filterMenu.addItem(item);
+    /**Returns the FilterButton.
+     * @return ImageButton filterButton*/
+    private ImageButton getFilterButton(){
+        return (ImageButton) this.rootView.findViewById(R.id.FilterButton);
+    }
+
+    /**Opens the filter menu on a anchor view. The filter menu will always be on top of the anchor.
+    * @param  v View the anchorView*/
+	private void openFilterPopupMenuOnView(View v){
+
+        SimplePopupTable filterMenu = new SimplePopupTable(this.getActivity(), new AbstractPopup.OnPopupItemClickListener() {
+            public void onItemClick(Object ob) {
+                if (ob instanceof  AbstractPopupItem){
+                    AbstractPopupItem item = (AbstractPopupItem) ob;
+                    RecordOverviewFragment.this.onFilterMenuItemSelected(item);
+                }
+            }
+        });
+        filterMenu.setTitle(FILTER_MENU_POPUP_TITLE);
+		for(String title : RecordOverviewFragment.this.filterMenuTitles()){
+            AbstractPopupItem item = null;
+            if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW)) continue;
+            if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_ABOVE)){
+                item = new SplitPopupItem(this.getActivity());
+                item.setValue(SplitPopupItem.RIGHT_TITLE, FILTER_MENU_TITLE_TIMESTAMP_BELOW);
+                item.setValue(SplitPopupItem.LEFT_TITLE, FILTER_MENU_TITLE_TIMESTAMP_ABOVE);
+                if (this.filter.hasBelowTimestamp()){
+                    item.setValue(SplitPopupItem.RIGHT_SUBTITLE, this.getDateAsString(this.filter.belowTimestamp));
+                }
+                if (this.filter.hasAboveTimestamp()){
+                    item.setValue(SplitPopupItem.LEFT_SUBTITLE, this.getDateAsString(this.filter.aboveTimestamp));
+                }
+            } else {
+                item = new SimplePopupItem(this.getActivity());
+                item.setTitle(title);
+                ((SimplePopupItem)item).setSelected(this.isFilterSetForTitle(title));
+            }
+
+            filterMenu.addItem(item);
 		}
 		filterMenu.showOnView(v);
 	}
 
-	private boolean isFilterSetForTitle(String title) {
-		if (title.equals(FILTER_MENU_TITLE_BSSID)) {
-			return this.filter.hasBSSIDs();
-		}
-		if (title.equals(FILTER_MENU_TITLE_ESSID)) {
-			return this.filter.hasESSIDs();
-		}
-		if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)) {
-			return this.filter.hasProtocols();
-		}
-		if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW)) {
-			return this.filter.hasBelowTimestamp();
-		}
-		if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_ABOVE)) {
-			return this.filter.hasAboveTimestamp();
-		}
-		return false;
-	}
-
-	private void clearFilter() {
-		if (filter == null)
-			this.filter = new LogFilter();
-		this.filter.clear();
+    /**Returns true  if the filter object is set for the given title otherwise false. e.g. the filter object has protocols,
+    * so the method will return for the title FILTER_MENU_TITLE_PROTOCOLS TRUE.
+    * @param  title String
+    * @return boolean value
+    * */
+    private boolean isFilterSetForTitle(String title){
+        if (title.equals(FILTER_MENU_TITLE_BSSID)){
+            return this.filter.hasBSSIDs();
+        }
+        if (title.equals(FILTER_MENU_TITLE_ESSID)){
+            return this.filter.hasESSIDs();
+        }
+        if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
+            return this.filter.hasProtocols();
+        }
+        if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_BELOW)){
+            return this.filter.hasBelowTimestamp();
+        }
+        if (title.equals(FILTER_MENU_TITLE_TIMESTAMP_ABOVE)){
+            return this.filter.hasAboveTimestamp();
+        }
+        return false;
+    }
+
+    /**clears the filter. Does not invoke populatelistview!*/
+	private void clearFilter(){
+    	if(filter == null) this.filter = new LogFilter();
+    	this.filter.clear();
 	}
 
-	public ArrayList<String> groupingTitles(Context context) {
+    /**Returns all grouping titles
+    * @param  context Context
+    * @return ArrayList<String> titles*/
+    public ArrayList<String> groupingTitles(Context context){
+        ArrayList<String> titles = new ArrayList<String>();
+        for (String groupTitle : context.getResources().getStringArray(
+                R.array.Grouping)) {
+            titles.add(groupTitle);
+        }
+        return titles;
+    }
+    /**Returns all grouping titles.
+    * @return ArrayList<String> tiles*/
+    public ArrayList<String> groupingTitles(){
+        ArrayList<String> titles = new ArrayList<String>();
+        for (String groupTitle : this.getResources().getStringArray(
+                R.array.Grouping)) {
+            titles.add(groupTitle);
+        }
+        return titles;
+    }
+    /**
+     * Returns a bool array. This array is true at the index of the groupingKey in groupingTitles(), otherwise false.
+    * @return boolean[] selection
+    * */
+    public boolean[] selectedGroup(){
+        ArrayList<String> groups = this.groupingTitles();
+        boolean[] selected = new boolean[groups.size()];
+        int i = 0;
+        for(String group : groups){
+            selected[i] =(group.equals(this.groupingKey));
+            i++;
+        }
+        return selected;
+    }
+
+    /**Returns all protocol titles / names.
+    * @return ArrayList<String> protocolTitles
+    * */
+	public ArrayList<String> protocolTitles(){
 		ArrayList<String> titles = new ArrayList<String>();
-		for (String groupTitle : context.getResources().getStringArray(R.array.Grouping)) {
-			titles.add(groupTitle);
-		}
-		return titles;
-	}
-
-	public ArrayList<String> groupingTitles() {
-		ArrayList<String> titles = new ArrayList<String>();
-		for (String groupTitle : this.getResources().getStringArray(R.array.Grouping)) {
-			titles.add(groupTitle);
-		}
-		return titles;
-	}
-
-	public boolean[] selectedGroup() {
-		ArrayList<String> groups = this.groupingTitles();
-		boolean[] selected = new boolean[groups.size()];
-		int i = 0;
-		for (String group : groups) {
-			selected[i] = (group.equals(this.groupingKey));
-			i++;
-		}
-		return selected;
-	}
-
-	public ArrayList<String> protocolTitles() {
-		ArrayList<String> titles = new ArrayList<String>();
-		for (String protocol : this.getResources().getStringArray(R.array.protocols)) {
+		for (String protocol : this.getResources().getStringArray(
+				R.array.protocols)) {
 			titles.add(protocol);
 		}
 		return titles;
 	}
-
-	public boolean[] selectedProtocols() {
+    /**Return a boolean array of the selected / filtered protocols. If the filter object has
+    * an protocol from the protocolTitles() array, the index of it will be true, otherwise false.
+    * @return boolean[] protocol selection
+    * */
+	public boolean[] selectedProtocols(){
 		ArrayList<String> protocols = this.protocolTitles();
 		boolean[] selected = new boolean[protocols.size()];
 
 		int i = 0;
-		for (String protocol : protocols) {
-			selected[i] = (this.filter.protocols.contains(protocol));
+		for(String protocol : protocols){
+			selected[i] =(this.filter.protocols.contains(protocol));
 			i++;
 		}
 		return selected;
 	}
 
-	public ArrayList<String> sortTypeTiles() {
+    /**
+    * Returns the Sorttype Titles
+    * @return ArayList<String> Sort type titles
+    * */
+	public ArrayList<String> sortTypeTiles(){
 		ArrayList<String> titles = new ArrayList<String>();
 		titles.add(MainActivity.getContext().getString(R.string.rec_time));
 		titles.add(MainActivity.getContext().getString(R.string.rec_protocol));
-		titles.add("BSSID");
-		titles.add("ESSID");
-		// titles.add("Remote Host Name");
-		// titles.add("Local Host Name");
-		// titles.add("Attack ID");
-		// titles.add("ID");
+		titles.add(MainActivity.getContext().getString(R.string.BSSID));
+		titles.add(MainActivity.getContext().getString(R.string.ESSID));
 		return titles;
 	}
-
-	public boolean[] selectedSorttype() {
+    /**
+    * Returns an boolean array. The array is true at the index of the selected sort type..
+    * The index of the selected sort type is the same index in the sortTypeTiles array.
+    * @return boolean array, length == sortTypeTiles().length
+    * */
+	public boolean[] selectedSorttype(){
 		ArrayList<String> types = this.sortTypeTiles();
 		boolean[] selected = new boolean[types.size()];
 		int i = 0;
-		for (String sorttype : types) {
-			selected[i] = (this.filter.sorttype.toString().equals(sorttype));
+		for(String sorttype : types){
+			selected[i] =(this.filter.sorttype.toString().equals(sorttype));
 			i++;
 		}
 		return selected;
 	}
 
-	public ArrayList<String> bssids() {
+    /**
+    * Returns all unique bssids.
+    * @return ArrayList<String>
+    * */
+	public ArrayList<String> bssids(){
 		ArrayList<String> records = dbh.getUniqueBSSIDRecords();
 		return records;
 	}
-
-	public boolean[] selectedBSSIDs() {
+    /**
+    * Returns an boolean array. The array is true at the indices of the selected bssids.
+    * The index of the selected bssid is the same index in the bssids() array.
+    * @return boolean array, length == bssids().length
+    * */
+	public boolean[] selectedBSSIDs(){
 		ArrayList<String> bssids = this.bssids();
 		boolean[] selected = new boolean[bssids.size()];
 
 		int i = 0;
-		for (String bssid : bssids) {
-			selected[i] = (this.filter.BSSIDs.contains(bssid));
+		for(String bssid : bssids){
+			selected[i] =(this.filter.BSSIDs.contains(bssid));
 			i++;
 		}
 		return selected;
 	}
 
-	public ArrayList<String> essids() {
+    /**
+    * Returns all unique essids.
+    * @return ArrayList<String>
+    * */
+	public ArrayList<String> essids(){
 		ArrayList<String> records = dbh.getUniqueESSIDRecords();
 		return records;
 	}
-
-	public boolean[] selectedESSIDs() {
+    /**
+    * Returns an boolean array. The array is true at the indices of the selected essids.
+    * The index of the selected essid is the same index in the essids() array.
+    * @return boolean array, length == essids().length
+    * */
+	public boolean[] selectedESSIDs(){
 		ArrayList<String> essids = this.essids();
 		boolean[] selected = new boolean[essids.size()];
 
 		int i = 0;
-		for (String essid : essids) {
-			selected[i] = (this.filter.ESSIDs.contains(essid));
+		for(String essid : essids){
+			selected[i] =(this.filter.ESSIDs.contains(essid));
 			i++;
 		}
 		return selected;
 	}
 
-	private ArrayList<String> filterMenuTitles() {
+    /**
+     * Returns all filter menu titles.
+     * @return ArrayList<String>
+     * */
+	private ArrayList<String> filterMenuTitles(){
 		ArrayList<String> titles = new ArrayList<String>();
 		titles.add(FILTER_MENU_TITLE_BSSID);
 		titles.add(FILTER_MENU_TITLE_ESSID);
 		titles.add(FILTER_MENU_TITLE_PROTOCOLS);
 		titles.add(FILTER_MENU_TITLE_TIMESTAMP_ABOVE);
 		titles.add(FILTER_MENU_TITLE_TIMESTAMP_BELOW);
-		if (this.filter.isSet())
-			titles.add(FILTER_MENU_TITLE_REMOVE);
+        if (this.filter.isSet())titles.add(FILTER_MENU_TITLE_REMOVE);
 		return titles;
 	}
 
+
 	/*****************************
-	 * 
-	 * Listener Actions
-	 * 
+	 *
+	 *          Listener Actions
+	 *
 	 * ***************************/
 
+    /**
+     * Will be called if the users selects a timestamp.
+     * @param  dialog {@link DateTimeDialogFragment DateTimeDialogFragment }
+     * */
 	public void onDateTimePickerPositiveClick(DateTimeDialogFragment dialog) {
-		if (this.wasBelowTimePicker) {
+		if(this.wasBelowTimePicker){
 			this.filter.setBelowTimestamp(dialog.getDate());
 		} else {
 			this.filter.setAboveTimestamp(dialog.getDate());
 		}
-		this.populateListViewFromDB(this.expListView);
-	}
-
+        this.actualiseListViewInBackground();
+        this.actualiseFilterButton();
+    }
+    /**
+     * Will be called if the users cancels a timestamp selection.
+     * @param dialog  {@link DateTimeDialogFragment DateTimeDialogFragment }
+     * */
 	public void onDateTimePickerNegativeClick(DateTimeDialogFragment dialog) {
-		if (this.wasBelowTimePicker) {
+		if(this.wasBelowTimePicker){
 			this.filter.setBelowTimestamp(Long.MAX_VALUE);
 		} else {
 			this.filter.setAboveTimestamp(Long.MIN_VALUE);
 		}
-	}
+        this.actualiseFilterButton();
+    }
 
+    /**
+     * Will be called if the users clicks the positiv button on a ChechlistDialog.
+     * @param  dialog  {@link ChecklistDialog ChecklistDialog }
+     */
 	public void onDialogPositiveClick(ChecklistDialog dialog) {
 		String title = dialog.getTitle();
-		if (title.equals(FILTER_MENU_TITLE_BSSID)) {
-			ArrayList<String> titles = dialog.getSelectedItemTitles();
-			if (titles.size() == this.bssids().size()) {
-				this.filter.setBSSIDs(new ArrayList<String>());
-			} else {
-				this.filter.setBSSIDs(titles);
-			}
+		if(title.equals(FILTER_MENU_TITLE_BSSID)){
+            ArrayList<String> titles =dialog.getSelectedItemTitles();
+            if (titles.size() == this.bssids().size()){
+                this.filter.setBSSIDs(new ArrayList<String>());
+            } else {
+                this.filter.setBSSIDs(titles);
+            }
 		}
-		if (title.equals(FILTER_MENU_TITLE_ESSID)) {
-			ArrayList<String> titles = dialog.getSelectedItemTitles();
-			if (titles.size() == this.essids().size()) {
-				this.filter.setESSIDs(new ArrayList<String>());
-			} else {
-				this.filter.setESSIDs(titles);
-			}
+		if(title.equals(FILTER_MENU_TITLE_ESSID)){
+            ArrayList<String> titles =dialog.getSelectedItemTitles();
+            if (titles.size() == this.essids().size()){
+                this.filter.setESSIDs(new ArrayList<String>());
+            } else {
+                this.filter.setESSIDs(titles);
+            }
 		}
-		if (title.equals(FILTER_MENU_TITLE_PROTOCOLS)) {
-			ArrayList<String> protocols = dialog.getSelectedItemTitles();
-			if (protocols.size() == this.protocolTitles().size()) {
-				this.filter.setProtocols(new ArrayList<String>());
-			} else {
-				this.filter.setProtocols(dialog.getSelectedItemTitles());
-			}
+		if(title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
+            ArrayList<String> protocols = dialog.getSelectedItemTitles();
+            if (protocols.size() == this.protocolTitles().size()){
+                this.filter.setProtocols(new ArrayList<String>());
+            } else {
+			    this.filter.setProtocols(dialog.getSelectedItemTitles());
+            }
 		}
-		if (title.equals(FILTER_MENU_TITLE_SORTING)) {
+		if(title.equals(FILTER_MENU_TITLE_SORTING)){
 			ArrayList<String> titles = dialog.getSelectedItemTitles();
-			if (titles.size() == 0)
-				return;
+            if (titles.size() == 0) return;
 			String t = titles.get(0);
 			int sortType = this.sortTypeTiles().indexOf(t);
 			this.filter.setSorttype(SortType.values()[sortType]);
 		}
-		if (title.equals(FILTER_MENU_TITLE_GROUP)) {
-			ArrayList<String> titles = dialog.getSelectedItemTitles();
-			if (titles.size() == 0)
-				return;
-			this.groupingKey = titles.get(0);
-		}
-		this.populateListViewFromDB(this.expListView);
+        if (title.equals(FILTER_MENU_TITLE_GROUP)){
+            ArrayList<String> titles = dialog.getSelectedItemTitles();
+            if (titles.size() == 0) return;
+            this.groupingKey =  titles.get(0);
+        }
+        this.actualiseListViewInBackground();
+
+        this.actualiseFilterButton();
 	}
 
-	public void onDialogNegativeClick(ChecklistDialog dialog) {
+    /**Paints the filter button if the current filter object is set.*/
+    private void actualiseFilterButton(){
+        if (this.filter.isSet() ){
+            ImageButton filterButton = this.getFilterButton();
+            if (filterButton != null){
+                filterButton.setImageResource(R.drawable.ic_filter_pressed);
+                filterButton.invalidate();
+            }
+        } else {
+            ImageButton filterButton = this.getFilterButton();
+            if (filterButton != null){
+                filterButton.setImageResource(R.drawable.ic_filter);
+                filterButton.invalidate();
+            }
+        }
+    }
+
+    /**
+     * Will be called if the users clicks the negativ button on a ChechlistDialog.
+     * @param  dialog  {@link ChecklistDialog ChecklistDialog }
+     */
+	public void onDialogNegativeClick(ChecklistDialog dialog) {}
 
-	}
 
 	/*****************************
-	 * 
-	 * TEST
-	 * 
+	 *
+	 *          TEST
+	 *
 	 * ***************************/
 
-	private void addRecordToDB() {
-		if ((dbh.getRecordCount() > 0))
-			return;
+    /**
+    * This will clear the database at first and than add new attacks.
+    * @param createNetworks number of networks to create
+    * @param attacksPerNetwork maximal number of attack per network
+    * */
+	private void addRecordToDB( int createNetworks, int attacksPerNetwork) {
+        if ((dbh.getRecordCount() > 0)) dbh.clearData();
 
 		Calendar cal = Calendar.getInstance();
 
-		int maxProtocolsIndex = this.getResources().getStringArray(R.array.protocols).length;
+		int maxProtocolsIndex = this.getResources().getStringArray(
+				R.array.protocols).length;
 
 		Random random = new Random();
 
 		LatLng tudarmstadtLoc = new LatLng(49.86923, 8.6632768);
 
-		final int numSSIDs = 10;
-		final int numUniqueSSIDs = 6;
+
 		final double ssidRadius = 0.1;
 		final double bssidRadius = 0.004;
-		int id = 0; // global id
-		for (int ssid = 0; ssid < numSSIDs; ssid++) {
-			LatLng ssidLocation = new LatLng(tudarmstadtLoc.latitude - ssidRadius + 2.0 * ssidRadius * Math.random(), tudarmstadtLoc.longitude - ssidRadius
-					+ 2.0 * ssidRadius * Math.random());
-
-			String ssidName = "WiFi" + ((ssid % numUniqueSSIDs) + 1);
-
-			int numBSSIDs = (Math.abs(random.nextInt()) % 20) + 1;
-			for (int bssid = 0; bssid < numBSSIDs; bssid++) {
-				MessageRecord message = new MessageRecord();	
-				AttackRecord attack =  new AttackRecord();
-				NetworkRecord network = new NetworkRecord();
-				
-				message.setId(id);
-				message.setAttack_id(id);
-				message.setType(MessageRecord.TYPE.SEND);
-				message.setTimestamp(cal.getTimeInMillis() + ((id * 60 * 60 * 60 * 24) * 1000));
-				
-
-				int index = id % maxProtocolsIndex;
-				String protocolName = this.getResources().getStringArray(R.array.protocols)[index];
-
-				attack.setAttack_id(id);
-				attack.setProtocol(protocolName);
-				attack.setLocalIP("127.0.0.1");
-				attack.setBssid("BSSID" + id);
-				
-
-				network.setBssid("BSSID" + id);
-				network.setSsid(ssidName);
-				network.setLatitude(ssidLocation.latitude - bssidRadius + 2.0 * bssidRadius * Math.random());
-				network.setLongitude(ssidLocation.longitude - bssidRadius + 2.0 * bssidRadius * Math.random());
-
-				id++;
-				dbh.updateNetworkInformation(network);
-				dbh.addAttackRecord(attack);
-				dbh.addMessageRecord(message);
-			}
-		}
 
-		int countAllLogs = dbh.getAllRecords().size();
-		int countRecords = dbh.getRecordCount();
-		int countAttacks = dbh.getAttackCount();
+        int attackId = 0;
 
-		if ((countRecords == 0)) {
-			Record rec = dbh.getRecordOfAttackId(0);
-			Record rec2 = dbh.getRecord(0);
+        for (int numOfNetworks = 0; numOfNetworks < createNetworks; numOfNetworks++){
+            String ssidName = "WiFi" + ((numOfNetworks) + 1);
+            String bssidName = "127.0.0." + ((numOfNetworks) + 1);
 
-			System.out.println("" + "Could not create logs!");
-		}
+            int protocolIndex = numOfNetworks % maxProtocolsIndex;
+            String protocolName = this.getResources().getStringArray(
+                    R.array.protocols)[protocolIndex];
 
-	}
+            int numOfAttackPerNetwork = (Math.abs(random.nextInt()) % attacksPerNetwork) + 1;
 
-	/* Navigation */
-	private void pushRecordDetailViewForRecord(Record record) {
+            NetworkRecord network = new NetworkRecord();
+            network.setBssid(bssidName);
+            network.setSsid(ssidName);
 
-		FragmentManager fm = this.getActivity().getFragmentManager();
+            LatLng ssidLocation = new LatLng(tudarmstadtLoc.latitude - ssidRadius + 2.0 * ssidRadius * Math.random(), tudarmstadtLoc.longitude - ssidRadius + 2.0 * ssidRadius * Math.random());
+            double latitude = ssidLocation.latitude - bssidRadius + 2.0 * bssidRadius * Math.random();
+            double longitude = ssidLocation.longitude - bssidRadius + 2.0 * bssidRadius * Math.random();
 
-		if (fm != null) {
-			RecordDetailFragment newFragment = new RecordDetailFragment();
-			newFragment.setRecord(record);
+            long timestamp = cal.getTimeInMillis();
+            network.setTimestampLocation(timestamp);
+            network.setLongitude(longitude);
+            network.setLatitude(latitude);
+            network.setAccuracy(0.f);
 
-			newFragment.setUpNavigatible(true);
+            dbh.updateNetworkInformation(network);
 
-			MainActivity.getInstance().injectFragment(newFragment);
+            // ATTACKS PER NETWORK
+            for (int attackNumber = 0; attackNumber < numOfAttackPerNetwork; attackNumber++) {
 
-		}
+                int numRecordsPerAttack = (Math.abs(random.nextInt()) % 5) + 1;
+                /*
+                * ADD A ATTACK*/
 
-	}
-}
+                AttackRecord attack = new AttackRecord();
+                attack.setAttack_id(attackId);
+
+                attack.setBssid(bssidName);
+
+                attack.setProtocol(protocolName);
+                attack.setLocalIP(bssidName);
+
+
+                dbh.addAttackRecord(attack);
+
+                // RECORDS PER ATTACK
+                for (int messageID = attackId; messageID < attackId + numRecordsPerAttack; messageID++) {
+                    MessageRecord message = new MessageRecord();
+                    message.setId(messageID);
+                    message.setAttack_id(attackId);
+
+                    // GO BACK IN TIME
+                    message.setTimestamp(cal.getTimeInMillis()
+                            - ((messageID * 60 * 60 * 24) * 1000) + (1000 * ((messageID - attackId) + 1)));
+
+                    if ((messageID - attackId) % 2 == 0){
+                        message.setType(MessageRecord.TYPE.RECEIVE);
+                    } else {
+                        message.setType(MessageRecord.TYPE.SEND);
+                    }
+                    message.setPacket("");
+
+                    dbh.addMessageRecord(message);
+                }
+
+                attackId+=numRecordsPerAttack;
+            }
+
+        }
+
+//        int countAllLogs = dbh.getAllRecords().size();
+//        int countRecords = dbh.getRecordCount();
+//        int countAttacks = dbh.getAttackCount();
+//
+//        if ((countRecords == 0)) {
+//            Record rec = dbh.getRecordOfAttackId(0);
+//            Record rec2 = dbh.getRecord(0);
+//
+//            System.out.println("" + "Could not create logs!");
+//        }
+
+    }
+
+
+    /**Navigation. Shows the record detail view for the given record
+    * @param  record  {@link Record Record } to show
+    * */
+    private void pushRecordDetailViewForRecord(Record record){
+
+        FragmentManager fm = this.getActivity().getFragmentManager();
+
+        if (fm != null){
+            RecordDetailFragment newFragment = new RecordDetailFragment();
+            newFragment.setRecord(record);
+
+            newFragment.setUpNavigatible(true);
+
+            MainActivity.getInstance().injectFragment(newFragment);
+
+        }
+
+    }
+}