Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't get input stream from internet connection

 
Ivan Kesic
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I'm developing application, that logs onto http page and gets one number from source. When i start it in regular java it works and shows number, but when i do it in android sdk, it makes an exception here "InputStream in = urlConnection.getInputStream();".

why android doesn't want to get that input stream?
And 1 more question, i cant see stack trace of an error,i tried every option in console, ddms, javastacktrace, but only android is showing text about loading of virtual device...
 
Tim Moores
Bartender
Posts: 3129
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would very useful for anyone trying to help you to know *what* exception you are getting. You don't mention logcat - is there really no stack trace in there that belongs to this exception? That would be highly unusual.
 
Ivan Kesic
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, there is nothing. I cant find anything about exception, just empty blank console on every option except on android where error is not shown... Don't know what to do. Logcat, do i have to install it or is it there somewhere already?
 
Vishal Trivedi
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii

if you are using Eclipse then to get LogCat

change perspective to DDMS

the option for this task will be on top-right side of your screen

when you switch to DDMS
click on "show view as fast view"
thats the same palace you get your console output and other tools
There you shall find logcat
 
Tim Moores
Bartender
Posts: 3129
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The documentation is your friend; it explains many things you simply need to know, and without which you'll waste countless hours: http://developer.android.com/guide/developing/tools/adb.html#logcat
 
Ivan Kesic
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately today i don't have time to even sit for computer, but tomorrow ill try and let you now if it works, what is the exception.

Thank you
 
Ivan Kesic
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved!
Add this to android manifest and it will work then.. Also i can use logcat for debug so thank you very much for helping me...

<uses-permission android:name="android.permission.INTERNET" />
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic