Compiling code. 0.00
Generating R file. 0.00
Compiling generated Java code. Error
javac 1.6.0_20
src\fg\test1\main.java:170: cannot find symbol
symbol : class test
location: class fg.test1.main
test _testlib = null;
^
1 error
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim testlib As test
Log("testlib.Width=" & testlib.Width)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Java-Code:
B4X:
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
@ShortName("test")
@Version(1.0f)
@Author("Filippo")
/**
* My Comment.
*/
public class test {
int var1;
public test(){
var1=0;
}
public int getWidth() {
return var1;
}
public void setWidth(int value) {
var1=value;
}
}
It can't find your test class. You have put test.jar with test.xml in your additional libraries folder and selected your library in the Libraries tab? Does the IDE Intellisense know about it?
You have put test.jar with test.xml in your additional libraries folder and selected your library in the Libraries tab? Does the IDE Intellisense know about it?
I don't think your Eclipse project is set up right. test.java is not in a package but is a file immediately under src.
I created a new Eclipse project, put your source into it and it compiles and runs fine. Right click on the src folder in Eclipse -> New -> Class. Enter a package name, I used "anywheresoftware.b4a.filippo.test", and the class name "Test". Copy the code in and it should then work OK.