android - Insert in SQLite database returns BLOB -


i try synchronize web's database phone's local database , inserts rows no problem, when check db string values blobs... couldn't figure out went wrong...

here code example table "users" (it's spread in various classes collected relevant parts):

table creation:

string users = "create table users(id integer primary key, name varchar not null, username varchar not null, mail varchar not null, password varchar not null);";  db.execsql(users); 

getting , sending data:

public void getusers() {     connectivitymanager connmgr = (connectivitymanager) getsystemservice(context.connectivity_service);     networkinfo networkinfo = connmgr.getactivenetworkinfo();     if (networkinfo != null && networkinfo.isconnected()) {          thread thread = new thread(new runnable() {             @override             public void run() {                 persistence consulta = new persistence();                 final string resp;                 string resp1;                 try {                     resp1 = consulta.listusers();                 } catch (unsupportedencodingexception e) {                     resp1 = "exception encoding";                 }catch (exception e) {                     resp1 = "exception encrypt";                 }                 resp = resp1;                 runonuithread(new runnable() {                     @override                     public void run() {                         switch (resp) {                             case "exception encoding":                                  toast.maketext(sincronizar.this, "ups! se produjo un error en la codificación de los parámetros", toast.length_short).show();                                 break;                             case "exception":                                  toast.maketext(sincronizar.this, "ups! hubo un error al conectarse, por favor revise su conexión internet", toast.length_short).show();                                  break;                             case "false":                                  toast.maketext(sincronizar.this, "intento de conexión fallido, vuelva intentarlo mas tarde", toast.length_short).show();                                 break;                             case "exception encrypt":                                  toast.maketext(sincronizar.this, "ups! hubo un error al intentar encriptar/descriptar los datos", toast.length_short).show();                                 break;                             default: //ok                                 obtrespusuarios(resp);                                 break;                         }                     }                 });             }         });         thread.start();     }else{         toast.maketext(sincronizar.this, "no hay conexión internet", toast.length_short).show();     } }  private void obtrespusuarios(string resp) {     jsondecode descodificar = new jsondecode();     int existe = descodificar.existen(resp);     if(existe > 0) {         try {             sqlite helper = new sqlite(this, "my_db", null, 1);             helper.open();             helper.insertusers(descodificar.getuserlist(resp));             showsuccessmsg();             helper.close();         } catch (exception e) {             e.printstacktrace();         }     }     else{          toast.maketext(sincronizar.this, "no hay usuarios", toast.length_short).show();     } } 

inserting data database:

public void insertusers(arraylist<user> user) {     (user oneuser: user) {         contentvalues parametrers = new contentvalues();         parametrers.put("id", oneuser.getid());         parametrers.put("name", oneuser.getname().tostring());         parametrers.put("username", oneuser.getuser().tostring());         parametrers.put("mail", oneuser.getmail().tostring());         parametrers.put("password", oneuser.getpass().tostring());         this.getwritabledatabase().insert("users", null, parametrers);     }  } 

edit: add, used database save data locally , send later web's database, , worked perfectly, guess it's happening data recived web...


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -