0

I try tow plugin to find location in an app that work on mobile and android TV but with no luck.

Twice work fine on mobile but hang on Android TV. I try emulator and a real TV.

  1. Flutter-Location

in V4.4.0 and 5.0.0-dev.8

V5 Hang in onChangeLocation function from GooglePlayServicesLocationProvider.java (null object) but randomly give a location if accuracy is set to low.

  1. Géolocator

hang with this error :

E/AndroidRuntime( 3578): Caused by: com.google.android.gms.common.api.ApiException: 10: Not implemented on this platform. E/AndroidRuntime( 3578): at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@18.1.0:3)

according to this question ther is no provider. But if i understand Flutter-Location plugin try differant way GPS Google service and network provider in V5. but V5 is in dev and crash my app when no location where find.

Is there another plugin or other way to get location on Android TV.

Thanks for your help

JD11
  • 1
  • 1

1 Answers1

0

tv does not have gps. therefore you cannot get precise location information.

you can instead opt for a one-off location with a low forecast.

Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.low);

it will stay in the same place unless someone steals it :)

  • Thanks for your reply. I use sample code with this location setting : final position = await _geolocatorPlatform.getCurrentPosition(locationSettings: LocationSettings(accuracy: LocationAccuracy.low)); then serviceEnabled = await _geolocatorPlatform.isLocationServiceEnabled(); crash application. If i comment this line i have LocationServiceDisabledException (The location service on the device is disabled.) – JD11 Jul 11 '23 at 06:10
  • we need to make sure that the device supports location. I have read in a few articles that some TVs have no location feature at all. – Ahmet BALKAN Jul 11 '23 at 11:33
  • I can allow location with emulator and TV. I want to display weather so network provider is enough. I try webview also with 'navigator.geolocation.getcurrentposition' with no more luck. Thanks for your time – JD11 Jul 12 '23 at 06:30