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

Commit

Permalink
Changed location criteria to medium accuracy
Browse files Browse the repository at this point in the history
XE16/Android 4.4 must have changed how this behaves since coarse
accuracy no longer returns location data for less than 500m accuracy.
  • Loading branch information
longzheng committed May 9, 2014
1 parent e8421b2 commit 84a84e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions PTVGlass/NearMeActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected override void OnCreate(Bundle bundle)
locationManager = GetSystemService(Context.LocationService) as LocationManager;
Criteria locationCriteria = new Criteria()
{
Accuracy = Accuracy.Coarse, // we only need coarse location accuracy
Accuracy = Accuracy.Medium, // we need medium location accuracy
AltitudeRequired = false // we're catching the bus, not planes
};

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

public void OnLocationChanged(Location location)
{
// if location is within 500 meter accuracy, we'll accept it
if (location.Accuracy < 500)
// if location is within 300 meter accuracy, we'll accept it
if (location.Accuracy < 300)
{
locationManager.RemoveUpdates(this); // stop getting location updates to save battery
NearbyDepartures(location); // use the last known location to get nearby departures
Expand Down
2 changes: 1 addition & 1 deletion PTVGlass/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<uses-sdk />
<application android:label="PTVGlass" android:icon="@drawable/icon"></application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
</manifest>

0 comments on commit 84a84e4

Please sign in to comment.