Java Question Referencing an External Library

ashchopra

Member
Licensed User
Longtime User
Hi,
I need to access the the JExcelApi, which is an open source java api to access excel files. There is a jar file jxl.jar available. How can I use the members of this library in basic4android. Will I have to use eclipse to create a class for each and every class in this jar file. Is there no way that the classes/methods/events in the jar file can be used directly within basic4android.

For example the Object as seen in eclipse shows a Sheet>WritableSheet>getrow(int) property. How can I declare the jxl.jar file in basic for android and write something like MyCellRow = Sheet1.WritableSheet.getrow(2)

Please do help.:BangHead:
 

ashchopra

Member
Licensed User
Longtime User
Unable to Use

For some reason I cant seem to use any of that library. I keep getting a NullFunction error or some sort. Its not just that I need to access that particular java library, but the question is more generic on how a java jar file can be used without having to write a class for each and every member of the jar file.

thanks:sign0163:
 

ashchopra

Member
Licensed User
Longtime User
Hi,
This is exactly what I need to do too.
I have an Jar File (Also all the source code, as it is open source). I need to use its functions within B4Abdroid.

Now after seeing the video and reading the tutorials I understand the following:-

1. Start new eclipse project.
2. Add reference to Core.jar, B4Shared.jar, Android.jar and the jar file that I need to use.
3. Now write code to refer each and every function, method, event etc of that jar file.
4. Use javadoc to create the .xml file for the jar file.
5. Put both these files in the library folder of B4Android.
6. Add reference to these two files in the B4Android project.

However, is there no simpler was to bypass writing all the code of step 3 above and refer the function/ methods/ events in the jar file directly. As long I have documentation indicating their syntax.(This is available as the jar source code is available)

Do help !! :BangHead:
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…