Android Question GeoLocator get address of other than current location?

Discussion in 'Android Questions' started by RB Smissaert, May 6, 2019.

Tags:
  1. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

  2. DonManfred

    DonManfred Expert Licensed User

    Try V1.1 and use geoAddress2(lat,lon) to get the Address. Use the Getters to get Street and so on after this call.
     
  3. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Where do I find V1.1?
    I downloaded V1.01.

    RBS
     
  4. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    OK, found this now, thanks.

    RBS
     
  5. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    This works now nearly, apart from this error, occurring at Sub GeoLocation_Location:

    Error occurred on line: 62 (Main)
    java.lang.Exception: Sub geolocation_location signature does not match expected signature.
    public static anywheresoftware.b4a.pc.RemoteObject b4a.example.main_subs_0._geolocation_location(anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject,anywheresoftware.b4a.pc.RemoteObject) throws java.lang.Exception
    class anywheresoftware.b4a.pc.RemoteObject, class anywheresoftware.b4a.pc.RemoteObject, class anywheresoftware.b4a.pc.RemoteObject, class anywheresoftware.b4a.pc.RemoteObject, class java.lang.Boolean,

    Code:
    Sub RunLog(strText As String)
     
     
    If strText = Null Then
      strText = 
    "---"
     
    End If
     
     
    Try
      
    Log(strText)
     
    Catch
      
    Log("---")
     
    End Try
     
    End Sub

    Sub Activity_Create(FirstTime As Boolean)

     
    'Do not forget to load the layout file created with the visual designer. For example:
     'Activity.LoadLayout("Layout1")
     
     Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
     
    wait for Activity_PermissionResult (Permission As String, Result As Boolean)
     
    If Result Then
      GeoLoc.Initialize(
    "GeoLocation")
      
    'GeoLoc.GetLocation
      GeoLoc.geoAddress2(52.6122922, -2.1646073)
      RunLog(GeoLoc.Address)
      RunLog(GeoLoc.City)
      RunLog(GeoLoc.Country)
      RunLog(GeoLoc.KnownName)
      RunLog(GeoLoc.PostalCode)
      RunLog(GeoLoc.State)
     
    Else
      RunLog(
    "NoPermission")
     
    End If
     
    End Sub

    Sub GeoLocation_Location(success As Boolean, Lattitude As Double, Longitude As Double, info As String)
     
    Log($"GeoLocation_Location(${success}, ${Lattitude}, ${Longitude}, ${info})"$)
    End Sub

    RBS
     
  6. DonManfred

    DonManfred Expert Licensed User

    You should create a new thread for any new problem/issue/question.
     
  7. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    OK, posted now.

    RBS
     
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