From 46460922c2eba815dfdacf81440531bd5f49a018 Mon Sep 17 00:00:00 2001 From: Chris Daley Date: Thu, 1 Nov 2018 13:38:34 -0700 Subject: [PATCH] refactoring of activities as per #3 --- .../main/assets/maps/Campus_Geofences.json | 10 +- .../Building_Geofences.json | 13 + .../maps/Evergreen_State_College/tesc.nvm | Bin 0 -> 38285 bytes .../java/com/navatar/MapSelectActivity.java | 241 +++++++++--------- .../java/com/navatar/NavigationActivity.java | 51 ++-- app/src/main/res/values/strings.xml | 2 + 6 files changed, 173 insertions(+), 144 deletions(-) create mode 100644 app/src/main/assets/maps/Evergreen_State_College/Building_Geofences.json create mode 100644 app/src/main/assets/maps/Evergreen_State_College/tesc.nvm diff --git a/app/src/main/assets/maps/Campus_Geofences.json b/app/src/main/assets/maps/Campus_Geofences.json index 6dc17f8..df7020b 100644 --- a/app/src/main/assets/maps/Campus_Geofences.json +++ b/app/src/main/assets/maps/Campus_Geofences.json @@ -10,12 +10,12 @@ } }, { - "name": "Future_Supported_Campus", + "name": "Evergreen_State_College", "geofence": { - "minLatitude": -1, - "minLongitude": -1, - "maxLatitude": -1, - "maxLongitude": -1 + "minLatitude": 47.07037, + "minLongitude": -122.98438, + "maxLatitude": 47.07601, + "maxLongitude": -122.96873 } } ] diff --git a/app/src/main/assets/maps/Evergreen_State_College/Building_Geofences.json b/app/src/main/assets/maps/Evergreen_State_College/Building_Geofences.json new file mode 100644 index 0000000..05cc830 --- /dev/null +++ b/app/src/main/assets/maps/Evergreen_State_College/Building_Geofences.json @@ -0,0 +1,13 @@ +{ + "buildings": [ + { + "name": "tesc_ad458c6d_b4f5_4a1f_8311_10e7bc6c5e3a", + "geofence": { + "minLatitude": 47.073002, + "minLongitude": -122.978612, + "maxLatitude": 47.074387, + "maxLongitude": -122.977103 + } + } + ] +} diff --git a/app/src/main/assets/maps/Evergreen_State_College/tesc.nvm b/app/src/main/assets/maps/Evergreen_State_College/tesc.nvm new file mode 100644 index 0000000000000000000000000000000000000000..05ae266eda265369e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jY_!HkYizW}Mr&-e#zt#ww8lnjY_!HkYizW}Mr&-e#zt#w zw8lnjY_!h(*SY^X_h0A!>)d~x`>%8Vb?(2;{nxqwI`?1a{_EU-o%^qI|8?%a&i&W9 z|2p?y=l<*5f1UfUbN_Yjzs~*Fx&J!%U+4bo+<%?>uXFzmZo9#4H@NKvx82~j8{Bq- z+iq~%4Q{)^Z8x~>2Djbdwj11bgWGO!+YN5J!EHCV?FP5q;I&`hTFK|Hg33$8*bx<+qmI2Zn%vbZsUgA zxZyT#xQ!cb&`hTFK|Hg33``)ubv+qutn?z5fyZ0A1PxzBd)vz_~F z=RVuH&vx#!o%?L(KHIs^cJ8yC`)ubv+qutn?z5fyZ0A1PxzBd)vxBGa;ORSf`VOAH zgQxG{={tD(4xYY)r|;nDJ9zpIp1y;p@8Ib>c=`^WzJsUl;ORSf`VOAHgQxH0i931X zPM)}vC+_5lJ9*+xp16}I?&OI(dE!o-XdJ`|VsoW`AC@Kd;%J*X+-04lpYJ4|pEyvj6}9 literal 0 HcmV?d00001 diff --git a/app/src/main/java/com/navatar/MapSelectActivity.java b/app/src/main/java/com/navatar/MapSelectActivity.java index 297e0e4..1df6c51 100755 --- a/app/src/main/java/com/navatar/MapSelectActivity.java +++ b/app/src/main/java/com/navatar/MapSelectActivity.java @@ -42,12 +42,12 @@ public class MapSelectActivity extends Activity { // Manual selection variables private Spinner mapSpinner,campusSpinner; - private ArrayAdapter mapArrayAdapter,campusArrayAdapter; + private ArrayAdapter mapArrayAdapter; private ArrayList maplist; private MapService mapService; private Intent mapIntent; private PendingIntent pendingIntent; - public static boolean ActivityDestryoed; + //public static boolean ActivityDestryoed; private ArrayList campusNames; // Auto-location variables @@ -83,31 +83,144 @@ protected void onDestroy() { pendingIntent.cancel(); } + @Override + protected void onResume(){ + super.onResume(); + + } + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setTitle("Welcome to Navatar"); + + setTitle(R.string.welcome_to_navatar); setContentView(R.layout.map_select); + // Auto-locate ui items + autoLocateButton = (Button) findViewById(R.id.button); + getQrsCodeButton = (Button) findViewById(R.id.qrButton); + spinner = (ProgressBar)findViewById(R.id.progressBar); + + // Verify storage for route history + verifyStoragePermissions(this); + + setupCampuses(); + + setupMapService(); + + configureQrCodeButton(); + + // Setup location manager for auto-location + configureLocationManager(); + + // Setup autoLocateButton + configureAutoLocateButton(); + + } + + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + switch (requestCode) { + // Location permission + case 10: + // Accepted + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + // Click autoLocateButton again now that we have location permission + autoLocateButton.performClick(); + } + // Denied + else { + // Inform user we need permissions + Toast.makeText(getBaseContext(), "Location permission is required for auto-locating.", + Toast.LENGTH_LONG).show(); + } + + break; + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + try { + + // Get the results of the QR Code scanner + IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); + + if(result != null) { + if(result.getContents() == null) { + Toast.makeText(this, R.string.cancelled, Toast.LENGTH_LONG).show(); + } else { + Toast.makeText(this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show(); + } + } else { + super.onActivityResult(requestCode, resultCode, data); + } + + maplist.clear(); + maplist.add("Select a building"); + + // If maps loaded for selected campus + if(data.hasExtra("maps")) { + // Add maps to spinner + maplist.addAll((ArrayList) data.getSerializableExtra("maps")); + + // If we have a location with high enough accuracy (campus was auto selected) + // and building geofences were loaded + if (CampusAutoSelected && data.hasExtra("geofences")) { + // Get building geofences and convert back to json array + String geofencesString = data.getStringExtra("geofences"); + JSONArray buildingGeofences = new JSONArray(geofencesString); + + // Send in location, get out name of building if supported or null + String foundBuilding = checkIfLocationIsInsideJSONGeofence(buildingGeofences); + + // If location in supported building + if (foundBuilding != null) { + // Replace underscores with spaces, MapService does this for mapList + foundBuilding = foundBuilding.replaceAll("_"," "); + + // Get index of located building name for spinner selection + for (int i = 1; i < maplist.size(); i++) { // skip building label at 0 + if (maplist.get(i).equals(foundBuilding)) { + // Select building + mapSpinner.setSelection(i); + } + } + } + // Not found in supported building + else { + // Assuming location is inaccurate + Toast.makeText(getBaseContext(), "Location is not accurate enough to auto-select building.", + Toast.LENGTH_LONG).show(); + } + } + } + pendingIntent = null; + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void setupMapService() { mapIntent= new Intent(this, MapService.class); + maplist = new ArrayList(); + maplist.add(0,"Select Building"); + mapArrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, + maplist); + startService(mapIntent); + bindService(mapIntent, mMapConnection, BIND_AUTO_CREATE); + } + private void setupCampuses() { campusNames = new ArrayList(); campusSpinner = (Spinner)findViewById(R.id.campusSpinner); - campusArrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, + ArrayAdapter campusArrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, new ArrayList()); campusArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); ArrayList campuslist = new ArrayList(); CampusAutoSelected = false; - // Verify storage for route history - verifyStoragePermissions(this); - - // Auto-locate ui items - autoLocateButton = (Button) findViewById(R.id.button); - getQrsCodeButton = (Button) findViewById(R.id.qrButton); - spinner = (ProgressBar)findViewById(R.id.progressBar); - try { // Get campus files String[] campusFiles = getAssets().list("maps"); @@ -124,27 +237,12 @@ protected void onCreate(Bundle savedInstanceState) { campusNames.add(campusFile); } } - // Load campus geofences loadCampusGeofencesJSONFromAsset(); - // Setup location manager for auto-location - configureLocationManager(); - - // Setup autoLocateButton - configureAutoLocateButton(); - - configureQrCodeButton(); - campusArrayAdapter.addAll(campuslist); campusSpinner.setAdapter(campusArrayAdapter); campusSpinner.setOnItemSelectedListener(campusSpinnerSelected); - maplist = new ArrayList(); - maplist.add(0,"Select Building"); - mapArrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, - maplist); - startService(mapIntent); - bindService(mapIntent, mMapConnection, BIND_AUTO_CREATE); } catch (IOException e) { e.printStackTrace(); @@ -287,27 +385,6 @@ public void onProviderDisabled(String provider) { }; } - @Override - public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { - switch (requestCode) { - // Location permission - case 10: - // Accepted - if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - // Click autoLocateButton again now that we have location permission - autoLocateButton.performClick(); - } - // Denied - else { - // Inform user we need permissions - Toast.makeText(getBaseContext(), "Location permission is required for auto-locating.", - Toast.LENGTH_LONG).show(); - } - - break; - } - } - private void configureAutoLocateButton(){ // Setup autoLocateButton to request location autoLocateButton.setOnClickListener(new View.OnClickListener() { @@ -357,12 +434,6 @@ public void onClick(View v) { }); } - @Override - protected void onResume(){ - super.onResume(); - - } - public OnItemSelectedListener campusSpinnerSelected = new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { @@ -400,68 +471,6 @@ public void onNothingSelected(AdapterView parent) { } }; - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - try { - - // Get the results of the QR Code scanner - IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); - - if(result != null) { - if(result.getContents() == null) { - Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show(); - } else { - Toast.makeText(this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show(); - } - } else { - super.onActivityResult(requestCode, resultCode, data); - } - - maplist.clear(); - maplist.add("Select a building"); - - // If maps loaded for selected campus - if(data.hasExtra("maps")) { - // Add maps to spinner - maplist.addAll((ArrayList) data.getSerializableExtra("maps")); - - // If we have a location with high enough accuracy (campus was auto selected) - // and building geofences were loaded - if (CampusAutoSelected && data.hasExtra("geofences")) { - // Get building geofences and convert back to json array - String geofencesString = data.getStringExtra("geofences"); - JSONArray buildingGeofences = new JSONArray(geofencesString); - - // Send in location, get out name of building if supported or null - String foundBuilding = checkIfLocationIsInsideJSONGeofence(buildingGeofences); - - // If location in supported building - if (foundBuilding != null) { - // Replace underscores with spaces, MapService does this for mapList - foundBuilding = foundBuilding.replaceAll("_"," "); - - // Get index of located building name for spinner selection - for (int i = 1; i < maplist.size(); i++) { // skip building label at 0 - if (maplist.get(i).equals(foundBuilding)) { - // Select building - mapSpinner.setSelection(i); - } - } - } - // Not found in supported building - else { - // Assuming location is inaccurate - Toast.makeText(getBaseContext(), "Location is not accurate enough to auto-select building.", - Toast.LENGTH_LONG).show(); - } - } - } - pendingIntent = null; - } catch (Exception e) { - e.printStackTrace(); - } - } - public OnItemSelectedListener mapSpinnerItemSelected = new OnItemSelectedListener() { public void onItemSelected(AdapterView parent, View view, int position, long id) { // If building is selected diff --git a/app/src/main/java/com/navatar/NavigationActivity.java b/app/src/main/java/com/navatar/NavigationActivity.java index add1485..655906c 100755 --- a/app/src/main/java/com/navatar/NavigationActivity.java +++ b/app/src/main/java/com/navatar/NavigationActivity.java @@ -101,12 +101,12 @@ public class NavigationActivity extends Activity implements NavatarSensorListene public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - String mode = ""; requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.navigation_layout); + reverseRouteButton = (Button) findViewById(R.id.reverseRouteButton); reverseRouteButton.setVisibility(View.GONE); @@ -116,7 +116,7 @@ public void onCreate(Bundle savedInstanceState) { if (extras != null) { // userName = extras.getString("com.Navatar.userName"); // stepLength = extras.getFloat("com.Navatar.stepLength"); - mode = extras.getString("com.Navatar.mode"); + String mode = extras.getString("com.Navatar.mode"); byte[] fb = extras.getByteArray("com.Navatar.fromRoom"); byte[] tb = extras.getByteArray("com.Navatar.toRoom"); @@ -142,26 +142,7 @@ public void onCreate(Bundle savedInstanceState) { // viewUserName.setText(userName); //viewStepLength.setText(String.valueOf(stepLength)); - outputPerfect = - new XmlFile(navatarPath + "/" + "From" + fromRoom.getName() + "To" + toRoom.getName() - + "FeetTraining.xml"); - outputPerfect.append("\r\n"); - - File dir = new File(navatarPath + "/Particles"); - if (!dir.exists()) - dir.mkdir(); - Log.i("XmlFile", "logging in"); - xmlOutput = - new XmlFile(navatarPath + "/Particles/" + fromRoom.getName() + "_" + toRoom.getName() - + "_position.xml"); - xmlOutput.append("\n"); - try { - xmlOutput.writeFile(false); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + writeXml(); handler = new Handler(); @@ -171,7 +152,6 @@ public void onCreate(Bundle savedInstanceState) { bindService(sensingIntent, sensingConnection, BIND_AUTO_CREATE); // Bind with map service - Intent mapIntent = new Intent(this, MapService.class); startService(mapIntent); bindService(mapIntent, mapConnection, BIND_AUTO_CREATE); @@ -185,6 +165,31 @@ public boolean onTouchEvent(MotionEvent event) { return inputHandler.onTouchEvent(event); } + + private void writeXml() { + outputPerfect = + new XmlFile(navatarPath + "/" + "From" + fromRoom.getName() + "To" + toRoom.getName() + + "FeetTraining.xml"); + outputPerfect.append("\r\n"); + + File dir = new File(navatarPath + "/Particles"); + if (!dir.exists()) + dir.mkdir(); + Log.i("XmlFile", "logging in"); + xmlOutput = + new XmlFile(navatarPath + "/Particles/" + fromRoom.getName() + "_" + toRoom.getName() + + "_position.xml"); + xmlOutput.append("\n"); + try { + xmlOutput.writeFile(false); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + // TODO Check that works properly private void landmarkConfirmed(long timestamp) { if (!navigationCommand.startsWith("Turn")) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ade391b..fa97a3d 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -21,4 +21,6 @@ PF Service Map Selection NavigationHistoryActivity + Welcome to Navatar + Cancelled \ No newline at end of file