How to attach any file to APK for installing?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 21:14:39

问题


I want attach any file or data to APK for install , and when to install that APK , my attachment file or data install on our device , how can I do it?

thanks


回答1:


You could directly add a data file to your APK (by making your file part of the assets or raw folder for example) and unpack/move/parse this file when your application starts up for the first time.

An alternative is to use an APK expansion file (only available on Google Play):

Google Play hosts the expansion files for your application and serves them to the device at no cost to you. The expansion files are saved to the device's shared storage location (the SD card or USB-mountable partition; also known as the "external" storage) where your app can access them. On most devices, Google Play downloads the expansion file(s) at the same time it downloads the APK, so your application has everything it needs when the user opens it for the first time.



来源:https://stackoverflow.com/questions/33640930/how-to-attach-any-file-to-apk-for-installing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!