LT
Leaning TechnologiesКрутой кАшАчОк

Int Conversion

There is a function in Java, that calls a native function with string argument, like setContentView("Hello World!"); and it works perfectly. Now repeat the same thing with integer: Java code: setContentView(2130903040); Native code:
"natives": {
Java_path_to_setContentView(lib, id) {
console.log(id);
}
}
"natives": {
Java_path_to_setContentView(lib, id) {
console.log(id);
}
}
And instead of number, id is some strange object (see screenshot).
No description
apignotti
apignotti76d ago
What is the full signature of the native function? Also, please clarify which version of CheerpJ you are using. Is still the stable 3.0?
Крутой кАшАчОк
Крутой кАшАчОк76d ago
Hello! Thanks for your answer, Using <script src="https://cjrtnc.leaningtech.com/3.0/cj3loader.js"></script> I don't really know what is a "signature" of the function, did you mean this? public static native void setContentView(int id); Sorry, found the error!
apignotti
apignotti76d ago
static
Крутой кАшАчОк
Крутой кАшАчОк76d ago
Yeah, that's the problem Static was not required here
Крутой кАшАчОк
Крутой кАшАчОк76d ago
After removing it, got right int :)
No description
apignotti
apignotti76d ago
You can use static too, but you need to be consistent. Without static there is an extra this argument first I think that the actual problem is that your .class or .jar file was not updated after changing the .java file. So he method was not actually static and you were observing the this object
Крутой кАшАчОк
Крутой кАшАчОк76d ago
Yeah, right, .jar is compiled with different library Than the actual library that is used I'm just, Running .apk files Extracting .jar from apk's classes.dex That is already compiled by android studio
Want results from more Discord servers?
Add your server
More Posts
State of the C++ modules supportWhen the new C++ modules are expected to be supported?Cheerpj hangs after "Jar is loaded,main is starting"I am trying to use cheerpj to run my Java Swing app in a browser. I can run the example SwingSet3.jaStretch to Fit Height IssueRunning a basic application in the example html provided on the CheerpJ website. My html code is efProblems with CheerpjHello, I am trying to get my Java app running in CheerPJ - I was successful in creating a simple "HeCache Results for Faster Startup?Hello new user here. Performing initial research into potential commercial application usage. 1) AmUnknownHostException happened when the Java application connect to serverUnknownHostException happened when the Java application connect to server. The host name is the sameHTTP server returned compressed partial data. That should not happen. CheerpJ cannot run.Browser shows error "HTTP server returned compressed partial data. That should not happen. CheerpJ cAccesing the standard out and standard error stream from the Java processHow do I from javascript access the output streams from the started Java process?Any plan on adding internet access without Tailscale?Hi there ! Do you plan on adding internet access without the need to install Tailscale etc, that wour[((0 + c) | 0)] is not a function when instantiating objectHello, thank you all for developing CheerpJ, it is an impressive tool! I am playing around with tryiI'm always looking for the URL of the latest build of cj3loader.js by searching articlesI'm always looking for the URL of the latest build of cj3loader.js by searching articles, but is theDifferent behavior between extension and cj3loaderWe have a java applet that runs perfectly when using the CheerpJ browser extension, but fails to fulCan I try CheerpX?I know it's not fully ready yet, but I think it's fine for my use cases in its current staterunning java decompiler in browser, weird error(copy-pasting from #cheerpj3 since i noticed this channel existed) i'm trying to run the procyon javAccessibility of Java applicationsHi team, I noticed that apps running on CheerpJ are not accessible to people with disabilities. Thisjnlp launch verification fails with 64 bit swt librariesThe launch has below error. Java.lang.unsatisfiesLinkError: cannot load 64-bit SWT libraries on 32-bhow to debug why the jar main class is not loadingI am trying to convert old jnlp client to html format. I followed the documentation and used cheerpjTrying to get CheerpJ to actually launch a programI'm trying to get CheerpJ to run UPRandomizer in a browser, but I can't figure out how to get it to Compiling .FMX with CheerpJHow do you convert .FMX with CheerpJ compiler?Any idea on how to use wildcards for jar files with many separate jar dependencies?I've been working on some projects and one of them involves a lot of dependencies in the form of jar