Unable To Get Current Location

I am unable to get current latitude, current longitude and current address. My .aia: GPSSystem (1).aia (4.4 KB). Please check my .aia to find out what is the problem.

Your app works was very good. You must enable a location service in the phone settings (GPS). The location read permissions themselves are not enough.

But if I want ask that permission from the user while using the application, then how can I do that?

You can check if GPS is enabled by this extension.

See these blocks and Project to see how to use this:

Especially the "ScanBT" and Block "AfterChosing"

I am unable to understand that how can I use this in my application.

Analyze the project and understand. The project checks whether GPS is enabled if GPS is turned off. Displays the notification. After clicking the notification button, app passes to the GPS settings on the phone where the user can activate GPS. You asked about it so helps. A bit of your own work ...

You can, of course, look for a different method. Maybe there is an extension, you can also build your own extension.

Not. Spread only blocks that are responsible for locations and displaying notifications. And ActivityStarter to display GPS settings.

Please make an extension using this link https://groups.google.com/g/mitappinventortest/c/talUvz-WSFg/m/LpWTTDSdCAAJ because I did not know how to make an extension.

The above project uses this in ActivityStarter to open the GPS setting screen. You do not need extensions to this.

I am unable to understand what you are trying to tell me. Please elaborate more.

I made works for you and I copied a few blocks from my project to your. Is it really so difficult?
GPSSystem_1.aia (13.0 KB)

No, it wasn't difficult but I was confused as to what you are saying. Thanks for your help and also can you make the same extension for Auto-Rotate. I would be very happy if you make the extension for Auto-Rotate.

Please help for Auto-Rotate and also please tell me that does location sensor is capable to give me latitude and longitude in 1s (1000ms).

Please @Patryk_F, help me in this also .

Please tell me that can you make extension for Auto-Rotate.

Unable to make an extension that changes the way the screen rotates. Earlier, I wrote you to use virtual screens which can be done with arrangement. This would solve your problem.
I can make an example in your project so you can see how it works.

  • LocationSensor
    TimeInterval Determines the minimum time interval, in milliseconds, that the sensor will try to use for sending out location updates. However, location updates will only be received when the location of the phone actually changes, and use of the specified time interval is not guaranteed. For example, if 30000 is used as the time interval, location updates will never be fired sooner than 30000ms, but they may be fired anytime after.

Values smaller than 30000ms (30 seconds) are not practical for most devices. Small values may drain battery and overwork the GPS.

1 Like