Hi, I've created an Android application from Windows command line (not using Eclipse), how do I add a JAR file and make it part of my application? I've copied the JAR I created to the lib folder.
A:
In the project settings, under Java Build Path, go to the Libraries tab and add it here (Add external JAR is probably what you want).
EDIT: Incidentally, a similar question was asked recently - this is in case the steps above won't work for you. Here's the answer: http://stackoverflow.com/questions/3542092/converting-to-dalvik-format-failed-when-i-try-to-add-external-jars/3542211#3542211
EboMike
2010-08-22 16:16:33
Not using Eclipse.
Lennie
2010-08-22 17:03:09
Apologies, misread that. I thought you created the JAR using the command line. How are you building? Using ant? Do you have a build.xml?
EboMike
2010-08-22 17:04:26
I create the Android project from the command line and also build using ant.
Lennie
2010-08-22 17:19:25
A:
You need to use the dx utility described at:
http://developer.android.com/guide/developing/tools/othertools.html#dx
This blog post should give you something to work from:
http://www.winksaville.com/blog/uncategorized/android-use-dx-to-convert-a-jar-file-to-a-dex-file/
Sinjo
2010-08-22 17:56:54