B4A Library Navigation Library

Discussion in 'Additional libraries, classes and official updates' started by derez, Mar 26, 2012.

  1. nitinb4a

    nitinb4a Member Licensed User

    Navigation tutorials and Gps sample program issue

    Hi Erel,

    I am referring the B4A sample programs from "GPS tutorials" and "Navigation Library" threads and running GPS.apk file outdoors on my mobile but it is not showing results for Lat & Lon. I have a Micromax Ninja A89 android 4.2.2 duel core phone and all Location services (Google's Location service, GPS Satellites,Location & Google search etc.) are enabled.

    I have installed same GPS.APK on my colleagues Samsung Galaxy Grand android phone & it is running fine and giving lat,lon,speed & satellites.

    Pls. suggest another way to getLocation(Lat,Lon) like GPS or WiFi/Triangulation and suggest sample B4A programs or documentations which will be helpful to me.

    Best Regards
    Nitin :sign0085:
  2. nitinb4a

    nitinb4a Member Licensed User

    LocationManager Library

    Hi Erel,
    I am running LocationManager Library example.zip
    It is not giving Latitude and longitude on android phone the code is as follows.
    Sub Globals
    Dim lm As LocationManager
    End Sub
    Sub Activity_Create(FirstTime As Boolean)
    Activity.AddMenuItem("Update location","mnuLocation")
    Activity.AddMenuItem("Stop Listening","mnuStopListening")
    End Sub
    Sub mnuLocation_Click
    End Sub
    Sub mnuStopListening_Click
    End Sub
    Sub Location_LocationChanged (Longitude As Double, Latitude As Double, Altitude As Double, Accuracy As Float, Bearing As Float, Provider As String, Speed As Float, Time As Long)
    Msgbox("Longitude: " & Longitude & CRLF & "Latitude: " & Latitude & CRLF & "Altitude: " & Altitude & CRLF & "Accuracy: " & Accuracy & CRLF & "Bearing: " & Bearing & CRLF & "Speed: " & Speed,"Location")
    End Sub
    Sub Location_ProviderDisabled (Provider As String)
    Msgbox("Provider","Provider Disabled")
    End Sub
    Sub Location_ProviderEnabled (Provider As String)
    Msgbox("Provider","Provider Enabled")
    End Sub
    Sub Location_StatusChanged (Provider As String, Status As Int)
    Msgbox("Provider: " & Provider & CRLF & "Status: " & Status,"Status Changed")
    End Sub
    Suggest the solution to get location details.
  3. Erel

    Erel Administrator Staff Member Licensed User

  4. nitinb4a

    nitinb4a Member Licensed User

    Location area code and name or address using CellID

    Hello Erel,

    Using below url for BGCellLocation v1.0 - Location using CellID


    I got the location area code now I want to find out the Location area name or address using same "location area code"

    kindly suggest a b4a sample project for finding same or explain step to implement

  5. Erel

    Erel Administrator Staff Member Licensed User

  6. nitinb4a

    nitinb4a Member Licensed User

    GeoCoder library Missing parameter error

    He Erel,

    I am trying to run B4A sample program for GeoCoder library url given below and copied the button click code given by "WARWOUND" and it is giving below error.

    Parsing code. 0.00
    Compiling code. Error
    Error compiling program.
    Error description: Missing parameter.
    Occurred on line: 69
    Results=Geocoder1.GetFromLocation(Latitude, Longitude, MaxResults)
    Word: )
    What value should I pass as TAG?

  7. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
  8. iancasey

    iancasey Member Licensed User

    Derez, nice library, I will use it. I did find that there is a small error in the LatLonToUTM function, the error is almost a constant 0.52m on the points I tested with on both the X + Y of the UTM with the values you provided in kineret.txt and some local values in utm15N
    The Distance values checked out fine :)

    I checked the UTM values with Blue Marble convertor and this website:

    Your result 737,831.64 3,631.415.30
    BM result 737,831.12 3,631,414.82
    web page 737,831.12 3,631,414.80
    I didn't test the area functions as I don't need them yet.

  9. derez

    derez Expert Licensed User

    I have found the algorithm somewhere in the internet (long ago, I don't remember where) and I'm not able to correct half a meter error. If you think it is a bias - correct it in your application.
  10. iancasey

    iancasey Member Licensed User

    Thanks David, I'll do that.
  11. deneus

    deneus Member Licensed User

    Hello very interesting library.
    I wonder if you have a practical example of a map that you can share?
    Thanks in advance.

    Hola muy interesante la librería.
    Me gustaría saber si tienes algún ejemplo practico sobre un mapa que puedas aportar?
    Gracias de antemano.
  12. derez

    derez Expert Licensed User

    The library is not specific to any map, except that it enables coordinates conversions and calculations.
    Practical map is something related to where you want to use it...
  13. daniedb

    daniedb Active Member Licensed User

    Hi Derez
    Using your Navigation Library, which have most of the calcs I'm looking for.
    This is my code, but it return the complete wrong distance/bearing, Any Ideas?
    ' Test Input  fields, will later been retrieved from External GPS connected via Bluetooth

    " 26.183402"

    sub CalcDistBearBtn_Click

    Dim l1 As Double :l1 = lattxt.Text
    Dim lo1 As Double :lo1 = lontxt.Text
    Dim l2 As Double :l2 = lat2txt.Text
    Dim lo2 As Double :lo1 = lon2txt.Text
    Dim retnd() As Double
       retnd  =nav.GeoDistanceBearing(l1,lo1,l2,lo2)
    Log("dist: "&retnd(0))
    Log("bearing: "&retnd(1))
    End Sub

    Last edited: Jun 11, 2015
  14. derez

    derez Expert Licensed User

    Dim l1 As Double :l1 = lattxt.Text
    Dim lo1 As Double :l1 = lontxt.Text
    Dim l2 As Double :l1 = lat2txt.Text
    Dim lo2 As Double :l1 = lon2txt.Text
    You have done copy-paste but forgot to change - only l1 value is set !!!!
  15. daniedb

    daniedb Active Member Licensed User

    SH*t, thats Very Late nights these last few days... sorry about that. STUPID/SIMPLE problem.
    Always nice that the Pro's show you out these dum stuff
    Thankyou Sir :)
  16. daniedb

    daniedb Active Member Licensed User

    Wow its working :) stupid me!!!!

    Is there a Way that I can use your library, and draw a polygon (4 locations), and for example divide that up into 300m strips east to west or north to south, for a Grid type of Display.

    Thank you
  17. derez

    derez Expert Licensed User

    I suggest to translate the 4 points to UTM and then work with it using the simple grid.
  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