Nov 14, 2010 Replies: 311 The GNSS library replaces the old GPS library. The GNSS library is available here: https://www.b4x.com/android/forum/threads/gnss-library-an-updated-gps-library.109110/#content Using it is quite simple: 1. Checking whether location services are available. If not take the user to the settings. 2. Request permission. If the purpose is to get the user location then the FusedLocationProvider might be a better option: https://www.b4x.com/android/forum/threads/fusedlocationprovider-resolution-dialog.111652/#content Attachments GPSExample.zip GPSExample.zip 15 KB · Views: 1,240 Last edited: Mar 13, 2025 Click to expand...
The GNSS library replaces the old GPS library. The GNSS library is available here: https://www.b4x.com/android/forum/threads/gnss-library-an-updated-gps-library.109110/#content Using it is quite simple: 1. Checking whether location services are available. If not take the user to the settings. 2. Request permission. If the purpose is to get the user location then the FusedLocationProvider might be a better option: https://www.b4x.com/android/forum/threads/fusedlocationprovider-resolution-dialog.111652/#content
agraham Expert Licensed User Longtime User Mar 8, 2013 #141 I assume the original readins are degrees:minutes so try this. Code: Dim lon, degmin() As String Dim evernote As Double lon = "146:59.30533" degmin = Regex.Split(":", lon) If degmin(0) < 1 Then degmin(1) = -degmin(1) evernote = degmin(0) + degmin(1)/60 Msgbox(degmin(0) & CRLF & degmin(1),evernote) Last edited: Mar 8, 2013
I assume the original readins are degrees:minutes so try this. Code: Dim lon, degmin() As String Dim evernote As Double lon = "146:59.30533" degmin = Regex.Split(":", lon) If degmin(0) < 1 Then degmin(1) = -degmin(1) evernote = degmin(0) + degmin(1)/60 Msgbox(degmin(0) & CRLF & degmin(1),evernote)
G gregmartin64 Member Licensed User Longtime User Mar 8, 2013 #142 tsteward said: Using the GPS library I get the following returned: Lat = -36:3.20404 Lon = 146:59.30533 Now still sitting in the same chair, in Evernote I create a note that records my current GPS as -36.204040 146.305330 My app creates notes in evernote and I need the same format as Evernotes. I have read this thread, possibly missed the info I need. But is there a way to convert from one the top pair of Lat Lon to the evernote type pair. Click to expand... In the Sub GPS_LocationChanged (Location1 As Location) you can get it like this Code: dim lat as string dim lng as string lng=NumberFormat(Location1.Longitude,0,10) lat=NumberFormat(Location1.Latitude,0,10) Set the decimal places to how accurate you want the position ( I put it to 10 decimal places. )
tsteward said: Using the GPS library I get the following returned: Lat = -36:3.20404 Lon = 146:59.30533 Now still sitting in the same chair, in Evernote I create a note that records my current GPS as -36.204040 146.305330 My app creates notes in evernote and I need the same format as Evernotes. I have read this thread, possibly missed the info I need. But is there a way to convert from one the top pair of Lat Lon to the evernote type pair. Click to expand... In the Sub GPS_LocationChanged (Location1 As Location) you can get it like this Code: dim lat as string dim lng as string lng=NumberFormat(Location1.Longitude,0,10) lat=NumberFormat(Location1.Latitude,0,10) Set the decimal places to how accurate you want the position ( I put it to 10 decimal places. )
tsteward Well-Known Member Licensed User Longtime User Mar 8, 2013 #143 Thats sweet guys. Thank you :sign0060:
J jimmyjace Member Licensed User Longtime User Apr 4, 2013 #144 GPS - Latitude Ref and Longitude Ref Hi Erel, Great tutorial on using GPS. I'm trying to get the Lat and Long Ref values which contain N,E,S,W but don't seem to be able to find them. Any ideas where i get the settings? Kind Regards, Jason
GPS - Latitude Ref and Longitude Ref Hi Erel, Great tutorial on using GPS. I'm trying to get the Lat and Long Ref values which contain N,E,S,W but don't seem to be able to find them. Any ideas where i get the settings? Kind Regards, Jason
klaus Expert Licensed User Longtime User Apr 4, 2013 #145 In the GPS_LocationChanged event you get a Location object which have a Latitude and a Longitude property. Latitude > 0 is North Latitude < 0 is South Longitude > 0 is East Longitude < 0 is West Best regards.
In the GPS_LocationChanged event you get a Location object which have a Latitude and a Longitude property. Latitude > 0 is North Latitude < 0 is South Longitude > 0 is East Longitude < 0 is West Best regards.
L LittleBritaly Member Licensed User Longtime User Apr 22, 2013 #146 Can someone advise on how can I detect when the location has changed a set distance (10 metres for example). Basically I want the phone to send me an sms/phone me if the location changes and periodically sms me it's location. Thanks
Can someone advise on how can I detect when the location has changed a set distance (10 metres for example). Basically I want the phone to send me an sms/phone me if the location changes and periodically sms me it's location. Thanks
Erel B4X founder Staff member Licensed User Longtime User Apr 23, 2013 #147 You should measure the change at a specific period. You should use a timer that checks the distance between the previous location (measured before the previous Tick event) and the new location (last one measured before the current Tick event).
You should measure the change at a specific period. You should use a timer that checks the distance between the previous location (measured before the previous Tick event) and the new location (last one measured before the current Tick event).
N nitinb4a Member Licensed User Longtime User Apr 24, 2013 #148 GPS GeolocationDemo & using WebViewExtras Hi Erel, I am running the GeolocationDemo and the sample b4a program "WebViewExtrasDemo" is giving below error while compiling the program. Parsing code. Error Error parsing program. Error description: Unknown type: webviewextras Are you missing a library reference? Occurred on line: 17 Dim MyWebViewExtras As WebViewExtras Pls. tell me which library reference need to be add to run this program. :sign0085:
GPS GeolocationDemo & using WebViewExtras Hi Erel, I am running the GeolocationDemo and the sample b4a program "WebViewExtrasDemo" is giving below error while compiling the program. Parsing code. Error Error parsing program. Error description: Unknown type: webviewextras Are you missing a library reference? Occurred on line: 17 Dim MyWebViewExtras As WebViewExtras Pls. tell me which library reference need to be add to run this program. :sign0085:
Erel B4X founder Staff member Licensed User Longtime User Apr 24, 2013 #149 See the first search result: Basic4android Search: WebViewExtras
N nitinb4a Member Licensed User Longtime User Apr 24, 2013 #150 Hi Erel, Thanks Now I have added WebViewExtras library reference. I am trying to run sample NinePatchExample and it is giving below error msg. Parsing code. Error Error parsing program. Error description: Unknown type: reflector Are you missing a library reference? Occurred on line: 470 Dim r As Reflector Pls. suggest the library reference for reflector :sign0085:
Hi Erel, Thanks Now I have added WebViewExtras library reference. I am trying to run sample NinePatchExample and it is giving below error msg. Parsing code. Error Error parsing program. Error description: Unknown type: reflector Are you missing a library reference? Occurred on line: 470 Dim r As Reflector Pls. suggest the library reference for reflector :sign0085:
Erel B4X founder Staff member Licensed User Longtime User Apr 24, 2013 #151 See the 2nd result here: Basic4android Search: Reflector
N nitinb4a Member Licensed User Longtime User Apr 29, 2013 #152 GPS tutorials and Gps sample program issue Hi Erel, I am trying to run a sample b4a program "gps.zip " in "GPS tutorial" but it is not showing any output Lat =? Log =? Speed =? Satellite=? I need to develop a android apps for my organization which will getGSMLocation or getGPSPosition of user cell phone and plot the Longitude & Latitudes on Map to track the visits of Sales executive like Google Vehicle tracker utilities. Kindly guide me to develop the same and suggest related sample programs and tutorials and B4a documentations Thanks :sign0085:
GPS tutorials and Gps sample program issue Hi Erel, I am trying to run a sample b4a program "gps.zip " in "GPS tutorial" but it is not showing any output Lat =? Log =? Speed =? Satellite=? I need to develop a android apps for my organization which will getGSMLocation or getGPSPosition of user cell phone and plot the Longitude & Latitudes on Map to track the visits of Sales executive like Google Vehicle tracker utilities. Kindly guide me to develop the same and suggest related sample programs and tutorials and B4a documentations Thanks :sign0085:
Erel B4X founder Staff member Licensed User Longtime User Apr 29, 2013 #153 Is the GPS enabled? Are you testing it outdoors? Seems like the GPS doesn't find any satellite.
N nitinb4a Member Licensed User Longtime User Apr 30, 2013 #154 GPS tutorials and Gps sample program issue Hi Erel, I am running the GPS program Indoor. The GPS is enabled. The satellite may not be found. When I searched various sample B4A programs for GPS. I found most of the sample codes in zip format with different dll files (Serial2.dll,GPS.dll) and visual basic modules for windows mobile i.e. "Gps4PPC" Since I am working for android mobile and purchased a license B4A software and I want to develop a apps to implement following tasks for our organization. [ I ] Location Tracker. a) Getposition () of user cell phone (Imei Number,longitude & latitude) b) SetPosition () of user cell phone (Imei number,longitude & latitude) c) FindDistance() or calculate the distance between two GPS locations. I need more information and sample B4A (GPS/WiFI/Trangulation) codes to get user/my android mobile cell phone location data like (Device ID, Longitude,Latitude) and I want to save it at one online central Ms Sql database server and pass them to google ("mapnik") map so that it will show the cell locations as a pin points on google map like Google Vehicle tracking system. Pls. advise me for the same.:sign0085: Best Regards Nitin
GPS tutorials and Gps sample program issue Hi Erel, I am running the GPS program Indoor. The GPS is enabled. The satellite may not be found. When I searched various sample B4A programs for GPS. I found most of the sample codes in zip format with different dll files (Serial2.dll,GPS.dll) and visual basic modules for windows mobile i.e. "Gps4PPC" Since I am working for android mobile and purchased a license B4A software and I want to develop a apps to implement following tasks for our organization. [ I ] Location Tracker. a) Getposition () of user cell phone (Imei Number,longitude & latitude) b) SetPosition () of user cell phone (Imei number,longitude & latitude) c) FindDistance() or calculate the distance between two GPS locations. I need more information and sample B4A (GPS/WiFI/Trangulation) codes to get user/my android mobile cell phone location data like (Device ID, Longitude,Latitude) and I want to save it at one online central Ms Sql database server and pass them to google ("mapnik") map so that it will show the cell locations as a pin points on google map like Google Vehicle tracking system. Pls. advise me for the same.:sign0085: Best Regards Nitin
Erel B4X founder Staff member Licensed User Longtime User Apr 30, 2013 #155 GPS doesn't work indoors as it cannot find the satellites. The dlls and Gps4ppc are not relevant as they are Windows Mobile programs.
GPS doesn't work indoors as it cannot find the satellites. The dlls and Gps4ppc are not relevant as they are Windows Mobile programs.
netsistemas Active Member Licensed User Longtime User Jul 5, 2013 #156 Error In Altitude The GPS return a bad altitude. This is not a error or bug. But, i see a application that return a real altitude, using some as 'with wifi detect'. Are there some thecnique to get the correct altitude? (or more correct). -------- El GPS devuelve una altitud erronea. Esto no es un error o fallo. Pero, He visto una aplicacion que devuelte la altura real, usando algo como 'detección por wifi'. ¿Hay alguna técnica para objet al altura correcta o al menos, mas correcta?
Error In Altitude The GPS return a bad altitude. This is not a error or bug. But, i see a application that return a real altitude, using some as 'with wifi detect'. Are there some thecnique to get the correct altitude? (or more correct). -------- El GPS devuelve una altitud erronea. Esto no es un error o fallo. Pero, He visto una aplicacion que devuelte la altura real, usando algo como 'detección por wifi'. ¿Hay alguna técnica para objet al altura correcta o al menos, mas correcta?
metheoneandonly Member Licensed User Longtime User Jul 25, 2013 #157 Hello everyone! I have tested this example on my HTC WildFire S, but it doesn't work as expected. The problem is in speed measurement, it shows me only the fraction of actual speed. For example, on 70 km/h, the app shows only about 15,5 km/h. For comparison, I'm using Navigon which shows correct speed. What went wrong? Thanks to anyone in advance!
Hello everyone! I have tested this example on my HTC WildFire S, but it doesn't work as expected. The problem is in speed measurement, it shows me only the fraction of actual speed. For example, on 70 km/h, the app shows only about 15,5 km/h. For comparison, I'm using Navigon which shows correct speed. What went wrong? Thanks to anyone in advance!
klaus Expert Licensed User Longtime User Jul 25, 2013 #158 The speed returned by the GPS is in m/s and not in km/h ! Best regards.
metheoneandonly Member Licensed User Longtime User Jul 25, 2013 #159 Thank you very much, Klaus! That explains this problem.
mitsusdev Member Licensed User Longtime User Sep 23, 2013 #160 i have notice that GPS_LocationChanged function is called each 0,5 second. is it correct ? i need done a speed media
i have notice that GPS_LocationChanged function is called each 0,5 second. is it correct ? i need done a speed media