我的应用程序在android 4上工作,我假设通过这种方式生成它,它可以在android 9, 10上正常工作,等等。
但是,当在使用android 9的设备上进入应用程序时,它们无法正确地register or log入,因为buttons are unresponsive。然而,在android的其他版本中,它们可以完美地工作。
public class LoginRequestion extends StringRequest {
private static final String LOGIN_REQUEST_URL="http://...Login.php";
private Map<String, String> params;
public LoginRequestion(String usuario, String contrasena, Response.Listener<String> listener) {
super(Request.Method.POST, LOGIN_REQUEST_URL, listener, null);
params = new HashMap<>();
params.put("usuario", usuario);
params.put("contrasena", contrasena);
}
@Override
public Map<String, String> getParams() {
return params;
}
}发布于 2020-01-17 10:52:40
android 9以上版本
- you create a file network\_security\_config, res/xml/network\_security\_config.- In AndroidManifest:
<应用程序android:usesCleartextTraffic="true“
你可以参考:
https://developer.android.com/training/articles/security-config.html
发布于 2020-01-20 07:24:28
$con = mysqli_connect("localhost", "xxxxx", "xxxxx", "xxxxx");$usuario = $_POST"usuario";$contrasena = $_POST"contrasena";
$statement = mysqli_prepare($con, "SELECT * FROM usuarios WHERE usuario = ? AND contrasena = ?");
mysqli_stmt_bind_param($statement, "ss", $usuario, $contrasena);
mysqli_stmt_execute($statement);mysqli_stmt_store_result($statement);mysqli_stmt_bind_result($statement,$userID,$nombre,$email,$usuario,$contrasena);
$response = array();
$response["success"] = false;
while(mysqli_stmt_fetch($statement)){
$response["success"] = true;
$response["nombre"] = $nombre;
$response["email"] = $email;
$response["usuario"] = $usuario;
$response["contrasena"] = $contrasena;
}
echo json_encode($response);https://stackoverflow.com/questions/59778414
复制相似问题