Skip to content
This repository was archived by the owner on Dec 3, 2021. It is now read-only.

Commit 84a84e4

Browse files
committed
Changed location criteria to medium accuracy
XE16/Android 4.4 must have changed how this behaves since coarse accuracy no longer returns location data for less than 500m accuracy.
1 parent e8421b2 commit 84a84e4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

PTVGlass/NearMeActivity.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected override void OnCreate(Bundle bundle)
3838
locationManager = GetSystemService(Context.LocationService) as LocationManager;
3939
Criteria locationCriteria = new Criteria()
4040
{
41-
Accuracy = Accuracy.Coarse, // we only need coarse location accuracy
41+
Accuracy = Accuracy.Medium, // we need medium location accuracy
4242
AltitudeRequired = false // we're catching the bus, not planes
4343
};
4444

@@ -160,8 +160,8 @@ public void OnStatusChanged(string provider, Availability status, Bundle extras)
160160

161161
public void OnLocationChanged(Location location)
162162
{
163-
// if location is within 500 meter accuracy, we'll accept it
164-
if (location.Accuracy < 500)
163+
// if location is within 300 meter accuracy, we'll accept it
164+
if (location.Accuracy < 300)
165165
{
166166
locationManager.RemoveUpdates(this); // stop getting location updates to save battery
167167
NearbyDepartures(location); // use the last known location to get nearby departures

PTVGlass/Properties/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<uses-sdk />
44
<application android:label="PTVGlass" android:icon="@drawable/icon"></application>
55
<uses-permission android:name="android.permission.INTERNET" />
6-
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
76
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
7+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
88
</manifest>

0 commit comments

Comments
 (0)