Java Question Writing a Library From Scratch

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.

If I have to write Java Code, (Which I dont know) Does anyone have any jar file and its associated java library code which make the wrapper, that I can study to make my own library wrapper.

I am basically a VB6 programmer and donot know any java. But If I have some examples of how classes and methods may be written in java for a given function/method in a jar file I could probably use that as a template and create the rest. I know the syntax of the jar functions/method etc as the jar file and all its associated code is available as open source.

Can anyone help with some example of a class written in java in eclipse that refers a function/method in some commonly available jar file, so that I could study it.

Please do help.

Thanks
:sign0163::BangHead:
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here is the code of the analytics library. It is a simple wrapper:
 

ashchopra

Member
Licensed User
Longtime User
Great !!

Thanks a ton Erel. This should get me going. While I only know VB6 and not Java, I can read the code and do some copycat work to make the wrapper for the JExcelApi Open Source Library. When that is done I'll post it on the forum for all to use.

Regards, and thanks again
 

wl

Well-Known Member
Licensed User
Longtime User
Net library

Hello Erel,

Would it be possible to get the source code of the NET library as well ?

I would like to add the TOP command for POP3 and it seems that you are using an Apache library (did some decompiling which does include the TOP, you only did not wrap it.

I could start a new library from scratch but adding a TOP method would be easier and better I suppose ?

Wim
 

wl

Well-Known Member
Licensed User
Longtime User
Erel,

Ok not problem. But would it be able to get the source anyway so I can look at it and learn from it ? I guess I might still be missing some info from the Java decompiler)

I would like my Android device check my POP3 account every few minutes, to keep battery usage as low as possible:

- I would need the number of messages and total mail size (the output of the STAT command): when these values are the same as the ones of the previous check I can close the connection: nothing more to do.

- the TOP command: I'm only interested in the headers not the content itself (TOP 0)

Thanks,

Wim
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here:
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…