is there a maximum size to android internal storage allocated for an app?

前端 未结 4 1500
小鲜肉
小鲜肉 2020-12-01 07:43

I want to save a json file with all the application data (something similar to preference) but im not sure what is the limit size, because if the app cant use this file it w

4条回答
  •  鱼传尺愫
    2020-12-01 08:03

    I've never witnessed it limit a single application, and I have tested it with saving some rather large (200 mb) video files in the app Files dir before.

    For internal storage I think your only limited by the amount of internal storage made available for all applications to share. Which as @Ted Hopp mentioned is rather small on some of the older and lower end devices. But on the newer and higher end devices they've started bumping it up to a reasonable amount, though even if the device has a lot of space, it could still be taken up by other applications(so you need to test what will happen in this scenario).

    It is also worth pointing out that if you use external storage such as the SD card then your json file would technically editable by the user. They could open it up in a text editor and start changing the raw values if they had any desire to. (This is also possible if you choose to use internal storage, but it would require a rooted device, whereas if it is stored on the SD card would not require root)

    So if you are storing info that you'd rather the user not have the option to manually edit, you may want to take that into consideration.

提交回复
热议问题