tags:

views:

58

answers:

2

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
Not using Eclipse.
Lennie
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
I create the Android project from the command line and also build using ant.
Lennie
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