Vivil
Vivil

Reputation: 103

(httplog)-static: issbsettingenabled false android

I am developing Android app and running in Samsung J7. The problem is while running the app it show the error "(httplog)-static: issbsettingenabled false" is there any way to enable httplog true or an alternative way to solve this. If programmatially want to enable this how to do that

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

Upvotes: 5

Views: 8757

Answers (1)

Mare Seestern
Mare Seestern

Reputation: 345

I think it is more a warning than an error. If you get spammed by these messages you can deactivate this certain type of Error (there are other questions on Stackoverflow).

I first thought this would be an error because I did not receive any data on my server.

My mistake was that the Code did not work probably. (Forgot to ask for the response code) This Code work probably:

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");
    }

Tip: It is easier to debug with the Debugger Mode because you will see more Errors

Upvotes: 0

Related Questions