Sandip Armal Patil
Sandip Armal Patil

Reputation: 5905

error in parsing xml file

Hi i create one save11111.xml file and place on server. Here is code of .xml file
I need to fetch data from that file. but when i am trying to run file it show error in
Log cat. Here is logcat

04-14 19:18:58.137: ERROR/AndroidRuntime(22682): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.examguide/com.example.examguide.ReadBooksActivity}: java.lang.IllegalStateException: Target host must not be null, or set in parameters.
04-14 19:18:58.137: ERROR/AndroidRuntime(22682): Caused by: java.lang.IllegalStateException: Target host must not be null, or set in parameters.
04-14 19:18:58.137: ERROR/AndroidRuntime(22682):     at org.apache.http.impl.client.DefaultRequestDirector.determineRoute(DefaultRequestDirector.java:572)
04-14 19:18:58.137: ERROR/AndroidRuntime(22682):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
04-14 19:18:58.137: ERROR/AndroidRuntime(22682):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
04-14 19:18:58.137: ERROR/AndroidRuntime(22682):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
04-14 19:18:58.137: ERROR/AndroidRuntime(22682):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:292)
04-14 19:18:58.137: ERROR/AndroidRuntime(22682):     at com.example.examguide.XMLParser.getXmlFromUrl(XMLParser.java:45)
04-14 19:18:58.137: ERROR/AndroidRuntime(22682):     at com.example.examguide.ReadBooksActivity.onCreate(ReadBooksActivity.java:43)  

I don't understand what's wrong in my code.Here and Here

Please give me some hint or reference.
Any help is Appreciated.

Upvotes: 0

Views: 228

Answers (1)

flo
flo

Reputation: 2018

You forgot to specify the protocol in your URL:

        static final String URL = "http://www.cerebrumtechno.com/Save.xml";

Upvotes: 1

Related Questions