|
@@ -1,5 +1,7 @@
|
|
package de.tudarmstadt.informatik.hostage.ui2.fragment;
|
|
package de.tudarmstadt.informatik.hostage.ui2.fragment;
|
|
|
|
|
|
|
|
+import com.google.android.gms.maps.model.LatLng;
|
|
|
|
+
|
|
import android.annotation.SuppressLint;
|
|
import android.annotation.SuppressLint;
|
|
import android.app.Fragment;
|
|
import android.app.Fragment;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
@@ -45,7 +47,7 @@ import de.tudarmstadt.informatik.hostage.ui2.model.ExpandableListItem;
|
|
public class RecordOverviewFragment extends Fragment implements ChecklistDialog.ChecklistDialogListener, DateTimeDialogFragment.DateTimeDialogFragmentListener {
|
|
public class RecordOverviewFragment extends Fragment implements ChecklistDialog.ChecklistDialogListener, DateTimeDialogFragment.DateTimeDialogFragmentListener {
|
|
static final String SELECTED_KEY = "Selected";
|
|
static final String SELECTED_KEY = "Selected";
|
|
static final String OTHERS_KEY = "Other";
|
|
static final String OTHERS_KEY = "Other";
|
|
-
|
|
+
|
|
static final String FILTER_MENU_TITLE_BSSID = "BSSID";
|
|
static final String FILTER_MENU_TITLE_BSSID = "BSSID";
|
|
static final String FILTER_MENU_TITLE_ESSID = "ESSID";
|
|
static final String FILTER_MENU_TITLE_ESSID = "ESSID";
|
|
static final String FILTER_MENU_TITLE_PROTOCOLS = "Protocols";
|
|
static final String FILTER_MENU_TITLE_PROTOCOLS = "Protocols";
|
|
@@ -65,20 +67,20 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
private ExpandableListView expListView;
|
|
private ExpandableListView expListView;
|
|
|
|
|
|
UglyDbHelper dbh;
|
|
UglyDbHelper dbh;
|
|
-
|
|
+
|
|
|
|
|
|
public RecordOverviewFragment(){}
|
|
public RecordOverviewFragment(){}
|
|
-
|
|
+
|
|
-
|
|
+
|
|
@Override
|
|
@Override
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
setHasOptionsMenu(true);
|
|
setHasOptionsMenu(true);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
Bundle savedInstanceState) {
|
|
Bundle savedInstanceState) {
|
|
-
|
|
+
|
|
dbh = new UglyDbHelper(this.getActivity().getBaseContext());
|
|
dbh = new UglyDbHelper(this.getActivity().getBaseContext());
|
|
|
|
|
|
|
|
|
|
@@ -98,14 +100,14 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
|
|
|
this.setShowFilterButton(!this.filter.isNotEditable());
|
|
this.setShowFilterButton(!this.filter.isNotEditable());
|
|
this.addRecordToDB();
|
|
this.addRecordToDB();
|
|
-
|
|
+
|
|
View rootView = inflater.inflate(R.layout.fragment_record_list, container, false);
|
|
View rootView = inflater.inflate(R.layout.fragment_record_list, container, false);
|
|
ExpandableListView mylist = (ExpandableListView) rootView.findViewById(R.id.loglistview);
|
|
ExpandableListView mylist = (ExpandableListView) rootView.findViewById(R.id.loglistview);
|
|
this.expListView = mylist;
|
|
this.expListView = mylist;
|
|
populateListViewFromDB(mylist);
|
|
populateListViewFromDB(mylist);
|
|
-
|
|
+
|
|
registerListClickCallback(mylist);
|
|
registerListClickCallback(mylist);
|
|
-
|
|
+
|
|
ImageButton filterButton = (ImageButton) rootView.findViewById(R.id.FilterButton);
|
|
ImageButton filterButton = (ImageButton) rootView.findViewById(R.id.FilterButton);
|
|
filterButton.setOnClickListener(new View.OnClickListener() {
|
|
filterButton.setOnClickListener(new View.OnClickListener() {
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
@@ -113,7 +115,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
}
|
|
}
|
|
});
|
|
});
|
|
filterButton.setVisibility(this.showFilterButton? View.VISIBLE : View.INVISIBLE);
|
|
filterButton.setVisibility(this.showFilterButton? View.VISIBLE : View.INVISIBLE);
|
|
-
|
|
+
|
|
ImageButton sortButton = (ImageButton) rootView.findViewById(R.id.SortButton);
|
|
ImageButton sortButton = (ImageButton) rootView.findViewById(R.id.SortButton);
|
|
sortButton.setOnClickListener(new View.OnClickListener() {
|
|
sortButton.setOnClickListener(new View.OnClickListener() {
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
@@ -129,7 +131,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
RecordOverviewFragment.this.openGroupingDialog();
|
|
RecordOverviewFragment.this.openGroupingDialog();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
+
|
|
return rootView;
|
|
return rootView;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -141,13 +143,13 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
|
|
|
public boolean onFilterMenuItemSelected(MenuItem item) {
|
|
public boolean onFilterMenuItemSelected(MenuItem item) {
|
|
String title = item.getTitle().toString();
|
|
String title = item.getTitle().toString();
|
|
-
|
|
+
|
|
if(title.equals(FILTER_MENU_TITLE_BSSID)){
|
|
if(title.equals(FILTER_MENU_TITLE_BSSID)){
|
|
this.openBSSIDFilterDialog();
|
|
this.openBSSIDFilterDialog();
|
|
}
|
|
}
|
|
if(title.equals(FILTER_MENU_TITLE_ESSID)){
|
|
if(title.equals(FILTER_MENU_TITLE_ESSID)){
|
|
this.openESSIDFilterDialog();
|
|
this.openESSIDFilterDialog();
|
|
- }
|
|
+ }
|
|
if(title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
if(title.equals(FILTER_MENU_TITLE_PROTOCOLS)){
|
|
this.openProtocolsFilterDialog();
|
|
this.openProtocolsFilterDialog();
|
|
}
|
|
}
|
|
@@ -166,17 +168,17 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
}
|
|
}
|
|
return super.onOptionsItemSelected(item);
|
|
return super.onOptionsItemSelected(item);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
|
|
|
|
- *
|
|
+ *
|
|
* ListView Stuff
|
|
* ListView Stuff
|
|
- *
|
|
+ *
|
|
* ***************************/
|
|
* ***************************/
|
|
-
|
|
+
|
|
private void populateListViewFromDB(ExpandableListView mylist) {
|
|
private void 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(this.filter);
|
|
@@ -228,15 +230,15 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
|
|
|
mylist.setAdapter(adapter);
|
|
mylist.setAdapter(adapter);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private Context getBaseContext(){
|
|
private Context getBaseContext(){
|
|
return this.getActivity().getBaseContext();
|
|
return this.getActivity().getBaseContext();
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private Context getApplicationContext(){
|
|
private Context getApplicationContext(){
|
|
return this.getActivity().getApplicationContext();
|
|
return this.getActivity().getApplicationContext();
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private void registerListClickCallback(ExpandableListView mylist) {
|
|
private void registerListClickCallback(ExpandableListView mylist) {
|
|
|
|
|
|
mylist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
mylist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
@@ -268,16 +270,16 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
|
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
|
|
|
|
- *
|
|
+ *
|
|
* Date Transform
|
|
* Date Transform
|
|
- *
|
|
+ *
|
|
* ***************************/
|
|
* ***************************/
|
|
-
|
|
+
|
|
-
|
|
+
|
|
@SuppressLint("SimpleDateFormat")
|
|
@SuppressLint("SimpleDateFormat")
|
|
private String getDateAsString(long timeStamp) {
|
|
private String getDateAsString(long timeStamp) {
|
|
|
|
|
|
@@ -289,12 +291,12 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
return "xx";
|
|
return "xx";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
+
|
|
-
|
|
+
|
|
|
|
|
|
- *
|
|
+ *
|
|
* Getter / Setter
|
|
* Getter / Setter
|
|
- *
|
|
+ *
|
|
* ***************************/
|
|
* ***************************/
|
|
|
|
|
|
public boolean isShowFilterButton() {
|
|
public boolean isShowFilterButton() {
|
|
@@ -304,50 +306,50 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
public void setShowFilterButton(boolean showFilterButton) {
|
|
public void setShowFilterButton(boolean showFilterButton) {
|
|
this.showFilterButton = showFilterButton;
|
|
this.showFilterButton = showFilterButton;
|
|
}
|
|
}
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
|
|
|
|
|
|
|
|
- *
|
|
+ *
|
|
* Open Dialog Methods
|
|
* Open Dialog Methods
|
|
- *
|
|
+ *
|
|
* ***************************/
|
|
* ***************************/
|
|
|
|
|
|
private void openGroupingDialog(){
|
|
private void openGroupingDialog(){
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_GROUP, this.groupingTitles(), this.selectedGroup(), false , this);
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_GROUP, this.groupingTitles(), this.selectedGroup(), false , this);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_GROUP);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_GROUP);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private void openBSSIDFilterDialog(){
|
|
private void openBSSIDFilterDialog(){
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_BSSID,this.bssids(), this.selectedBSSIDs(), true , this);
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_BSSID,this.bssids(), this.selectedBSSIDs(), true , this);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_BSSID);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_BSSID);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private void openESSIDFilterDialog(){
|
|
private void openESSIDFilterDialog(){
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_ESSID,this.essids(), this.selectedESSIDs(), true , this);
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_ESSID,this.essids(), this.selectedESSIDs(), true , this);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_ESSID);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_ESSID);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private void openProtocolsFilterDialog(){
|
|
private void openProtocolsFilterDialog(){
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_PROTOCOLS,this.protocolTitles(), this.selectedProtocols(), true , this);
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_PROTOCOLS,this.protocolTitles(), this.selectedProtocols(), true , this);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_PROTOCOLS);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_PROTOCOLS);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private void openTimestampFromFilterDialog(){
|
|
private void openTimestampFromFilterDialog(){
|
|
this.wasBelowTimePicker = false;
|
|
this.wasBelowTimePicker = false;
|
|
DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
|
|
DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
|
|
if (this.filter.aboveTimestamp != Long.MIN_VALUE)newFragment.setDate(this.filter.aboveTimestamp);
|
|
if (this.filter.aboveTimestamp != Long.MIN_VALUE)newFragment.setDate(this.filter.aboveTimestamp);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private void openTimestampToFilterDialog(){
|
|
private void openTimestampToFilterDialog(){
|
|
this.wasBelowTimePicker = true;
|
|
this.wasBelowTimePicker = true;
|
|
DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
|
|
DateTimeDialogFragment newFragment = new DateTimeDialogFragment(this.getActivity());
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
|
|
if (this.filter.belowTimestamp != Long.MAX_VALUE) newFragment.setDate(this.filter.belowTimestamp);
|
|
if (this.filter.belowTimestamp != Long.MAX_VALUE) newFragment.setDate(this.filter.belowTimestamp);
|
|
}
|
|
}
|
|
-
|
|
+
|
|
private void openSortingDialog(){
|
|
private void openSortingDialog(){
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_SORTING,this.sortTypeTtiles(), this.selectedSorttype(), false , this);
|
|
ChecklistDialog newFragment = new ChecklistDialog(FILTER_MENU_TITLE_SORTING,this.sortTypeTtiles(), this.selectedSorttype(), false , this);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
|
|
newFragment.show(this.getActivity().getFragmentManager(), FILTER_MENU_TITLE_SORTING);
|
|
@@ -389,11 +391,11 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- *
|
|
+ *
|
|
* Filter Stuff
|
|
* Filter Stuff
|
|
- *
|
|
+ *
|
|
* ***************************/
|
|
* ***************************/
|
|
-
|
|
+
|
|
private void openFilterPopupMenuOnView(View v){
|
|
private void openFilterPopupMenuOnView(View v){
|
|
|
|
|
|
PopupMenu filterMenu = new PopupMenu(getBaseContext(), v);
|
|
PopupMenu filterMenu = new PopupMenu(getBaseContext(), v);
|
|
@@ -411,8 +413,8 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
});
|
|
});
|
|
filterMenu.show();
|
|
filterMenu.show();
|
|
}
|
|
}
|
|
-
|
|
+
|
|
-
|
|
+
|
|
private void clearFilter(){
|
|
private void clearFilter(){
|
|
if(filter == null) this.filter = new LogFilter();
|
|
if(filter == null) this.filter = new LogFilter();
|
|
this.filter.clear();
|
|
this.filter.clear();
|
|
@@ -436,7 +438,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
}
|
|
}
|
|
return selected;
|
|
return selected;
|
|
}
|
|
}
|
|
-
|
|
+
|
|
public ArrayList<String> protocolTitles(){
|
|
public ArrayList<String> protocolTitles(){
|
|
ArrayList<String> titles = new ArrayList<String>();
|
|
ArrayList<String> titles = new ArrayList<String>();
|
|
for (String protocol : this.getResources().getStringArray(
|
|
for (String protocol : this.getResources().getStringArray(
|
|
@@ -448,7 +450,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
public boolean[] selectedProtocols(){
|
|
public boolean[] selectedProtocols(){
|
|
ArrayList<String> protocols = this.protocolTitles();
|
|
ArrayList<String> protocols = this.protocolTitles();
|
|
boolean[] selected = new boolean[protocols.size()];
|
|
boolean[] selected = new boolean[protocols.size()];
|
|
-
|
|
+
|
|
int i = 0;
|
|
int i = 0;
|
|
for(String protocol : protocols){
|
|
for(String protocol : protocols){
|
|
selected[i] =(this.filter.protocols.contains(protocol));
|
|
selected[i] =(this.filter.protocols.contains(protocol));
|
|
@@ -471,7 +473,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
}
|
|
}
|
|
public boolean[] selectedSorttype(){
|
|
public boolean[] selectedSorttype(){
|
|
ArrayList<String> types = this.sortTypeTtiles();
|
|
ArrayList<String> types = this.sortTypeTtiles();
|
|
- boolean[] selected = new boolean[types.size()];
|
|
+ boolean[] selected = new boolean[types.size()];
|
|
int i = 0;
|
|
int i = 0;
|
|
for(String sorttype : types){
|
|
for(String sorttype : types){
|
|
selected[i] =(this.filter.sorttype.toString() == sorttype);
|
|
selected[i] =(this.filter.sorttype.toString() == sorttype);
|
|
@@ -479,7 +481,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
}
|
|
}
|
|
return selected;
|
|
return selected;
|
|
}
|
|
}
|
|
-
|
|
+
|
|
public ArrayList<String> bssids(){
|
|
public ArrayList<String> bssids(){
|
|
ArrayList<String> records = dbh.getUniqueBSSIDRecords();
|
|
ArrayList<String> records = dbh.getUniqueBSSIDRecords();
|
|
return records;
|
|
return records;
|
|
@@ -487,7 +489,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
public boolean[] selectedBSSIDs(){
|
|
public boolean[] selectedBSSIDs(){
|
|
ArrayList<String> bssids = this.bssids();
|
|
ArrayList<String> bssids = this.bssids();
|
|
boolean[] selected = new boolean[bssids.size()];
|
|
boolean[] selected = new boolean[bssids.size()];
|
|
-
|
|
+
|
|
int i = 0;
|
|
int i = 0;
|
|
for(String bssid : bssids){
|
|
for(String bssid : bssids){
|
|
selected[i] =(this.filter.BSSIDs.contains(bssid));
|
|
selected[i] =(this.filter.BSSIDs.contains(bssid));
|
|
@@ -504,7 +506,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
public boolean[] selectedESSIDs(){
|
|
public boolean[] selectedESSIDs(){
|
|
ArrayList<String> essids = this.essids();
|
|
ArrayList<String> essids = this.essids();
|
|
boolean[] selected = new boolean[essids.size()];
|
|
boolean[] selected = new boolean[essids.size()];
|
|
-
|
|
+
|
|
int i = 0;
|
|
int i = 0;
|
|
for(String essid : essids){
|
|
for(String essid : essids){
|
|
selected[i] =(this.filter.ESSIDs.contains(essid));
|
|
selected[i] =(this.filter.ESSIDs.contains(essid));
|
|
@@ -513,7 +515,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
return selected;
|
|
return selected;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+
|
|
private ArrayList<String> filterMenuTitles(){
|
|
private ArrayList<String> filterMenuTitles(){
|
|
ArrayList<String> titles = new ArrayList<String>();
|
|
ArrayList<String> titles = new ArrayList<String>();
|
|
titles.add(FILTER_MENU_TITLE_BSSID);
|
|
titles.add(FILTER_MENU_TITLE_BSSID);
|
|
@@ -525,13 +527,13 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
return titles;
|
|
return titles;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
+
|
|
|
|
|
|
- *
|
|
+ *
|
|
* Listener Actions
|
|
* Listener Actions
|
|
- *
|
|
+ *
|
|
* ***************************/
|
|
* ***************************/
|
|
-
|
|
+
|
|
public void onDateTimePickerPositiveClick(DateTimeDialogFragment dialog) {
|
|
public void onDateTimePickerPositiveClick(DateTimeDialogFragment dialog) {
|
|
if(this.wasBelowTimePicker){
|
|
if(this.wasBelowTimePicker){
|
|
this.filter.setBelowTimestamp(dialog.getDate());
|
|
this.filter.setBelowTimestamp(dialog.getDate());
|
|
@@ -548,7 +550,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
this.filter.setAboveTimestamp(Long.MIN_VALUE);
|
|
this.filter.setAboveTimestamp(Long.MIN_VALUE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
+
|
|
public void onDialogPositiveClick(ChecklistDialog dialog) {
|
|
public void onDialogPositiveClick(ChecklistDialog dialog) {
|
|
String title = dialog.getTitle();
|
|
String title = dialog.getTitle();
|
|
if(title.equals(FILTER_MENU_TITLE_BSSID)){
|
|
if(title.equals(FILTER_MENU_TITLE_BSSID)){
|
|
@@ -591,14 +593,14 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
public void onDialogNegativeClick(ChecklistDialog dialog) {
|
|
public void onDialogNegativeClick(ChecklistDialog dialog) {
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
+
|
|
-
|
|
+
|
|
|
|
|
|
- *
|
|
+ *
|
|
- * TEST
|
|
+ * TEST
|
|
- *
|
|
+ *
|
|
* ***************************/
|
|
* ***************************/
|
|
-
|
|
+
|
|
private void addRecordToDB() {
|
|
private void addRecordToDB() {
|
|
|
|
|
|
if ((dbh.getRecordCount() > 0)) return;
|
|
if ((dbh.getRecordCount() > 0)) return;
|
|
@@ -610,6 +612,7 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
|
|
|
|
Random random = new Random();
|
|
Random random = new Random();
|
|
|
|
|
|
|
|
+ LatLng tudarmstadtLoc = new LatLng(49.86923, 8.6632768);
|
|
int numberofRecords = (int) (Math.random() * (50 - 10));
|
|
int numberofRecords = (int) (Math.random() * (50 - 10));
|
|
for (int i = 0; i < numberofRecords; i++) {
|
|
for (int i = 0; i < numberofRecords; i++) {
|
|
Record record = new Record();
|
|
Record record = new Record();
|
|
@@ -629,8 +632,8 @@ public class RecordOverviewFragment extends Fragment implements ChecklistDialog.
|
|
record.setLocalIP("127.0.0.1");
|
|
record.setLocalIP("127.0.0.1");
|
|
record.setType(TYPE.SEND);
|
|
record.setType(TYPE.SEND);
|
|
|
|
|
|
- record.setLatitude(41.889 + random.nextDouble());
|
|
+ record.setLatitude(tudarmstadtLoc.latitude + -0.01 + 0.02 * random.nextDouble());
|
|
- record.setLongitude(-87.622 + random.nextDouble());
|
|
+ record.setLongitude(tudarmstadtLoc.longitude + -0.01 + 0.02 * random.nextDouble());
|
|
|
|
|
|
dbh.addRecord(record);
|
|
dbh.addRecord(record);
|
|
}
|
|
}
|