How to Add Path of a External Library [.jar] to Build.xml

As I’m new to extension development. I was searching for how to add external library and I found this

https://docs.google.com/document/d/1xk9dMfczvjbbwD-wMsr-ffqkTlE3ga0ocCE1KOb2wvw/pub#h.3kn0fmfydnq1

But It is so confusing for me, please can anyone help with any other documentation.

The “build.xml” files and “lib” folder are in the Sources.
You can’t access them from Kodular IDE.

That being said there are a ton if Libraries already in the sources.
From the IDE click TOOLS>View Libraries:

If the one you are looking for isn’t listed you’d need to ask someone to add it.

1 Like

@Ken thanks for your reply,
I’m not using Kodular IDE, I’m making extension from the app inventor sources,as we can’t use our own library in it.

1 Like

Find Build.xml

Check how other .jar are arranged and copy and replace the path to new library

2 Likes

So 4 things need to happen:

  1. Add .jar to lib folder.
  2. Add reference to .jar in build.xml(appinventor/build.xml & appinventor/buildserver/build.xml).
  3. Add @UsesLibraries(libraries = “simplifiedNameForJARFile.jar”) to your .java file.
  4. Add import simplifiedNameForJARFile.NameOfTheClassInJARFile; to your .java file.

Look at the instructions in the link you provided in the first post and look at the Twitter.java also:

Note: I am not the foremost authority on this particular aspect of Extensions so, if anyone sees anything wrong with these steps please feel free to let me know

3 Likes

@Ken Thank you so much :grinning:
Thats something I was searching for. You solved my problem. Thanks again.

3 Likes

Marked as solution, don’t forget to do it :smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.