I am storing String into shared preferences, but I wasn’t able to find out maximal length of string I can store. Do you know this value?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By Romain Guy From the Question Asked Here,
I suppose while SharedPreference is an XML file stored with One Tag if you store only One Pair/Object.
So there is no limit to write String in that if you think like you are writing in a file..(Theoretically)
But Actually what happens is that, while you are assigning value to SharedPreference using
put/getfunction at that time you Reading/Writting value in String Object..so the limit becomes to store value at one time equal to Size limit of String Object of Java.So while writting the code: Limit of SharedPreference String Size = Java String Object Size Limit(Practically)