B4A Library Verso - Offline Reverse Geo

This is a wrap for this github-project

minSdkVersion 15
Verso is a offline reverse geocode library based in OfflineReverseGeocode and optimized to be used on Android.
Verso is capable to return the "city name", "country name" and the "country code" from a latitude and longitude provided.
Verso is a singleton and use a internal data text file where all the geo info is located.


Verso
Author:
DonManfred (wrapper)
Version: 1
  • GeoInfo
    Methods:
    • Initialize (EventName As String, geoinfo As String)
    • IsInitialized As Boolean
    • isMajorPlace As Boolean
    Properties:
    • CityName As String [read only]
    • CountryCode As String [read only]
    • CountryName As String [read only]
    • Latitude As Double [read only]
    • Longitude As Double [read only]
  • Verso
    Events:
    • geoinfo (geo As Object)
    Methods:
    • Initialize (EventName As String)
    • IsInitialized As Boolean
    • getGeoInfo (latitude As Double, longitude As Double)

Setup:
- Download VersoVx.y.zip and extract the content to your additional libs folder
- Download the file offlineData.zip from HERE. Copy the file AS IS into your projects files folder. Do not extract...
 

Attachments

  • VersoEx.zip
    6.7 KB · Views: 468
  • VersoV1.0.zip
    11.3 KB · Views: 466

awakenblueheart

Member
Licensed User
Longtime User
Hi, I tried the example but got this error below. I put the offlineData.zip in "Files" folder.

B4X:
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Verso_geoinfo()
main_verso_geoinfo (java line: 382)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String de.donmanfred.GeoInfoWrapper.getCityName()' on a null object reference
    at b4a.example.main._verso_geoinfo(main.java:382)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
    at anywheresoftware.b4a.BA$2.run(BA.java:328)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5383)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:939)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:734)
 

DonManfred

Expert
Licensed User
Longtime User
try it with this code please
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    verso.Initialize("Verso")
    verso.getGeoInfo(50.8293765,6.4325835)
End Sub
Sub Verso_geoinfo(geo As GeoInfo)
    Log($"Verso_geoinfo(${geo})"$)
    If geo <> Null Then
        Log(geo.CityName)
        Log(geo.CountryCode)
        Log(geo.CountryName)
        Log(geo.isMajorPlace)
    End If
End Sub
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hello DonManfred nice work

Is possible do a reverse too?

I want a create a list of cities with a gps positions, and i think it's possible do a reverse with this library ... is posible?

Thanks for you work!
 
Top