I'm trying to decipher and the truth is that I'm already very burned and I can not figure out how to store my SQLITE list (cart of articles and prices) in a remote MYSQL database (I'm working with volley);
The theme is like this first I retrieve my SQLITe data and store it in a list:
private List<PedidosBean> recuperaListaSQLite() {
AdminSQLiteOpenHelper admin = new AdminSQLiteOpenHelper(getApplicationContext(), "pedidos", null, 1);
SQLiteDatabase bd = admin.getReadableDatabase();
Cursor cursor = bd.rawQuery("SELECT nombre_art, precio_art, codigo_art, cantidad_art FROM pedidos", null);
DecimalFormat df = new DecimalFormat("#.00");
if (cursor.moveToFirst()) {
do {
PedidosBean articulos = new PedidosBean();
articulos.setNombre_art(cursor.getString(0));
articulos.setPrecio_art(cursor.getDouble(1));
articulos.setCodigo_art(cursor.getInt(2));
articulos.setCantidad_art(cursor.getInt(3));
listaSQLite.add(articulos);
} while (cursor.moveToNext());
}
bd.close();
return listaSQLite;
}
Then I do not know what to do to take it to mysql ... I convert it into JsonArray? I swear I do not realize. please a little help?