如何在Android eclipse中导入外部JAR文件 [英] How to import an external JAR file in Android eclipse
问题描述
我想在我的android项目中导入外部JAR文件,为了测试这个我只创建了自己的jar文件,之后我完成了以下步骤。
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)
将library.jar添加到项目中的Referenced Libraries ,但在那之后我仍然无法使用我的图书馆的课程。所以我没有得到如何做到这一点?
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?
推荐答案
步骤1:撤消你上面做的步骤。
Step #1: Undo the steps you did above.
步骤2:将JAR复制到项目的 libs /
目录中。
Step #2: Copy the JAR into the libs/
directory of your project.
只有 libs /
的内容被打包到APK中并且在运行时可用。
Only the contents of libs/
are packaged into the APK and are available at runtime.
这篇关于如何在Android eclipse中导入外部JAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!