Monday, January 9, 2012

Android Angst

Who knew to use the internet you have to ask the manifest for permission. Everybody but me. I spent nearly two hours dissecting my disgustingly disorganized dribble trying to find the cliche in the code, and it turns out there wasn't one. I finally pinpointed the problem with the BufferedReader, which thew an unknown host exception. Googling this led me to our savior, a Stack Overflow post, gratefully labelled Android: Unknown Host Exception, which although solving a slightly different dilemma had the answer I needed. In order to use the internet, you must have

<uses-permission android:name="android.permission.INTERNET" /

in your manifest.xml file. The easiest way to do this is with the eclipse plugin, just go to the manifest's permissions tab.

Of course I totally skipped the manifest section of the dev guide, so I have only myself to blame. Checking through the android sdk site, I did find a section on Building Web Apps, that I had already looked at, that mentions this requirement, although not in exactly the same context.

I really need to read through the entire dev guide. And maybe finish the java trails. And, and, and.
Fork me on GitHub