Adding a library/JAR to an Eclipse Android project

1.Download the library to your host development system.

   下載庫到你的電腦裏的文件夾中

2.Create a new folder, libs, in your Eclipse/Android project.

   在你的Eclipse軟件上的Android項目下新建一個文件夾,名字爲:libs(如果有就不需要新建,如果爲lib改爲libs即可)

3.Right-click libs and choose Import -> General -> File System, then Next, Browse in the filesystem to find the library's parent directory (i.e.: where you downloaded it to).

  右鍵點擊libs文件並且選擇(點擊)Import選項,點開General選項,點擊File System選項,點擊Next,點擊Browse,找到你下載下來的庫的文件夾

4.Click OK, then click the directory name (not the checkbox) in the left pane, then check the relevant JAR in the right pane. This puts the library into your project (physically).

   選擇你下載庫的文件夾後點擊OK,在下面左邊的框中選擇你要導入的庫的文件夾,右邊框中選中你要導入的庫文件,點擊finish即可導入庫文件。

5.Right-click on your project, choose Build Path -> Configure Build Path, then click the Libraries tab, then Add JARs..., navigate to your new JAR in the libs directory and add it. (This, incidentally, is the moment at which your new JAR is converted for use on Android.)

  右鍵你的項目,選擇Build Path,選擇Configure Build Path,接着點擊Libraries選項,點擊Add JARs...,選擇你的項目中的libs文件夾中的到入庫,點擊OK即可導入。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章