((httplog)-static:issbsettingenabled false android

问题描述 投票:4回答:1

我正在开发Android应用,并在Samsung J7中运行。问题是在运行应用程序时,它显示错误“ ((httplog)-static:issbsettingenabled false”),是否可以使用任何方法启用httplog true或替代方法来解决此问题。如果以编程方式要启用此功能,该如何操作

private void tryLogin(String log, String pass) {


            HttpURLConnection connection;
               OutputStreamWriter request = null;

                    URL url = null;   
                    String response = null;         
                    String parameters = "="+log+"&="+pass;   

                    try
                    {
                         url = new URL("http://209.68.26.95/anglertechnologieseit/lc_webservice/webservice.php?Case=loginCheck");
                        connection = (HttpURLConnection) url.openConnection();
                        connection.setDoOutput(true);
                        connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                        connection.setRequestMethod("POST");    

                        request = new OutputStreamWriter(connection.getOutputStream());
                        request.write(parameters);
                        request.flush();
                        request.close();            
                        String line = "";               
                        InputStreamReader isr = new InputStreamReader(connection.getInputStream());
                        BufferedReader reader = new BufferedReader(isr);
                        StringBuilder sb = new StringBuilder();
                        while ((line = reader.readLine()) != null)
                        {
                            sb.append(line + "\n");
                        }
                       stored in response variable.                
                        response = sb.toString();

                    Toast.makeText(this,"Message from Server: \n"+ response, 0).show();             

                        System.out.println("Message from Serverrrrrrrrrrrr     :"+response);
                        isr.close();
                        reader.close();

                    }
                    catch(IOException e)
                    {
                        System.out.println("eeerrrrooorrr"+e);
                    }

        }

enter image description here

android servlets https adb android-logcat
1个回答
0
投票

我认为这是警告而不是错误。如果您收到这些消息的垃圾邮件,则可以停用此错误类型(Stackoverflow上还有其他问题)。

我首先认为这将是一个错误,因为我没有在服务器上收到任何数据。

我的错误是该守则可能无效。 (忘记询问响应码)此代码可能工作:

try { System.out.println("HTTP Upload");
        URL Singin_url = new URL("http://192.168.0.157:80");
        HttpURLConnection client = (HttpURLConnection)          
        Singin_url.openConnection();
        client.setRequestMethod("POST");
        client.setDoOutput(true);
        client.setDoInput(true);
        client.setConnectTimeout(10000); // 5 sec
        client.setReadTimeout(10000);

        OutputStream out = new BufferedOutputStream(client.getOutputStream());
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
        String data = "POST_FROM_MOBILE";
        writer.write(data);
        writer.flush();
        writer.close();
        out.close();
        Log.e("E", String.valueOf(client.getResponseCode()));
    }catch(MalformedURLException error) {
        Log.e("Error","Wrong URL");
    }
    catch(SocketTimeoutException error) {
        Log.e("Error","Timeout");

    }
    catch (IOException error) {
        Log.e("Error","IOException Error");
    }

提示:使用调试器模式进行调试更容易,因为您将看到更多错误

© www.soinside.com 2019 - 2024. All rights reserved.