简体   繁体   English

我们可以访问android“ external”文件夹中的库吗

[英]Can we access libraries in android “external” folder

The android source code has an "external" folder where there are many libraries such as jmonkeyengine. android源代码有一个“外部”文件夹,其中有许多库,例如jmonkeyengine。 I am wondering if I can access those libraries? 我想知道是否可以访问那些库? There are two scenarios that I am interested in: 我对两种情况感兴趣:

  • If I am just developing an app for the app store, could I somehow use those library (ie, not including those library in my apk and let my app access them directly from the android system somehow). 如果我只是为应用商店开发一个应用,我可以以某种方式使用那些库(即,不在我的apk中包括那些库,而是让我的应用以某种方式直接从android系统访问它们)。 My initial experiment seems to suggest a "No", I basically compile an apk that use jmonkeyengine library - but I exclude the library from the apk. 我的最初实验似乎建议“否”,我基本上是编译一个使用jmonkeyengine库的apk-但我从apk中排除了该库。 The app would crash immediately when launched because my activity refereed to a jmonkey class. 该应用程序在启动时会立即崩溃,因为我的活动引用了jmonkey类。

  • If I am developing an "internal app" for an android device (as in compile the whole android source code with my app in the "app" folder in the source code), will I be able to access these library by default?) I have not try anything here yet. 如果我正在为Android设备开发“内部应用程序”(如在源代码的“ app”文件夹中用我的应用程序编译整个android源代码),则默认情况下可以访问这些库吗?还没有在这里尝试任何东西。

Thanks in advance. 提前致谢。

Well, after working on it for a while, I think I have the answers: 好吧,经过一段时间的研究,我认为我得到了答案:

  1. The answer for the first question, from my experience (as oppose to reading some references...), is NO. 根据我的经验(反对阅读一些参考文献...),第一个问题的答案为否。

  2. The answer for the second questions is also NO. 第二个问题的答案也是“否”。 By default you will not get access to it. 默认情况下,您将无法访问它。 You get access to it by changing the build files instructing android to link your app to the library. 您可以通过更改构建文件(指示android将您的应用链接到该库)来访问它。 At this point this sounds very obvious to me, but at the time I wrote the question that is not very clear 在这一点上,这听起来对我来说很明显,但是当时我写的问题不是很清楚

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

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