0

大家。我正在android app与用户一起开发(photos, name, email, etc)。因此,每当用户进入家中时,他都应该找到一些随机用户。我不确定我是否应该创建一个随机数并将其与它进行比较,idUser因此它会选择更接近随机数的 id。

这是表格:

private static final String TABLE_CLIENT_USER= "CREATE TABLE CLIENT_USER (idUser SERIAL, nameUser VARCHAR, lastNameUser VARCHAR, " +
        "phoneUser INT ,picUser BLOB, emailUser VARCHAR, passUser VARCHAR, ReviewUser SMALLINT)";

这就是我插入数据的方式:

            EditText nameEd= (EditText)findViewById(R.id.txtName);
    EditText phoneEd= (EditText)findViewById(R.id.txtPhone);
    EditText cityEd= (EditText)findViewById(R.id.txtCity);
    EditText countryEd= (EditText)findViewById(R.id.txtCountry);
    EditText emailEd= (EditText)findViewById(R.id.txtEmail);
    EditText passEd= (EditText)findViewById(R.id.txtPass);


    String name= (nameEd.getText().toString());
    String phone= (phoneEd.getText().toString());
    String city= (cityEd.getText().toString());
    String country= (countryEd.getText().toString());
    String email= (emailEd.getText().toString());
    String pass= (passEd.getText().toString());

    newValues.put(dbh.nameUser, name);
    newValues.put(dbh.phoneUser, phone);
    newValues.put(dbh.countryUser, country);
    newValues.put(dbh.cityUser, city);
    newValues.put(dbh.phoneUser, phone);
    newValues.put(dbh.emailUser, email);
4

0 回答 0