Android Question estimote beacon sdk Runtime error class not found

billy047

Member
Licensed User
Longtime User
Hello, I hope you can help me, I need to develop a project with beacons, and therefore use the SDK Estimote company.
Background:
I Download from Estimote an .aar file with the SDK, Which I change the extension to .zip and unzipped, Obtaining, .jar and .xml. I named them "estimotesdk". place it in my directory of external libraries and I check it in library tab.

the first thing is to see how to access the library classes
try to access the class beacon
Compiles fine without errors, but when running, in jo.InitializeStatic fails
It is my code to test that access to the library:
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
    #AdditionalJar: estimotesdk
#End Region
#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region
Sub Process_Globals

End Sub
Sub Globals

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")
     Dim jo As JavaObject
     jo.InitializeStatic("beacon")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

This is the error:

Error occurred on line: 32 (Main)
java.lang.ClassNotFoundException: java$lang$beacon~e: at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:287)
at anywheresoftware.b4j.object.JavaObject.InitializeStatic(JavaObject.java:73)
at b4a.example.main._activity_create(main.java:355)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:305)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at b4a.example.main.afterFirstLayout(main.java:100)
at b4a.example.main.access$100(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:78)
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:5257)
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:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
** Activity (main) Resume **

Thanks in advance
 

billy047

Member
Licensed User
Longtime User
Erel many thanks for your help, i qualify the whole name, but still does not find the class. In the code attached, I show attempts that I already made.
Attached in the ZIP, the code, the SDK files (only estimotesdk.xml I put in my external library, not send the estimotesdk.jar because it measures 930KB), and an image where the estimote.jar file shows their classes.
the truth, I do not know I'm omitting.

Thanks in advance for your support.
 

Attachments

  • EstimotewithXML.zip
    48.6 KB · Views: 341
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
billy047

Are you also planning to create samples for the Eddystone features of this library? Eddystone is Google's iBeacon format which relates to the physical web.
 
Upvote 0

billy047

Member
Licensed User
Longtime User
Erel Thank you very much for your help, I do a quick test using InitializeNewInstance.
Dim result1 As Object = jo.InitializeNewInstance ("com.estimote.sdk.EstimoteSDK", Null)
and return in result1 this com.estimote.sdk.EstimoteSDK@3f00577c
which indicates that the communication with the SDK already established.

Now I need to understand how to pass parameters to the constructor and other functions.

Bluedude yes i want and need use all resources and functions included in estimote.sdk like Eddystone.

As I do not know Java, it will be somewhat difficult at first, understand how to handle different types of data, Between B4A and estimote functions to pass as arguments as to receive data back.

It may be, that i need more help from you

Thanks again
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Don't count on me, the Java stuff with additionaljar is really hard. The translation from Java methods to B4A methods is a pain for me. Events are even more complicated and events you need because of the discovery of beacons etc.

A general purpose beacon library which supports all formats (iBeacon and Eddystone) would be great to make the physical web happen.

But even more interesting is the Nearby stuff Google releases in the new API's.

However, implementation of new Android features or external SDK's is a common problem in B4A. Also hard to find people who want to do it or have time.

Till that time, good luck and eagerly awaiting Eddystone support!
 
Upvote 0

pierrem

Member
Licensed User
Longtime User
Billy047,

Have you solved your problems and be able to create a wrapper for your estimote beacons ?
Please share your experience

Thks
 
Upvote 0
Top