Reputation: 5246
I'm working on an Android project and i need to import an XML library called XOM. The only way i found was to right click on the project name -> Properties -> Libraries tab -> click on "Add external Jar". But that only references it from it's original path, what happens when i compile the app and move it to my phone? Will the Jar be in there?
Might be a stupid question, sorry if that's the case.
Upvotes: 1
Views: 639
Reputation: 4811
Create a directory called "libs" in your under your root directory. You can do it by,
That's it
Upvotes: 0
Reputation: 7635
.apk
is nothing but a collection or zipped version of a file. it contains all the resources and compiled java files.
So you need not have to worry about the inclusion of your library files. if you have set proper path to your libraries in eclipse then these will be included in your apk file.
Upvotes: 0
Reputation: 7011
It's fine to do that but what I normally do is create a folder called lib
and then add Jars from there. I find that makes it easier to see what Jars I have in my application.
The main disadvantage of your original approach is that what if the path to that library externally accidentally changes? then your program will not compile. It's better to have everything in the one place to make things easier.
Upvotes: 2