title: Best way to efficiently load large lists
body: <p>My question is: how is it possible to load (only once, when the user launches the app) a large listview.</p>
  
  <p><br />
  For example, an SMS app. </p>
  
  <p>As soon as the app is opened, the app will fetch for all SMS in the phone's memory and show them in a ListView. But how can you do it without disturbing the user or impacting the performance ?</p>
  
  <p>An <strong><em>ASyncTask</em></strong> looking for all the conversations while the user is still staring at the top ? What if he has more than 100000 SMS ? Should I restrict it to a number and when the user reaches a certain point then load the rest ?<br />For a "research in your messages" function, do I need to have ALL the SMS loaded for easy access or search in the phone's memory for easy storage?</p>
  
  <p>Finally, I always wondered how did famous chat apps handle that, and I'm really curious what are the solutions.</p>
  
  <p><br />
  Thanks for your help,</p>
  
  <p>Ysjanati.</p>
  
  <p><br />
  <br />
  <br /></p>
  
  <p><strong>EDIT:</strong> Well, it's true that I was asking way too many questions for not much, I'll attempt to rectify this.<br /><br />
  First, I tried many things, like : </p>
  
  <ul>
  <li>loading messages bit by bit while the user scrolls through the list</li>
  <li>a big loading at the beginning of the instance</li>
  <li>even making a page-by-page model with a big "load more" button</li>
  </ul>
  
  <p>The thing about databases is that if we're talking about SMS, there is already an intern database within the phone containing all the data I need. You don't want to forget that other apps may manipulate this DB without my app's permission; it means we need constant syncing between the phone's native DB and my custom one. What do you sugger ?</p>
  
  <p>Once again, thanks for all of your answers.</p>