How to include data files with the app's APK?

后端 未结 3 715
心在旅途
心在旅途 2020-11-30 03:16

I want to create some pre-created files when my Android application is installed.

I would like to create the file in both the internal memory (data/data//files/) and

3条回答
  •  孤独总比滥情好
    2020-11-30 03:25

    You can save you files in \res\raw and write the code to store this files to the desired locations if it does not exist when the app start.
    Check this to access the internal memory and sdcard
    and access the raw file using the following

    InputStream databaseInputStream = getResources().openRawResource(R.raw.yourfile);
    

提交回复
热议问题