简体   繁体   English

Android APK扩展文件问题

[英]Android APK Expansion File questions

I figured since my app is 114 megs I should use an expansion apk. 我想因为我的应用程序是114兆,我应该使用扩展apk。

If I throw all these vids into the raw folder of my project it reaches that size. 如果我将所有这些vid放入项目的原始文件夹中,它将达到该大小。

With an expansion APK could I get it to download all those videos and throw it into the raw folder? 有了扩展APK,我可以下载所有这些视频并将其放入原始文件夹吗?

Create a secondary Zip file and use it to store the video files without any additional compression (using zip -0 from the command line). 创建一个辅助Zip文件,并使用它存储视频文件,而无需进行任何其他压缩(在命令行中使用zip -0)。 There is a library provided (apkx_zip_file) that will allow you to get an asset file descriptor from the Zip file. 提供了一个库(apkx_zip_file),该库可让您从Zip文件中获取资产文件描述符。 From this, you can pass the offset and length into the MediaPlayer. 由此,您可以将偏移量和长度传递给MediaPlayer。 If you need to use the VideoView, you can also set up your own content provider using APEZProvider, which is also in the library. 如果需要使用VideoView,也可以使用库中的APEZProvider设置自己的内容提供程序。

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

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