什么是一个Android共享preference值的最大尺寸是多少?是一个、尺寸、最大、preference

2023-09-12 07:55:30 作者:安好时辰忧伤

我完全AP preciate倾倒大量的数据装入preferences是完全不恰当的,但我的要求是不是很大,但足够大(可能500-5000字节)的地方我不知道它是否是适当与否。该文档没有帮助。 http://developer.android.com/reference/android/content/Shared$p$pferences.Editor.html

I fully appreciate dumping lots of data into the preferences is totally inappropriate, but my requirement is not that great, but large enough (potentially 500-5000 bytes) where I've no idea whether it's appropriate or not. The docs do not help. http://developer.android.com/reference/android/content/SharedPreferences.Editor.html

我已经搜查了网,#1,不能找到一个明确的答案: 一)实际的限制是什么,基于底层架构上 B)的实际限制是什么,根据性能(我发现可能需要几秒钟甚至写短preF值,但我怀疑这只是一个闪存写入延迟)

I've searched the net and Stackoverflow and can't find a definitive answer on: a) what the actual limit is, based on the underlying architecture b) what the practical limit is, based on performance (I find writing even short pref values can take a few seconds, but I suspect that's just a flash write delay)

请问AP preciate澄清。

Would appreciate clarification.

推荐答案

所有共享preFS存储在/数据/数据​​/ [包名] / shared_ preFS / [应用程序名称]。 XML ,所以我觉得有没有基于架构的限制。

All shared prefs are stored in /data/data/[package name]/shared_prefs/[app name].xml, so i think there's no limit based on architecture.

我不知道实际的限制,但我认为这是够你。

I don't know practical limit but I think it's enough for you.