Android Question max length of string > map > file?

Discussion in 'Android Questions' started by Dave O, Mar 31, 2015.

  1. Dave O

    Dave O Active Member Licensed User

    Hi all,

    I'm adding the ability to attach notes to objects in one of my apps, so it would be an EditText view receiving the typed input, a string saving it temporarily, then saving the string in a Map object that is saved to a file using File.WriteMap.

    My main question is: Should I be enforcing a max length? That is, if I don't, is something likely to blow up beyond NNN characters?

    Related question: Do I need to make sure that delimiter characters like double quotes in the text don't screw things up? (e.g. replace a double quote with %20 like HTML does, and then restore it later on load)?

  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    It shouldnt be a problem. There are no known issues related to this.
    The length of the string is probably just limited by the memory.
    I havent tried with double quotes inside the string, but im sure it is automatically escaped otherwise things like JSON wouldnt work.
    Dave O likes this.
  3. sorex

    sorex Expert Licensed User

    Limiting things is always a good option to prevent issues.

    %20 is space, double quote should be %22 but I don't see a reason to replace that?
    Dave O likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice