Android Tutorial GPS tutorial

Discussion in 'Tutorials & Examples' started by Erel, Nov 14, 2010.

Thread Status:
Not open for further replies.
  1. Rusty

    Rusty Well-Known Member Licensed User

    in the unfiltered logs I discovered:
    The app was set to #CanInstallToExternalStorage: True and my phone does not have an SD card installed.
    I changed it to #CanInstallToExternalStorage: False and it now installs.
    Thanks Erel, I should have looked at the un-filtered logs before.
    Regards,
    Rusty
     
  2. Almora

    Almora Active Member Licensed User

    is it possible to measure altitude?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Yes. The Location object includes the altitude value.
     
    Almora likes this.
  4. Almora

    Almora Active Member Licensed User

    how can you show just the red zone..
     

    Attached Files:

  5. Erel

    Erel Administrator Staff Member Licensed User

  6. Peekay

    Peekay Member Licensed User

    Erel,
    In the above code you refer to a routine rp in module Starter, but I do not find that in your example code.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    rp is an instance of RuntimePermissions. It is declared in Process_Globals of the Starter service.
     
  8. kris A

    kris A Member Licensed User

    How accurate location GPS it show me on map 30m from where I was
    is it possible to take this down to 2m - 10m?

    My device : Xiaomi Redmi Note 2
    Android version : 5

    Thanks
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
  10. kris A

    kris A Member Licensed User

  11. Husain Ragib

    Husain Ragib Member Licensed User

    Erel, I am abeginner in b4a.
    I downloaded the GPS example and tried to see the output via. B4A bridge connected with my android phone.
    But I could get any information against the labels.
    GPS is enabled in my phone. Can you please help me
     
  12. DonManfred

    DonManfred Expert Licensed User

    1. ALWAYS start a new thread in the questions forum for any question you have.
    2. Did you tried it outdoors? Indoors the gps signal is weak/not available
     
  13. svein berg

    svein berg Member Licensed User

    Hi.
    I'm new to B4A, but so far I like it.
    Have a problem with the GPS.

    I would like the "GPS1_LocationChanged (Location1 As Location)" to fire every 2 seconds or if Location have changed more than one meter.
    So I put;
    gps1.Start(2000,1 )

    But then the "changed event" keep firing like mad without the location changing at all. (Phone is still on my table)

    In the "Activity_Create" - FirstTime I have;
    If gps1.IsInitialized Then gps1.Stop
    as I dont want it to fire before I have initiated a logon procedure, but its firing..

    I'm using B4A v 6.0 and have a Samsung with Android 6.0

    Any help??
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    1. GPS accuracy error can be more than 10 meters.
    2. These values are only a hint to the system about your requirements. You need to add your own code to filter out unwanted events.
     
  15. svein berg

    svein berg Member Licensed User

    Thanks Erel..
    GPS Error is not part of this as I display the Lat,Lon in each LocationChanged, and the error is much less than 1 meter.

    Isnt it possible to stop the Activity from listening to the GPS?
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    You can call GPS.Stop to stop listening.
     
  17. gregmatthews

    gregmatthews Member Licensed User

    All the examples get a lat, lon pair in the locationchanged event. Does this mean the event needs to fire at least once to get a location ? What happens if you start the app and are perfectly still? Can you still get a location?

    Thanks
     
  18. Erel

    Erel Administrator Staff Member Licensed User

    It fires all the time. Even if the location hasn't changed.
     
  19. gregmatthews

    gregmatthews Member Licensed User

    Hi Erel,
    Thanks - my issue must be somewhere else then!
    To clarify:
    The locationChanged event will fire either after a certain number of milliseconds OR after a change in position, the thresholds for each set via the GPS.Start(x,y) function. So if that is GPS.Start(0,0) then it will rapid fire. If GPS.Start(5000,50) if will fire every 5s or if the position changes by 50m, but not more frequently than that?

    Greg
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    This is just a hint to the system. It can (and will) fire more frequent.
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice