I am trying to create, import and use a jar file in this project. I found multiple topics that explain the steps needed to import the file but none of them worked for me. I created a very simpe library and exported it as a jar file:
public class Simple {
public static int add(int a, int b){
return a+b;
}
}
In Android Studio I created a libs
folder and added the .jar
file, right click, add as library and then tried to use Simple.add(1, 2);
without success, the class is not recognized.
In the extensions folder I tried to created a new module and then import my .jar
file in there. After the import Simple.add was also unrecognized in the project.
How should I optimally add a library in such a project?