关于文件存放

博客主要围绕Android应用中FFmpeg的使用展开。指出应用需有读写存储权限,且不同设备路径有差异,应使用特定方法找实际路径。还给出解决办法,可重命名文件并放入项目指定目录,系统安装程序会自动解压可执行文件。

 

https://stackoverflow.com/questions/20201067/ffmpeg-executable-chmod-permission

 

 

Your Android app must have permissions to read and write to storage, in AndroidManifest.xml:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />.

Another caveat is the path, /storage/emulated/0/ is not available on all devices, you should use Environment.getExternalStorageDirectory() to find the actual path.

Finally, there is an easy workaround instead of extracting ffmpeg from raw folder, rename ffmpeg to lib...ffmpeg...so and put it into directory libs/armeabi in your project.

Naturally, you will later run Runtime.getRuntime().exec(getContext().getApplicationInfo().nativeLibraryDir + "/lib...ffmpeg...so" +whatever)

System installer will unpack the executable into /data/data/your.package.full.name/lib for you automagically.

转载于:https://www.cnblogs.com/pythonClub/p/10896852.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值