Anand K
Anand K

Reputation: 233

How to import an external JAR file in Android eclipse

I want to import external JAR file in my android project, to test this i have only created my own jar file, after that i have done following steps.

1)Right-click on my project
2)Build Path > Add External JAR's > Select your archive (.jar)

The library.jar added to the 'Referenced Libraries' in my project, but after that still i am unable to use classes of my library. So i am not getting how to do this?

Upvotes: 1

Views: 2549

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006549

Step #1: Undo the steps you did above.

Step #2: Copy the JAR into the libs/ directory of your project.

Only the contents of libs/ are packaged into the APK and are available at runtime.

Upvotes: 2

Related Questions