Android:在 Eclipse 中将用户库加载到 AVD 上
我试图将一个库(例如,uses-library)放到 AVD 上,如果我用 ADB 推送它,操作系统不知道它存在,并且重新启动模拟器会从内存中清除推送的文件。我发现启动模拟器时可以加载库:
如果您的应用程序声明 在其清单中使用-library元素 文件,应用程序只能运行在 系统映像,其中外部 图书馆存在。如果你想跑步 您在模拟器上的应用程序, 创建一个 AVD,其中包括 所需的库。通常,您必须 使用附加组件创建这样的 AVD AVD 平台的组件(用于 例如,Google API 插件 包含 Google 地图库)。
http://developer.android.com/guide/developing/devices/索引.html
如何从文件而不是附加组件中包含我的库?
I am trying to get a library (eg. uses-library) onto an AVD, if I push it with ADB the OS doesn't know it exists, and restarting the emulator clears the pushed file from memory. I found that it is possible to load a library when starting the emulator:
If your application declares a
uses-library element in its manifest
file, the application can only run on
a system image in which that external
library is present. If you want to run
your application on an emulator,
create an AVD that includes the
required library. Usually, you must
create such an AVD using an Add-on
component for the AVD's platform (for
example, the Google APIs Add-on
contains the Google Maps library).http://developer.android.com/guide/developing/devices/index.html
How do I include my library from file, not from add-on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果该库位于 APK 中,则需要将其复制到设备,然后使用模拟器上的包管理器进行安装。
如果库位于 Jar 中,那么您需要将其添加到项目构建路径中。执行此操作后,该库将包含在编译的 APK 中,并在安装 APK 时放置在模拟器上。
If the library is in a APK then you need to copy it to the devices and then install it using the package manager on the emulator.
If the library is in a Jar then you need to add it to your projects build path. After you do this the library will be included into the compiled APK and will be puto on the emulator when you install your APK.