I was create a lib with eclipse but it didn't work!I had watch the tutorial video on the youtube.here is the javacode
here is the b4a code for call it:
and this is the error of compile:
the xml file:
I had import the necessary jar:
where is my wrong please?
B4X:
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
@ShortName("mylibc")
@Version(1.0F)
/**
*
* @author Icefairy
*
*/
public class mylibclass {
/**
*
* @param a 要操作的参数
* @return 返回乘以3后的结果
*/
public int mycall(int a) {
a=a*3;
return a;
}
}
B4X:
'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.
Dim a As mylibc
End Sub
Sub Activity_Create(FirstTime As Boolean)
Log(a.mycall(13))
Activity.Finish
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
B4X:
Compiling code. 0.00
Compiling layouts code. 0.02
Generating R file. 0.00
Compiling generated Java code. Error
javac 1.7.0
src\ice\apk\main.java:205: 错误: 找不到符号
public mylibclass _a = null;
^
符号: 类 mylibclass
位置: 类 main
1 个错误
B4X:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<doclet-version-NOT-library-version>1.02</doclet-version-NOT-library-version>
<class>
<name>mylibclass</name>
<shortname>mylibc</shortname>
<owner>process</owner>
<method>
<name>mycall</name>
<comment>
a: 要操作的参数
Return type: @return:返回乘以3后的结果</comment>
<returntype>int</returntype>
<parameter>
<name>a</name>
<type>int</type>
</parameter>
</method>
</class>
<version>1.0</version>
</root>
where is my wrong please?