Jump to content

Why can I not receive token in the App I'm developing, but it works flawlessly on my mobile browser?


davidv7

Recommended Posts


This should be the relevant code. 


try
        {
            Log.w("URLString",result);

            connection = (new URL(result)).openConnection();
            connection.setConnectTimeout(5000);
            connection.setReadTimeout(5000);
            connection.connect();

// Read and store the result line by line then return the entire string.
            InputStream in = connection.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            StringBuilder html = new StringBuilder();
            for (String line; (line = reader.readLine()) != null; ) {
                html.append(line);
            }
            reader.close();

            Log.w("Code ",html.toString());
        }

 

This is the URL i'm using. I'm connecting from my phone to my laptop(on the same wi-fi). 

readWebsite.execute("http://username:password@192.168.1.5:8080/gui/token.html");

 

Anyone got any ideas? I've been stuck on this forever, asked everyone I knew and no one could give me any advice. I've read some stuff about cookies, could that be it?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...