Things to check before using Libraries in extensions | Extesion Developement

Hello dear friends…
I want to ask that what are the things that we need to check before using any external library inside our extension? I mean the THINGS that we need to check to make sure that this library can be used in our extension and will work after building it. Thanks in advance…

Maybe this can help :

Read this

For the extension template you need to add the library in lib/deps folder.
For the app Inventor Sources add the library in the lib/JarFolder folder ( create the JarFolder folder of it isn't created )
For the app Inventor Sources you will need to edit the appinventor/components/build.xml file and add this line:

<copy toFile="${public.deps.dir}/JarName.jar" file="${lib.dir}/JarFolder/JarName.jar" />

In both cases you will need to add the UsesLibraries annotation:

@UsesLibraries(libraries = "JarName.jar")

Before the extension class definition:

public Class extends AndroidNonVisibleComponent {

Adding it before or after the @SinpleObject annotation or the @DesignerComponent annotation shouldn't matter.


Thanks to @MohamedTamer for the explanation :kissing_heart:

1 Like

I know how to implement libraries but how to check if certain library can be used or not.

after compile you can get the results right?

After compilation you get the results but thats not simple. You can't check every single library by using it in extension. There must be some basic things that we could use to identify that this library would be supported by appinventor or not. Compiling every library is difficult