简体   繁体   English

Android:将安装时的资产复制到sdcard

[英]Android: copy assets on install to sdcard

How to copy files from assets to sdcard on install? 安装时如何将文件从资产复制到sdcard?
Is there any install script option when generating apk? 生成APK时是否有任何安装脚本选项?

Thanks 谢谢

Use an async task during your "onCreate" and copy all your files from assets to SDCARD (if available), maybe using a splashscreen if you need the data immediately at start. 在“ onCreate”期间使用异步任务,并将所有文件从资产复制到SDCARD(如果可用),如果您需要立即启动数据,则可以使用启动屏幕。

There is no way to execute anything after install it's not under application control. 安装后无法执行任何不受应用程序控制的事情。 Please also note that SDCARD may not be available if the phone is connected in mass storage mode to a pc. 另请注意,如果手机以大容量存储模式连接到PC,则SDCARD可能不可用。

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

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