Java Question DynamSoft Wrapper - Question

Hello Everyone,

Im working to wrapper the barcode lib from DynamSoft

I´m basing in @Johan Schoeman wrappers trying to copy the structures and using notepad++ and SLC

I couldn´t upload here the libs due to file size limits, but the download can made in the link : Dynamsoft Doc & Libs and API Reference

I´m newbie in java and It seems part of the code is not accept because has lamda expressions:

1663165714293.png


I need some help to convert this lamdba expression to regular java, example:

lambda code:
            public void DBRLicenseVerificationCallback(boolean isSuccessful, Exception e) {
                requireActivity().runOnUiThread(() -> {
                    if (!isSuccessful) {
                        e.printStackTrace();
                        showErrorDialog(e.getMessage());
                    }
                });
            }

thanks
 

Attachments

  • DynamSoft_lib.zip
    35.9 KB · Views: 126
Last edited:
Hello Everyone,

Im working to wrapper the barcode lib from DynamSoft

I´m basing in @Johan Schoeman wrappers trying to copy the structures and using notepad++ and SLC

I couldn´t upload here the libs due to file size limits, but the download can made in the link : Dynamsoft Doc & Libs and API Reference

I´m newbie in java and It seems part of the code is not accept because has lamda expressions:

View attachment 133616

I need some help to convert this lamdba expression to regular java, example:

lambda code:
            public void DBRLicenseVerificationCallback(boolean isSuccessful, Exception e) {
                requireActivity().runOnUiThread(() -> {
                    if (!isSuccessful) {
                        e.printStackTrace();
                        showErrorDialog(e.getMessage());
                    }
                });
            }

thanks


Hello Everybody,

I was able to solve this problem with the code bellow (I´m not sure if it is correct)

B4X:
 public void DBRLicenseVerificationCallback(boolean isSuccessful, Exception e) {
                runOnUiThread(new Runnable() {

                    @Override
                    public void requireActivity() {
                        if (!isSuccessful) {
                            e.printStackTrace();
                            showErrorDialog(e.getMessage());
                        }
                    }
                   
                });

Now I saw that I have a lot of another lambda expressions, is there a way to convert the code automatically? or is there a way to run with source 8 in the SLC? ideas?
 
Top