Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Location Service - Huawei Y300 #18

Closed
Goksly opened this issue Oct 14, 2013 · 1 comment
Closed

Location Service - Huawei Y300 #18

Goksly opened this issue Oct 14, 2013 · 1 comment

Comments

@Goksly
Copy link

Goksly commented Oct 14, 2013

The following code:

var locationResult = new GeoLocationResult();
var locator = new Geolocator(Android.App.Application.Context) { DesiredAccuracy = 50 };
locationResult.IsAvailable = locator.IsGeolocationAvailable;
locationResult.IsEnabled = locator.IsGeolocationEnabled;

return locator.GetPositionAsync(10000).ContinueWith(t =>
{
    // User might have cancelled it or faulted (GPS switched off). If this is the casem return null.
    if (t.IsCanceled || t.Status == TaskStatus.Faulted)
        return null;

    locationResult.Accuracy = t.Result.Accuracy;
    locationResult.Altitude = t.Result.Altitude;
    locationResult.AltitudeAccuracy = t.Result.AltitudeAccuracy;
    locationResult.Heading = t.Result.Heading;
    locationResult.Latitude = t.Result.Latitude;
    locationResult.Longitude = t.Result.Longitude;
    locationResult.Speed = t.Result.Speed;
    return locationResult;
});

This works fine on all phones I've tested (LG, Samsung, HTC, Sony) however on the Huawei it always gets has t.IsCancelled = true. I've checked that GPS is enabled and that applications can use it (i.e. settings match other phones).

When opening google maps, my location is given, so I'm assuming that hardware is ok.

@ermau
Copy link
Member

ermau commented Dec 10, 2013

Probably a duplicate of #16

@ermau ermau closed this as completed Dec 10, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants