2014-12-08 71 views

回答

1

如果庫是純Java代碼,沒有資源,你可以創建一個JAR出來的.class文件,就像你會與常規的Java:

1. Right click the project. 
2. Export --> Java --> JAR file. 
3. Tick the files to include and name the jar, click "Next". 

一步一步的細節櫃面的java見this。 對於android看到這個ans

You cannot export the library project to a self-contained JAR file, as you would do for 
a true library. Instead, you must compile the library indirectly, by referencing 
the library in the dependent application and building that application. 

編輯:
對於使用該庫的可繪製看this

+0

是的,我已經更新了我的答案。 – 2014-12-08 09:24:49

+0

我的庫包含更多drawables和xml佈局。我們可以創建jar並在其他項目上使用它? – user3305353 2014-12-08 09:32:45

+0

無法爲android創建jar,請參閱http://stackoverflow.com/q/7973822/3879470,但是如果您將項目設爲庫,則可以像使用其他java項目一樣使用它的類。 – 2014-12-08 10:18:59

相關問題