按钮操作无法在android 9+上正常运行,但可以在4-8上运行

时间:2020-01-16 21:57:52

标签: android authentication registration android-9.0-pie

我的应用可以在struct sockaddr_un client_address; socklen_t cl_address_len = sizeof client_address; if(recvfrom(server_socket, &client_input, sizeof(input), 0, (struct sockaddr*)&client_address, &cl_address_len) < 0) { 上运行,并且我假设通过这种方式生成它可以在android 4等上正常工作。

但是在使用android 9, 10的设备上输入应用程序时,由于android 9,它们不能正确register or log进入。但是,在其他版本的android中,它们可以完美运行。

buttons are unresponsive

2 个答案:

答案 0 :(得分:0)

在android 9之上

  • 选项1:

    • 您创建一个文件network_security_config,res / xml / network_security_config。

      <?xml version="1.0" encoding="utf-8"?>
      <network-security-config>
         <domain-config cleartextTrafficPermitted="true">
           <domain includeSubdomains="true">your_domain.com</domain>
         </domain-config>
      </network-security-config>
      
    • 在AndroidManifest中:

      <?xml version="1.0" encoding="utf-8"?>
        <manifest ... >
          <application android:networkSecurityConfig="@xml/network_security_config"
                     ... >
             ...
           </application>
       </manifest>
      
  • 选项2;在AndroidManifest中:

    <application
      android:usesCleartextTraffic="true"
    

    您可以参考:

https://developer.android.com/training/articles/security-config.html

答案 1 :(得分:0)

$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);