gpt4 book ai didi

android - ZipResourceFile 无法解析为类型

转载 作者:太空狗 更新时间:2023-10-29 12:48:17 24 4
gpt4 key购买 nike

我正在尝试重写我的应用程序以使用 APK 扩展文件。我一直在关注这里的文档 http://developer.android.com/google/play/expansion-files.html .我已经下载了...

enter image description here

...但是当我添加这段代码时...

public static Uri getTrackUriFromZipFile ( int track ) {
// Get a ZipResourceFile representing a specific expansion file
ZipResourceFile expansionFile = new ZipResourceFile(filePathToMyZip);
}

... 我收到错误消息 ZipResourceFile cannot be resolved to a type :( weep weep weep

编辑...嗯,也许我必须做这样糟糕的事情...

如果您使用的是 Eclipse,请为每个库创建一个项目并将其添加到您的应用中:

为许可证验证库和下载器库创建一个新的库项目。对于每个库:开始一个新的 Android 项目。选择从现有源创建项目并从/extras/google/目录中选择库(许可证验证库的 market_licensing/或下载程序库的 market_apk_expansion/downloader_library/)。指定项目名称,例如“Google Play License Library”和“Google Play Downloader Library”单击完成。注意:下载器库依赖于许可证验证库。请务必将许可证验证库添加到下载器库的项目属性中(与下面的步骤 2 和 3 相同的过程)。右键单击要在其中使用 APK 扩展文件的 Android 项目,然后选择“属性”。在“库”面板中,单击“添加”以选择每个库并将其添加到您的应用程序。

http://developer.android.com/google/play/expansion-files.html#AboutLibraries

最佳答案

您需要使用 Android SDK 管理器额外安装 Google Play APK 扩展库。它将安装在 <sdk>/extras/google/play_apk_expansion/ 中文件夹。 (您还需要额外的 Google 市场许可,如果您尚未安装的话。)

该文件夹包含几个库项目:downloader_libraryzip_file .它还包含一个示例项目,downloader_sample ,即设置为使用库。您可以将其用作设置您自己的项目的模式。

ZipResourceFile您询问的类在 zip_file 中定义图书馆项目。

关于android - ZipResourceFile 无法解析为类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15491559/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com