title: Best way to synchronize Android db local and MySQL
body: <p>I have an Android application that should consume XML from a web server. When the data to be synchronized is small, the synchronization that i have done works perfectly, but when the data is larger the application fails and does not finishes the synchronization. When I say larger i'm saying 19 MB of XML to consume and insert it in Android local database. What can I do to solve this?
  Sorry for my English.</p>
  
  <p>Here some code:</p>
  
  <pre><code>String resposta = Util.executePost(context,"RelacionamentoCelularPontoDeVendaProduto/ListarRelacionamentos", pairs);
  if(resposta.contains("&lt;lista&gt;")) {
          resposta = resposta.substring(resposta.indexOf("&lt;lista&gt;")+7, resposta.indexOf("&lt;/lista&gt;"));
          String[] dados = resposta.split("&lt;item xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"relacionamentoCelularPontoDeVendaProdutoVO\"&gt;");
          String pontoStr, produtoStr;
          ProdutoVO produto;
          for (String dado : dados) {
              if(dado.contains("&lt;pontoDeVenda&gt;") &amp;&amp; dado.contains("&lt;/pontoDeVenda&gt;") &amp;&amp; dado.contains("&lt;produto&gt;") &amp;&amp; dado.contains("&lt;/produto&gt;")){
                  item = new RelacionamentoPontoDeVendaProdutoVO();
                  pontoStr = dado.substring(dado.indexOf("&lt;pontoDeVenda&gt;") + "&lt;pontoDeVenda&gt;".length() , dado.indexOf("&lt;/pontoDeVenda&gt;"));
                  item.setPontoDeVenda(new PontoDeVendaVO(Integer.parseInt(pontoStr.substring(pontoStr.indexOf("&lt;id&gt;") + "&lt;id&gt;".length() , pontoStr.indexOf("&lt;/id&gt;")))));
  
                  lista.add(item);
              }
          }
      }
      return lista;
  </code></pre>
  
  <p>this list called lista in the first syncronization has 45000 registers to be inserted in Android local database. ´</p>