Java Question Wrapping third party libraries

Shaun

Member
Licensed User
Longtime User
Hello,

I am writing an app using GPS for use on my boat, and I need accurate elevation information, which I can get from the google elevation service api.

I have the needed Jar file, but that's all. What are the steps to wrap this and expose the public members and classes for use within b4a?

The library I am interested in is called geotoolsapi, it is the Google elevation and geocoding api for their elevation and geocoding webservice.

GettingStarted - geotoolsapi - Getting started with the library. - Java interface to Google GeoCode and Elevation web services - Google Project Hosting

Do I need to get/alter the source code, or is there a way to wrap the jar file and expose the public members without directly accessing the underlying source code?

Im not sure where to start.

I have java and eclipse experience.

Thanks in advance.
 

Shaun

Member
Licensed User
Longtime User
OK I went through a tutorial and created the jar and xml, I check my library in the "libs" tab, and it loads. So far so good.

When I dim a reference to my library in process globals, my library does not appear in the intellisense drop down list. I can't dim a variable as my library type. What would cause this?

*on edit I got it to show in intellisense. Now I need to figure out how to make the underlying public methods show up/
 
Last edited:

Shaun

Member
Licensed User
Longtime User
OK I think I know where to go with this. I need to write a simple java wrapper and expose all the methods, etc. I will be back if I hit any walls.
 

ericvanderhoeven

Member
Licensed User
Longtime User
Which tutorial?


Hi Shaun,

may I pick your brain for a sec. I have a similar situation where I need to be able to talk to 2 non-standard API modules in my tablet (an FM chip and a transceiver chip). The code developer is willing to corporate with me (he does hardcore terminal typing in Ubunto/Eclipse) but we both have no idea how to process his codes to a B4A library so I can use his commands. I tried the tutorial where you need to play around with JAVADOC in Eclipse (I have both WIN as well as Linux OS and both versions of Eclipse) but I get stranded....

So any help in porting his JAR code created on Linux to a B4A external lib would be highly appreciated!!

Thanks,

Eric van der Hoeven
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…