Making .xml files for .jar library files

aedwall

Active Member
Licensed User
Longtime User
The Swiss ephemeris has been ported to Java and the .jar file is available for it. Is there a tool/methodology for creating an associated .xml file for the .jar file I have? I want to be able to use this .jar library in Basic4android. Thank you.
 

aedwall

Active Member
Licensed User
Longtime User
I apparently can't just take an already-created .jar file (from someone else) and make a .xml file for it. When I try to "Generate Javacoc" it won't let me use "Next" or "Finish". Apparently it wants to see some Java files. Do I have to markup all the Java files that made up the .jar file with all the annotations mentioned in "http://www.b4x.com/forum/libraries-developers-questions/6810-creating-libraries-basic4android-4.html"? If so, then I think I am dead. I'm struggling with this. Thank you.

Also, I tried to upload 2 picture files, but it keeps overwriting the first with the second when I try to upload the second.
 

Attachments

  • ScreenShot_01-26-12 11.jpg
    ScreenShot_01-26-12 11.jpg
    16.7 KB · Views: 465
Last edited:
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
What do I do with the "<shortname>XXXX</shortname>" tags when I have lots of separate classes in lots of separate .class files? Where does the name of the overall library go in the .xml file?

<?xml version="1.0" encoding="UTF-8"?>
<root>
<doclet-version-NOT-library-version>1.02</doclet-version-NOT-library-version>
<class>
<name>v176.TransitCalculator</name>
<shortname>TransitCalculator</shortname>
<owner>process</owner>

etc.

<class>
<name>v176.TCPlanetPlanet</name>
<shortname>TCPlanetPlanet</shortname>
<owner>process</owner>

etc.

<name>v176.SwissEph</name>
<shortname>SwissEph</shortname>
<owner>process</owner>

etc.

When I try to compile it tells me "Unknown type: swe_lib". But SWE_Lib IS in the library list (and refreshed)?

Thank you.
 

Attachments

  • ScreenShot_01-26-12 15.jpg
    ScreenShot_01-26-12 15.jpg
    27.7 KB · Views: 347
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
I used this in my .java files and got compile errors in each one:

import anywheresoftware.b4a.BA.ShortName;

What is the significance of this line and what is a proper path?

Thank you.
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
I have working Java code. Is there any way to get this working Java code into b4a since I can't seem to get the libraries to work?

Thank you.
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
Does each public class need to be in its own library? Can I put lots of public classes, all in different .java and .class files, all together in one library?
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Yes you can.

The net library for example contains classes for FTP, POP3 and SMTP

Wim
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
So where can I learn how to do this? (added later: ok, I have downloaded net.zip and will look into it - thank you. But there is only the .jar file and the .xml file in net.zip - this doesn't tell me what to do with my .java files and their associated .class files. So I'm still stumped).


I am having problems making libraries from already existing and working Java code.

If I don't add the below to the .java files, then b4a does not recognize the library:

package v176;

/* import BA.ShortName; */

/* @ShortName("TransitCalculator") */


If I do add the above code, then Eclipse says I have an error and it won't make the .xml file properly.

So I'm stuck.
 
Last edited:
Upvote 0

elbelli2008

Member
Licensed User
Longtime User
I have downloaded a chart library from

Android Controls - Free Android Controls Library - IguanaUI Infragistics Android Controls

But only have a .jar file.,

Do You tell to me how I can create .XML file to use this library ??

thanks.

Nicolas
 
Upvote 0
Top