Android Tutorial GPS tutorial

Status
Not open for further replies.

agraham

Expert
Licensed User
Longtime User
I assume the original readins are degrees:minutes so try this.
B4X:
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:

gregmartin64

Member
Licensed User
Longtime User

In the Sub GPS_LocationChanged (Location1 As Location) you can get it like this

B4X:
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
Thats sweet guys.

Thank you :sign0060:
 

jimmyjace

Member
Licensed User
Longtime User
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
 

LittleBritaly

Member
Licensed User
Longtime User
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
 

nitinb4a

Member
Licensed User
Longtime User
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:
 

nitinb4a

Member
Licensed User
Longtime User
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:
 

nitinb4a

Member
Licensed User
Longtime User
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:
 

nitinb4a

Member
Licensed User
Longtime User
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
 

netsistemas

Active Member
Licensed User
Longtime User
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
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!
 

mitsusdev

Member
Licensed User
Longtime User
i have notice that GPS_LocationChanged function is called each 0,5 second.

is it correct ?

i need done a speed media
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…