如何在 Android 中解压 7zip 存档?
我有一个 7zip
存档,其中包含数百个文件,这些文件分为不同的目录。目标是从 FTP 服务器下载它,然后将其解压到手机上。
我的问题是 7zip
SDK 包含的内容不多。我正在寻找有关 7z 文件解压的示例、教程和片段。
(通过 Intent
解压只是次要选项)
I have a 7zip
archive which contains some hundred files separated into different directories. The target is to download it from a FTP server and then extract it on the phone.
My problem is that the 7zip
SDK doesn't contain a lot. I am looking for examples, tutorials and snippets regarding the decompression of 7z files.
(Decompression via Intent
is only a secondary option)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
转到此处:
LZMA SDK仅提供编码器和解码器对原始数据进行编码/解码,但 7z 存档是一种用于存储多个文件的复杂格式。
Go here:
LZMA SDK just provides the encoder and decoder for encoding/decoding the raw data, but 7z archive is a complex format for storing multiple files.
我发现这个页面提供了一个像魅力一样的替代方案。您只需将
compile 'org.apache.commons:commons-compress:1.8'
添加到您的构建 gradle 脚本中并使用您想要的功能。对于这个问题,我做了以下操作:
唯一的缺点是导入的库大约有 200k。除此之外它真的很容易使用。
i found this page that provides an alternative that works like a charm. You only have to add
compile 'org.apache.commons:commons-compress:1.8'
to your build gradle script and use the feature you desire. For this issue i did the following :
The only draw back is approximately 200k for the imported library. Other than that it is really easy to use.