Android Question Third Party jar file issue

davidt

Member
Licensed User
Longtime User
I am attempting to access a method in a third party Jar file and am obviously missing something key with regards to the passing of parameters when using RunMethod to call the getSpeed method. (I have very little java experience).

I have read the Tutorial regarding using #Additional Jar and JavaObject, but am getting a Runtime Exception: Method: getSpeed not matched.

I have attached a small test project (GarminAPI-Test.zip) along with the Third Party Jar file and the JavaDoc for the Speed class (Speed.zip).

Any help would be most appreciated.
 

Attachments

  • GarminAPI-Test.zip
    7.8 KB · Views: 130
  • Speed.zip
    69.5 KB · Views: 124

davidt

Member
Licensed User
Longtime User
Thanks Erel for you reply. I do really appreciate your time.

I have found another class called Breadcrumb that contains the location, heading, speed and timeStamp data fields. The description is as follows:

The Breadcrumb class encapsulates the GPS position data associated with a point in a track log. The data in a breadcrumb object includes: latitude, longitude, speed and heading. Breadcrumbs are constant, the value of their data fields cannot be changed after they have been created. As such, the Breadcrumb class contains only getter functions and not setters.

Based on your comments, would it make sense that I would need to use InitializeNewInstance against the Breadcrumb class and then retrieve the speed from it as I have done below?

The code below compiles and does not issue any runtime errors however I'll need to test it on an actual Garmin device now (instead of my phone) to see what getSpeed returns as it is currently returning zero.

B4X:
jo.InitializeNewInstance("com.garmin.android.fleet.api.Breadcrumb", Null)
Speed2 = jo.RunMethod("getSpeed", Null)

Thanks again for your help :)
 

Attachments

  • Breadcrumb.zip
    4.1 KB · Views: 114
Upvote 0
Top