Convert Java LCD library to B4A library

Philip Prins

Active Member
Licensed User
Longtime User
I am looking for someone to convert an existing library or inline code to use this library:

Full documentation here:
https://www.dropbox.com/sh/jpwg1gtyxigugng/AACZL-jQA3noh9z3-5NEkWLwa?dl=0

B4X:
Start
Obtain service SublcdManager sublcdManager=(SublcdManager)getSystemService("sublcd");
Register
registerEvent(Context context);

After successfully registered, the application can response to the broadcast event of the knob (channel switch) and buttons, also enable to draw contents (text/image) to the screen. Note: Make sure the carried parameter string in the broadcast of the knob which you are about to use equals to the package name of the current application.
Unregister when about to exit unregisterEvent(Context context);

After unregistered, the application has no permission to draw contents to the screen.
End
 

DonManfred

Expert
Licensed User
Longtime User
I don´t know if it is a good idea to add a broadcastreceiver to a lib. I did added one; should work i guess. But maybe it is better to create a broadcastreceiver directly in b4a and work with the data incoming at this BCR.

As i do not have such a device it is a bit difficult to write a lib for it if you are not able to test directly.

You need to find out

Please find 1st version to test attached
 

Attachments

  • LCDSDKEx.zip
    7.9 KB · Views: 304
  • LCDSDKV0.0.zip
    8.3 KB · Views: 280

Philip Prins

Active Member
Licensed User
Longtime User

I get an error;
B4X:
* Activity (main) Resume **
java.lang.Exception: Sub lcd_onreceive was not found.
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
    at anywheresoftware.b4a.BA$2.run(BA.java:365)
    at android.os.Handler.handleCallback(Handler.java:815)
    at android.os.Handler.dispatchMessage(Handler.java:104)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5643)
    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:960)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
**
 

DonManfred

Expert
Licensed User
Longtime User
oups. Rename the sub in the sample
B4X:
Sub LCD_onReceived(info As String)
    Log($"LCD_onReceived(${info})"$)
End Sub

to
B4X:
Sub LCD_onReceive(info As String)
    Log($"LCD_onReceive(${info})"$)
End Sub

I´ll change the wrong suggestion in the lib for the next release.
 

Philip Prins

Active Member
Licensed User
Longtime User
Works , great Job
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…