1

I added the EJML library to my android studio project, but i dont know how the import statement looks like.

I mean, what do i have to write to use these libraries?

enter image description here

my dependencies:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
compile files('libs/EJML-core-0.30.jar')
compile files('libs/EJML-core-0.30-sources.jar')
compile files('libs/EJML-dense64-0.30.jar')
compile files('libs/EJML-dense64-0.30-sources.jar')
compile files('libs/EJML-denseC64-0.30.jar')
compile files('libs/EJML-denseC64-0.30-sources.jar')
compile files('libs/EJML-equation-0.30.jar')
compile files('libs/EJML-equation-0.30-sources.jar')
compile files('libs/EJML-simple-0.30.jar')
compile files('libs/EJML-simple-0.30-sources.jar')
compile files('libs/EJML-core-0.30-sources.jar')

}

M.Mac
  • 699
  • 3
  • 14

1 Answers1

2

In your app level build.gradle file, you'll have a dependencies section.

see How to add local .jar file dependency to build.gradle file? for more information.

So in your case you would have:

dependencies {
    ... library files that are already there
    compile files('libs/EJML-core-0.30.jar')
    compile files('libs/EJML-core-0.30-sources.jar')
    ... the libraries in your libs folder will follow the same pattern
}

Edit: added from comments.

but i dont know how the import statement looks like: import ....

if you just use a class from the JAR files, so for example if I add a dependency for a RecyclerView (example: compile 'com.android.support:recyclerview-v7:25.0.1') I would then call RecyclerView recyclerView = new RecyclerView() etc and it'll ask you to import it there. I don't know what classes are required for the JARs you have compiled.

Community
  • 1
  • 1
Bradley Wilson
  • 1,197
  • 1
  • 13
  • 26
  • thanks, but i dont know how the import statement looks like: import .... – M.Mac Dec 22 '16 at 16:47
  • 2
    if you just use a class from the JAR files, so for example if I add a dependency for a RecyclerView (example: compile 'com.android.support:recyclerview-v7:25.0.1') I would then call RecyclerView recyclerView = new RecyclerView() etc and it'll ask you to import it there. I don't know what classes are required for the JARs you have compiled. – Bradley Wilson Dec 22 '16 at 16:48