How to add add custom assets into .apk file?

爱⌒轻易说出口 提交于 2019-12-22 11:14:24

问题


I need to have some files in android assets folder, how can I add them using QtCreator/QMake?


回答1:


Assuming you have the following structure in your source directory:

foo.pro
extra_data/file1
extra_data/file2
…

Adding the following to foo.pro should deploy the extra_data folder to assets://extra_data (exact path might differ, cannot verify right now) in the APK:

folder_01.source = extra_data
folder_01.target = extra_data
DEPLOYMENTFOLDERS += folder_01



回答2:


If you are developing the application, then simply copy/paste the files in assets folder.

But if your application is already built and available as .apk file then you cannot modify any of its content.




回答3:


Copying files to /5.2.0/android_armv7/src/android/java/assets did the trick



来源:https://stackoverflow.com/questions/20520745/how-to-add-add-custom-assets-into-apk-file

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