Boa tarde pessoal,
-- possuo um WebService feito em Delphi e DataSnap.
Meu APP sincroniza os dados com o banco de dados do cliente via meu WS.
Ex:
try {
/* * Abre a transacao no banco de dados */ bancoDados.beginTransaction();
/* * ***************************************** * ************** PRODUTO ***************** * ***************************************** */
/* Buscar os registros no servidor */ ds = serv.GetProduto();
/* Inicializar o content values */ ct = new ContentValues();
/* limpar tabela */ apagaTabela("PRODUTO"); Log.d("Apaga tabela", "Apaga tabela produto");
/* Percorrer o DataSet e gravar os registros no banco de dados local */ while (ds.next()) {
ct.put("CODPROD", ds.getValue("CODPROD").GetAsAnsiString() .trim()); ct.put("CODIGO", ds.getValue("CODIGO").GetAsAnsiString().trim()); ct.put("NOMEPROD", ds.getValue("NOMEPROD").GetAsString().trim()); ct.put("PREVENDA1", ds.getValue("PREVENDA").GetAsDouble()); ct.put("PREVENDATAB2", ds.getValue("PREVENDATAB2").GetAsDouble()); ct.put("ESTATU", ds.getValue("ESTATU").GetAsDouble()); ct.put("NAOVENDER", ds.getValue("NAOVENDER").GetAsString()trim()); ct.put("INATIVO", ds.getValue("INATIVO").GetAsString().trim()); /*Campo da versao 3 do bando de dados*/ ct.put("PRECUSTO", ds.getValue("PRECUSTO").GetAsDouble()); ct.put("CUSTOMEDIO", ds.getValue("CUSTOMEDIO").GetAsDouble()); ct.put("CUSTOREAL", ds.getValue("CUSTOREAL").GetAsDouble());
Log.d("Sincronizador", "");
/* Insere o registro no banco */ bancoDados.insertOrThrow("PRODUTO", null, ct);
}
/* * Informa ao bd que obteve sucesso na transacao */ AndroidUtils.abreBanco(context, bancoDados); bancoDados.setTransactionSuccessful();
*/
bancoDados.endTransaction(); AndroidUtils.fechaBanco(bancoDados); dbh.close();Na retaguarda possuo o banco Firebird e o campo imagem no formato blob.
Como faço para receber uma imagem, salvar ela no SDK do aparelho e salvar o caminho dela no banco para exibir no ListView?
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/d/optout.






0 comentários:
Postar um comentário