简体   繁体   English

Android外部库路径

[英]Android External library path

I am using a external library in my project. 我在我的项目中使用外部库。 in my current java build path library path shows as C:/xxx/xxx/Github/MyProject/libraryOne/libs . 在我当前的Java构建路径库中,路径显示为C:/xxx/xxx/Github/MyProject/libraryOne/libs As, I am not the only one developer,other people that might work with the code. 作为,我并不是唯一一个可以使用该代码的开发人员。 So, I want make it like 所以,我想让它像

../libraryOne/libs

I think, the first one will not work in other platform, right ? 我认为,第一个不能在其他平台上使用,对吗? So, How can I do that and what will be the best solution for me ? 那么,我该怎么办?对我来说最好的解决方案是什么?

Its not a matter of platform. 这与平台无关。 It is matter of different machine. 是不同机器的问题。 The first path is hard coded and the C: in other developer's machine is not the same as your C:. 第一个路径是硬编码的,并且其他开发人员的计算机中的C:与您的C:不同。 Thus, the system would not be able to traverse to the right folder when they run it on their machine. 因此,当系统在他们的计算机上运行该文件夹时,该系统将无法遍历该文件夹。 The second way to write the path is good, assuming that MyProject folder has the project that you are working on. 假设MyProject文件夹包含您正在处理的项目,则第二种写路径的方法很好。 Thus, when the other developer start using MyProject, they would automatically have the folder libs. 因此,当其他开发人员开始使用MyProject时,他们将自动拥有文件夹libs。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM