Tecnologia do Blogger.
RSS

[androidbrasil-dev] Inserir ArrayList retornada de json no SQLite

Tenho um método que está retornando um arrayList contendo Json de um webservice. preciso saber como inserir este arrayList no banco de dados.


Método retornando ArrayList.

public List<Usuario> getListaUsuario(String servidor, int codUsuario, Context context){
ArrayList<Usuario> listaUsuario = null;

String[] resposta = new WebServiceCliente().get("http://" + servidor + URL_WS + "codUser/" + codUsuario, context);  
try {
if (resposta[0].equals("200")) {
Gson gson = new Gson();
listaUsuario = new ArrayList<Usuario>();
JsonParser parser = new JsonParser();
   JsonArray array = parser.parse(resposta[1]).getAsJsonArray();
  
return listaUsuario;
}catch (Exception e){
return listaUsuario;
}
}

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário