How to add add custom assets into .apk file?

2019-05-11 07:39发布

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

3条回答
Juvenile、少年°
2楼-- · 2019-05-11 08:00

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
查看更多
【Aperson】
3楼-- · 2019-05-11 08:02

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.

查看更多
唯我独甜
4楼-- · 2019-05-11 08:06

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

查看更多
登录 后发表回答