Android Question Sub geolocation_location signature does not match expected signature

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Using Don Manfred's GeoLocator library, v1.1:
https://www.b4x.com/android/forum/threads/geolocation.99710/

Running the following code:

B4X:
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

Get this error at Sub GeoLocation_Location:

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,

Any idea how to fix this?
It worked fine in v1.01 and the Sub arguments are the same.


RBS
 

DonManfred

Expert
Licensed User
Longtime User
In my example this is the sub Signature
B4X:
Sub GeoLocation_Location(success As Boolean, Lattitude As Double, Longitude As Double, info As String, isMockLocation As Boolean)
    Log($"GeoLocation_Location(${success}, ${Lattitude}, ${Longitude}, ${info}, ${isMockLocation})"$)
End Sub
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
In my example this is the sub Signature
B4X:
Sub GeoLocation_Location(success As Boolean, Lattitude As Double, Longitude As Double, info As String, isMockLocation As Boolean)
    Log($"GeoLocation_Location(${success}, ${Lattitude}, ${Longitude}, ${info}, ${isMockLocation})"$)
End Sub

OK, thank, that works indeed.

RBS
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
i checked the code. The definition of the sub is not correct. V1.11 fixes this issue.

OK, thanks.
I suppose I could use it as well to do reverse geo-coding, so find the location of a given address.
It would take some time, but I am only dealing with a small area/small list of addresses (some 5000).

RBS
 
Upvote 0
Top