Java Question Seeking Assistance with Simple Compiler in B4A: Can Anyone Guide Me?

carlos7000

Well-Known Member
Licensed User
Longtime User
I tried using the Simple Compiler to create a library. When attempting to compile ed25519-java-0.3.0, I encountered the error:

Capture.PNG


I also tried compiling chilkat-9.5.0-android, but it gave the error:

Capture.PNG


I’m not sure if Simple Compiler is still a valid tool for library compilation.

The source code of ed25519-java-0.3.0 can be found in https://github.com/str4d/ed25519-java/releases/tag/v0.3.0
The source code of chilkat-9.5.0-android can be found in https://www.chilkatsoft.com/chilkatAndroid.asp
 

Attachments

  • Capture.PNG
    Capture.PNG
    123.2 KB · Views: 82

Mariano Ismael Castro

Active Member
Licensed User
Do not use Java 14 for compilation

I also recommend you ask this question in the corresponding forum.

I suggest you try to compile the source code that is included inside the SLC zip
 

carlos7000

Well-Known Member
Licensed User
Longtime User
According to Erel
You should use Java 8 with SLC (at least when generating the XML).

Hi Mariano.

Attempt to compile: ed25519-java-0.3.0

Capture.PNG


Attempt to compile chilkat-9.5.0-android

Capture4.PNG



Completed Successfully!

But when trying to use the library in B4A:

Capture2.PNG
 

carlos7000

Well-Known Member
Licensed User
Longtime User
I asked Copilot about the error: package sun.security.x509 does not exist import sun.security.x509.x509Key

Copilot responded:

Capture.PNG


Try compiling ED25519-java-0.3.0 and the new error is

Capture.PNG


Try -source 1.6 -target 1.7

Capture.PNG


I tried modifying the pom.xml as suggested by Copilot

Capture.PNG


Nothing works yet.
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
See here. Read the thread.


His wrapper package name clashed with the package name of the chilkat java project
 

carlos7000

Well-Known Member
Licensed User
Longtime User
See here. Read the thread.


His wrapper package name clashed with the package name of the chilkat java project
I'm going to read it. I'm going to see if I can do something
 

Johan Schoeman

Expert
Licensed User
Longtime User
I made a file similar to the one in the FlurryAgentWrapper example and copied it to libs but it didn't work
What is the package name of your wrapper? Have you tried to compile is when you enter
com.
to the -b4aignore field of SLC?
 

carlos7000

Well-Known Member
Licensed User
Longtime User
What is the package name of your wrapper? Have you tried to compile is when you enter
com.
to the -b4aignore field of SLC?
This is the wrapper I wrote. My knowledge of Java is very little:

B4X:
package mi.ed25519;

import com.chilkatsoft.CkEd25519;

public class Ed25519Wrapper {
    private CkEd25519 ed25519;

    public Ed25519Wrapper() {
        ed25519 = new CkEd25519();
    }

    public String sign(String privateKey, String message) {
        return ed25519.signStringENC(privateKey, message);
    }
}

Capture.PNG


Place the file in Libs as it says in https://www.b4x.com/android/forum/t...mpiler-build-libraries-without-eclipse.29918/
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
1719724763040.png




B4X:
package chilkatwapper;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.view.ViewGroup;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.Hide;
import anywheresoftware.b4a.BA.Pixel;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.keywords.Common.DesignerCustomView;
import anywheresoftware.b4a.objects.LabelWrapper;
import anywheresoftware.b4a.objects.PanelWrapper;
import anywheresoftware.b4a.objects.ViewWrapper;
import anywheresoftware.b4a.BA.ActivityObject;

import anywheresoftware.b4a.BA.Events;

import android.os.Bundle;


import com.chilkatsoft.*;

//@ActivityObject
//@Events(values={"picture_changed(position As Int), scroll_stopped(), picture_touched(position As Int), picture_long_touched(position As Int)"})
//@Author("Github: Antonio081014, Wrapped by: Johan Schoeman")
@Version(1.00f)
@ShortName("Chilkat01")
//@DependsOn(values={"android-support-v4"})
public class chilkatWrapper  {


    private BA ba;
    private String eventName;
    private CkCrypt2 crypt;
    
    

    public void Initialize(BA ba, String EventName) {
        this.eventName = EventName.toLowerCase(BA.cul);
        this.ba = ba;
        crypt = new CkCrypt2();
    }


/*     public String sign(String privateKey, String message) {
        return ed25519.signStringENC(privateKey, message);
    }    private CkEd25519 ed25519;



    public String sign(String privateKey, String message) {
        return ed25519.signStringENC(privateKey, message);
    }         */
        


  
}
 

Johan Schoeman

Expert
Licensed User
Longtime User
See the folder structure in the attached. I have removed the .so files from their folder else too big to upload. Put the .so files back in their folders before trying to compile with SLC

I see no class in the java project with a name of CkEd25519.......?

import com.chilkatsoft.CkEd25519;

Where did you get this class from?
 

Attachments

  • structure.zip
    304.5 KB · Views: 70
Top