title: Android: How do I know how many text can fit in my textView (my page)?
body: <p>I want to create a text reader, which will cut the text and put it in the TextView (represents my pages) and one after the other. These are contained in a ViewFlipper (represents my entire text), which allows me to turn the pages.</p>
  
  <p>By cons I can not cut my text intelligently. For now I limit each TextView to a number of characters, but it is very unstable. Indeed some letters take up more space than others .. We can not use this method.</p>
  
  <p><strong>How can we know what quantity of text will enter into a TextView?</strong></p>
  
  <p>I tried to find the maximum size of my View manually .
  I invoked in:</p>
  
  <pre><code>float test = view.getPaint().measureText(myString);
  </code></pre>
  
  <p>It works well. When I put 480 letters (0 and 1), I get to 14,400 and my text is entirely within the screen. With:</p>
  
  <pre><code>1  -&gt; 12.0
  0  -&gt; 12.0
  é  -&gt; 11.0
  \n -&gt; 13.0
  \r -&gt;  7.0
  </code></pre>
  
  <p>total to fill the page -> 14400</p>
  
  <p><strong>The problem is that the line breaks and carriage return are causing problems.</strong> </p>
  
  <p>If I have only letters or numbers in my string, so good: if we respect the maximum size of 14,400, everything is displayed on the screen. No Problem!</p>
  
  <p>By cons, if a line breaks or a carriage return, it does not work. Even if we we respect the limit of 14400, the text above and is not fully displayed.</p>
  
  <p>This is because the "MeasureText" method;" only returns 13 for a line break. But it's weird, a line break should account for at least 480 to make it consistent.</p>
  
  <p><strong>How do publishers eBook (Moon Reader, + Aldiko) for the text to be formatted so good? Each page has the same height, the text ends in the same place ..</strong></p>