My gps sends an error each time i want to run the program

hello everyone , i look for help because i'm stuck with a problem i can't get rid of , i have made a program that is supposed to retrieve the gps coordinates , and for that there is 2 networks available , wifi or gps , the problem is that gps is not working in my house due to large walls , so i try to make it so that the program would "auto choose" the working network , either gps either wifi , and i have an error message saying "cant access coarse/fine location" here is the blocks , please help !

Note the following about Providers:

gps –> (GPS, AGPS)

Name of the GPS location provider. This provider determines location using satellites. Depending on conditions, this provider may take a while to return a location fix. Requires the permission android.permission.ACCESS_FINE_LOCATION.

network –> (AGPS, CellID, WiFi MACID)

Name of the network location provider. This provider determines location based on availability of cell tower and WiFi access points. Results are retrieved by means of a network lookup. Requires either of the permissions android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION.

passive –> (CellID, WiFi MACID)

A special location provider for receiving locations without actually initiating a location fix. This provider can be used to passively receive location updates when other applications or services request them without actually requesting the locations yourself. This provider will return locations generated by other providers. Requires the permission android.permission.ACCESS_FINE_LOCATION, although if the GPS is not enabled this provider might only return coarse fixes.

Not true. Those are a Provider and one of the elements of a passive Provider. GPS is the hardware radio receiver in your Android. You had a discussion about this here GPS returns only 0 - #8 by Taifun . Are you still testing on a dual gps system? Your device's dual-band A-GPS, GLONASS, BDS, GALILEO, QZSS might be the issue. The MIT LocationSensor might not be handling this advance technology correctly. I can't test this not having a dual band gps. Setting location permissions is not ordinarily required when using a phone with a simple gps receiver; your phone is asking for permission so provide it.

AvailableProviders provides a List of available service providers, such as gps or network. This information is provided as a list and in text form. Which providers does your device have available?

Did you read Help with a program (to use the LocationSensor Provider option) - #4 by SteveJG and the advice provided? You do not need to set the Provider, the LocatdionSensor will automatically select an alternative if one of the Providers cannot be used (provided you do not lock the Provider).

You set TimeInterval to 3000 (3 seconds) in Screen.Initialize and your really expect to have the gps receiver to achieve a satellite fix? Try setting it to 30000 (the recommended value to use when having issues with the gps) You also force the Provider to network.

Are you attempting to screen display of reported values in a Clock event. I do not believe that reasoning will work. The Clock will probably interfere with something .

:cry: :cry:

Keep on experimenting; sooner or later you will get this right :slight_smile:

You might be able to correct this issue by using locationPermission

Note also that some Android's require forcibly turning off WIFI to get network (use the cell network)