What is libraries and how how we use that in Extension

What is libraries and how how we use that in Extension

2 Likes

Read the info about it here.
Did you also search the community? There are many examples.

https://community.appinventor.mit.edu/search?q=how%20to%20use%20libraries%20

You can use it the following way.

@UsesLibraries(libraries = "gson-2.1.jar")

You mention the files which will be used in the extension using the UsesLibraries annotation. You can mention multiple of them separated by a comma.

@UsesLibraries(libraries = "gson-2.1.jar, beanshell.jar")

Put your jar file in the appinventor/lib directory. It's the folder that has all the jar files that are used in app inventor.

If you are using AppInventor sources, you will need to add a line in the build.xml file where it is commented that "Add extension libraries here", example:

<copy toFile="${public.deps.dir}/beanshell.jar" file="${lib.dir}/beanshell.jar" />
1 Like

Sinply just tell me why we use this and where we create .jar file

1 Like

I guess it could have been written in a better way too
:upside_down_face:

We use them because they make our work easy + let us use things not present by default

Jar is created using maven

1 Like

What are the things in jar can anyone show me an jar

1 Like

I have told you and explained it. Why dont you search google?

1 Like

Jar is kinda like bundle of compiled java files, Compiled java files are called class files

Which language we use in jar Is Java

1 Like

Is this a question or answer ?
:upside_down_face:

I only ask Is we use java in jar

1 Like

I guess you didn't see this :point_down:

Can you show me an example how we write java in jar

1 Like

Oof, Its java code only, even extensions we make and compiled are in jar form, where classes are present

Ok now I understand jar is a java project that's can't show in extension but it will be added

1 Like

Also what is aar

1 Like

Aar is a file containing jar and xml files + assets (if any)

I had heard that we do not add aar in extension

1 Like

For now, yes but, after next release, we will be able to use them along with .so (native libraries)

When the next update release

1 Like

Soon is what I can say .........

1 Like