0

I am new in using jar files in Android application. While checking code for Android apps code.google.com suggested the jar files. I don't know how to use the classes from jar files. Please help me!

Thanks

alex
  • 5,516
  • 2
  • 36
  • 60

3 Answers3

0

Create a folder that is called /libs at the root directory of your project, and put your jar files in there.

PearsonArtPhoto
  • 38,970
  • 17
  • 111
  • 142
0

Just put the jar in the libs folder of the project, then it will automatically be added to your project by Android SDK.

Now the code from the jar is accessible in your code.

If you added a jar containing the package org.jartest with the class IAmAnObject. You should be able to write IAmAnObject test = new IAmAnObject(), right click IAmAnObject in eclipse and select import org.jartest.IAmAnObject.

cYrixmorten
  • 7,110
  • 3
  • 25
  • 33
0

I don't know about eclipse. The way you use a external library in an android project is by creating a 'libs' folder in the projects source folder and putting the jar files in their.

Don't forget to add the path of libs to the build path so they are available when building the final project (in eclipse it's right click the jar and select 'add to build path'

It has already been answered and a definite duplicate but I cannot seem to paste the answer URL.

0xGiddi
  • 404
  • 2
  • 12