Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some modification in my code make me to achieve destination. Firstly i add e.printstacktrack in catch body.</p> <pre><code>try { Log.d(TAG, "Trying to get the input stream.."); iStream=c.getInputStream(); } catch (Exception e) { e.printStackTrace(); iStream=c.getErrorStream(); } </code></pre> <p>Which let me know about the new exception.which was</p> <pre><code> android.os.NetworkOnMainThreadException .............. </code></pre> <p>And this exception is resolved by putting you code in a thread </p> <pre><code> Thread t = new Thread(){ @Override public void run() { // TODO Auto-generated method stub try { HttpsURLConnection c=(HttpsURLConnection) new URL(url.trim()).openConnection(); Log.d(TAG, "Parameter value is " + "Basic " + DatatypeConverter.printBase64Binary((email+":"+password).getBytes())); c.setRequestProperty("Authorization","Basic "+DatatypeConverter.printBase64Binary((email+":"+password).getBytes())); InputStream iStream=null; try { Log.d(TAG, "Trying to get the input stream.."); iStream=c.getInputStream(); } catch (Exception e) { e.printStackTrace(); iStream=c.getErrorStream(); } Log.d(TAG, "Trying to read..."); InputStreamReader iStreamReader=new InputStreamReader(iStream); Log.d(TAG, "Buffering..."); BufferedReader bReader=new BufferedReader(iStreamReader); String result=""; String line=""; Log.d(TAG, "About to parse results..."); while ((line=bReader.readLine())!=null) { Log.d(TAG, "Line is " + line); result +=line+"\n"; } Log.d(TAG, "Output is: " + result); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } super.run(); } }; t.start(); </code></pre> <p>Now its working fine.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload