-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #357 Locus integration not working
- bump Locus API library on Gradle from 0.2.7 to 0.9.45 - removed `Location` initializer with string (no longer supported) - changed LAPI dependencies in files to newer version + required refactor of corresponding code - changed `Location.java` inits with only `TAG` string resource (obsolete) - changed `Location.Accuracy` (removed support) to horizontal accuracy - removed dependency on locus api when loading cartridges (never fully implemented)
- Loading branch information
Showing
15 changed files
with
108 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -147,7 +147,7 @@ public static Location getLastKnownLocation(Activity activity) { | |
|
||
public static Location getLocation() { | ||
if (location == null) | ||
return new Location(TAG); | ||
return new Location(); | ||
return new Location(location); | ||
} | ||
|
||
|
@@ -331,7 +331,7 @@ static void onLocationChanged(Location location) { | |
// if first location from Network, and new from GPS but with worst precision, do not set | ||
if (LocationState.location.getProvider().equals(LocationManager.NETWORK_PROVIDER) | ||
&& location.getProvider().equals(LocationManager.GPS_PROVIDER) | ||
&& (LocationState.location.getAccuracy() * 3) < location.getAccuracy()) { | ||
&& (LocationState.location.getAccuracyHor() * 3) < location.getAccuracyHor()) { | ||
return; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -132,7 +132,7 @@ public void onOrientationChanged(float azimuth, float pitch, float roll) { | |
viewLat.setText(UtilsFormat.formatLatitude(loc.getLatitude())); | ||
viewLon.setText(UtilsFormat.formatLongitude(loc.getLongitude())); | ||
viewAlt.setText(UtilsFormat.formatAltitude(loc.getAltitude(), true)); | ||
viewAcc.setText(UtilsFormat.formatDistance((double) loc.getAccuracy(), false)); | ||
viewAcc.setText(UtilsFormat.formatDistance((double) loc.getAccuracyHor(), false)); | ||
viewSpeed.setText(UtilsFormat.formatSpeed(loc.getSpeed(), false)); | ||
|
||
repaint(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -49,7 +49,8 @@ | |
import cz.matejcik.openwig.Engine; | ||
import cz.matejcik.openwig.formats.CartridgeFile; | ||
import locus.api.objects.extra.Location; | ||
import locus.api.objects.extra.Waypoint; | ||
|
||
//import locus.api.objects.extra.Waypoint; | ||
|
||
import menion.android.whereyougo.MainApplication; | ||
import menion.android.whereyougo.R; | ||
|
@@ -179,9 +180,6 @@ public static void refreshCartridges() { | |
File[] files = FileSystem.getFiles(FileSystem.ROOT, "gwc"); | ||
cartridgeFiles = new Vector<>(); | ||
|
||
// add cartridges to map | ||
ArrayList<Waypoint> wpts = new ArrayList<>(); | ||
|
||
File actualFile = null; | ||
if (files != null) { | ||
for (File file : files) { | ||
|
@@ -190,26 +188,14 @@ public static void refreshCartridges() { | |
CartridgeFile cart = CartridgeFile.read(new WSeekableFile(file), new WSaveFile(file)); | ||
if (cart != null) { | ||
cart.filename = file.getAbsolutePath(); | ||
|
||
Location loc = new Location(TAG); | ||
loc.setLatitude(cart.latitude); | ||
loc.setLongitude(cart.longitude); | ||
Waypoint waypoint = new Waypoint(cart.name, loc); | ||
|
||
cartridgeFiles.add(cart); | ||
wpts.add(waypoint); | ||
} | ||
} catch (Exception e) { | ||
Logger.w(TAG, "refreshCartridge(), file:" + actualFile + ", e:" + e.toString()); | ||
ManagerNotify.toastShortMessage(Locale.getString(R.string.invalid_cartridge, actualFile.getName())); | ||
// file.delete(); | ||
} | ||
} | ||
} | ||
|
||
if (wpts.size() > 0) { | ||
// TODO add items on map | ||
} | ||
} | ||
|
||
public static void openCartridge(final CartridgeFile cartridgeFile) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -162,7 +162,7 @@ public void run() { | |
((TextView) findViewById(R.id.text_view_altitude)).setText(UtilsFormat.formatAltitude( | ||
location.getAltitude(), true)); | ||
((TextView) findViewById(R.id.text_view_accuracy)).setText(UtilsFormat.formatDistance( | ||
location.getAccuracy(), false)); | ||
location.getAccuracyHor(), false)); | ||
((TextView) findViewById(R.id.text_view_speed)).setText(UtilsFormat.formatSpeed( | ||
location.getSpeed(), false)); | ||
((TextView) findViewById(R.id.text_view_declination)).setText(UtilsFormat | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
/* | ||
* This file is part of WhereYouGo. | ||
* | ||
* | ||
* WhereYouGo is free software: you can redistribute it and/or modify it under the terms of the GNU | ||
* General Public License as published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* | ||
* WhereYouGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without | ||
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU General Public License along with WhereYouGo. If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Copyright (C) 2012 Menion <[email protected]> | ||
*/ | ||
|
||
|
@@ -175,7 +175,7 @@ public DataInfo setImageRight(Bitmap image) { | |
} | ||
|
||
public Location getLocation() { | ||
Location loc = new Location(TAG); | ||
Location loc = new Location(); | ||
loc.setLatitude(value01); | ||
loc.setLongitude(value02); | ||
return loc; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.