簡體   English   中英

Android,引用其他庫

[英]Android, referencing other libraries

有沒有一種方法,如何向Android應用程序添加自定義庫。 如果我將非Android庫添加到我的項目中,則會引發錯誤“只能將Android項目添加為依賴項”,如果我將Android庫引用到Java應用程序中,則會拋出“該項目無法添加,因為它不會使用螞蟻腳本。” 關鍵是,我想將代碼保存在一個地方(庫)並重用它。

最好的選擇是:

1.Create a folder called libs in your project's root folder
2.Copy your JAR files to the libs folder
3.Now right click on the Jar file and then select Build Path > Add to Build Path, which will create a folder called 'Referenced Libraries' within your project

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM