android jobb工具,如何使用jobb工具创建.obb文件作为主apk扩展文件?

Tip: If you're packaging media files into a ZIP, you can use media playback calls on the files with offset and length controls (such as MediaPlayer.setDataSource() and SoundPool.load()) without the need to unpack your ZIP. In order for this to work, you must not perform additional compression on the media files when creating the ZIP packages. For example, when using the zip tool, you should use the -n option to specify the file suffixes that should not be compressed: zip -n .mp4;.ogg main_expansion media_files

OR 如何让0%压缩ZIP使用winrar?

wgT7W.png

看到这里的压缩方法

,所以我们应该有上传此拉链在Play商店。

,所以你不需要使用ZipHelper.java

只是简单地使用

ZipResourceFile expansionFile=null;

try {

expansionFile = APKExpansionSupport.getAPKExpansionZipFile(getApplicationContext(),3,0);

AssetFileDescriptor fd = expansionFile.getAssetFileDescriptor("test.mp4");

MediaPlayer mPlayer = new MediaPlayer();

mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);

mPlayer.setDataSource(fd.getFileDescriptor(),fd.getStartOffset(),fd.getLength());

mPlayer.prepare();

mPlayer.start();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值