java - Android not reading XML file from another webhosting -
i have simple problem problem have xml file mytext.xml on link
http://alsauditech.com/finalfetch/mytext.xml fine when read file web server
but when try read mytext.xml file server http://www.islamicessentials.org/audio/mytext.xml(www.ixwebhosting.com/ )
my application crashes tried gave permission 777 , filed suppport ticket , tried chat busy
my logcat
06-27 14:00:59.689: i/process(23648): sending signal. pid: 23648 sig: 9 06-27 14:01:04.741: i/webkit/webview(23718): webview() constructor=android.webkit.webview@40531360 06-27 14:01:04.822: i/webkit/webview(23718): webview.loadurl() this=android.webkit.webview@40531360url: data:text/html;utf-8,<html><body><h1>live broadcast</h1><br><object data='http://23.226.131.127/player.php' width='330' height='50' type='text/html'></object><br><object data='http://23.226.131.127/stats_bb_ios_g.php' width='330' height='100' type='text/html'></object> </body></html> 06-27 14:01:04.857: i/inetaddress(23718): inetaddress_getaddrinfo> 06-27 14:01:04.857: i/inetaddress(23718): inetaddress_getaddrinfo< 06-27 14:01:04.864: i/system.out(23718): [socket][0] connection /71.18.205.253:80;localport=56453(0) 06-27 14:01:04.865: i/system.out(23718): /71.18.205.253:80(0) 06-27 14:01:04.865: i/osnetworksystem(23718): osnetworksystem_connect fd=-1; timeout = 60000 06-27 14:01:04.887: i/system.out(23718): /23.226.131.127:80(0) 06-27 14:01:04.888: i/osnetworksystem(23718): osnetworksystem_connect fd=-1; timeout = 60000 06-27 14:01:04.892: i/system.out(23718): /23.226.131.127:80(0) 06-27 14:01:04.893: i/osnetworksystem(23718): osnetworksystem_connect fd=-1; timeout = 60000 06-27 14:01:05.117: i/system.out(23718): socket[addr=/0.0.0.0,port=0,localport=56453] 06-27 14:01:05.117: i/system.out(23718): [socket][/192.168.1.3:56453] 06-27 14:01:05.117: i/system.out(23718): setsosndtimeout:0 06-27 14:01:05.118: i/system.out(23718): setsendbuffersize:8096 06-27 14:01:05.120: i/system.out(23718): doreceiveresponse 06-27 14:01:05.177: i/system.out(23718): socket[addr=/0.0.0.0,port=0,localport=35199] 06-27 14:01:05.177: i/system.out(23718): setsendbuffersize:8192 06-27 14:01:05.447: i/inetaddress(23718): inetaddress_getaddrinfo> 06-27 14:01:05.447: i/inetaddress(23718): inetaddress_getaddrinfo< 06-27 14:01:05.448: i/system.out(23718): [socket][1] connection /71.18.205.253:80;localport=50036(0) 06-27 14:01:05.448: i/system.out(23718): /71.18.205.253:80(0) 06-27 14:01:05.448: i/osnetworksystem(23718): osnetworksystem_connect fd=-1; timeout = 60000 06-27 14:01:06.104: e/mediaplayer(23718): error (1, -1004) 06-27 14:01:06.105: e/mediaplayer(23718): error (1,-1004) 06-27 14:01:08.190: i/system.out(23718): socket[addr=/0.0.0.0,port=0,localport=37596] 06-27 14:01:08.190: i/system.out(23718): setsendbuffersize:8192 06-27 14:01:08.707: i/system.out(23718): socket[addr=/0.0.0.0,port=0,localport=50036] 06-27 14:01:08.708: i/system.out(23718): [socket][/192.168.1.3:50036] 06-27 14:01:08.708: i/system.out(23718): setsosndtimeout:0 06-27 14:01:08.708: i/system.out(23718): setsendbuffersize:8096 06-27 14:01:08.709: i/system.out(23718): doreceiveresponse 06-27 14:01:08.710: e/dalvikvm(23718): [dvm] mmap return base = 45d99000 06-27 14:01:09.077: e/error:(23718): expected: /meta read: head (position:end_tag </head>@16:10 in java.io.stringreader@40542110) 06-27 14:01:09.080: w/dalvikvm(23718): threadid=1: thread exiting uncaught exception (group=0x4001e6a8) 06-27 14:01:09.084: e/androidruntime(23718): fatal exception: main 06-27 14:01:09.084: e/androidruntime(23718): java.lang.runtimeexception: unable start activity componentinfo{info.androidhive.expandablelistview/islamicessentials.mainactivity}: java.lang.nullpointerexception 06-27 14:01:09.084: e/androidruntime(23718): @ android.app.activitythread.performlaunchactivity(activitythread.java:1741) 06-27 14:01:09.084: e/androidruntime(23718): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1760) 06-27 14:01:09.084: e/androidruntime(23718): @ android.app.activitythread.access$1500(activitythread.java:156) 06-27 14:01:09.084: e/androidruntime(23718): @ android.app.activitythread$h.handlemessage(activitythread.java:1000) 06-27 14:01:09.084: e/androidruntime(23718): @ android.os.handler.dispatchmessage(handler.java:130) 06-27 14:01:09.084: e/androidruntime(23718): @ android.os.looper.loop(sourcefile:351) 06-27 14:01:09.084: e/androidruntime(23718): @ android.app.activitythread.main(activitythread.java:3827) 06-27 14:01:09.084: e/androidruntime(23718): @ java.lang.reflect.method.invokenative(native method) 06-27 14:01:09.084: e/androidruntime(23718): @ java.lang.reflect.method.invoke(method.java:538) 06-27 14:01:09.084: e/androidruntime(23718): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:969) 06-27 14:01:09.084: e/androidruntime(23718): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:727) 06-27 14:01:09.084: e/androidruntime(23718): @ dalvik.system.nativestart.main(native method) 06-27 14:01:09.084: e/androidruntime(23718): caused by: java.lang.nullpointerexception 06-27 14:01:09.084: e/androidruntime(23718): @ islamicessentials.streammanager.audiomanaer(streammanager.java:104) 06-27 14:01:09.084: e/androidruntime(23718): @ islamicessentials.mainactivity.preparelistdata(mainactivity.java:127) 06-27 14:01:09.084: e/androidruntime(23718): @ islamicessentials.mainactivity.oncreate(mainactivity.java:42) 06-27 14:01:09.084: e/androidruntime(23718): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1082) 06-27 14:01:09.084: e/androidruntime(23718): @ android.app.activitythread.performlaunchactivity(activitythread.java:1705) 06-27 14:01:09.084: e/androidruntime(23718): ... 11 more 06-27 14:01:11.511: i/system.out(23718): close [socket][/0.0.0.0:35199] 06-27 14:01:15.512: i/system.out(23718): close [socket][/0.0.0.0:37596] 06-27 14:01:38.504: i/system.out(23718): /23.226.131.127:80(0) 06-27 14:01:38.505: i/osnetworksystem(23718): osnetworksystem_connect fd=-1; timeout = 60000 06-27 14:01:38.794: i/system.out(23718): socket[addr=/0.0.0.0,port=0,localport=51337] 06-27 14:01:38.794: i/system.out(23718): setsendbuffersize:8192 06-27 14:01:45.110: i/system.out(23718): close [socket][/0.0.0.0:51337]
thanks in advance muhammad zeeshan
audiomanager function public list<string> audiomanaer(int arrayposition) { /*if(arrayposition == 0) { url = "http://islamicessentials.org/audio/mytext.xml"; }else if(arrayposition == 1) { url = "http://islamicessentials.org/audio/mytext.xml"; }else if(arrayposition == 2) { url = "http://islamicessentials.org/audio/mytext.xml"; }*/ url = "http://www.islamicessentials.org/audio/mytext.xml"; //the php script creates files string ndp = "http://islamicessentials.org/audio/index.php"; httpclient client = new defaulthttpclient(); try { client.execute(new httpget(ndp)); } catch(ioexception e) { system.out.println("something not right have closed application"); system.exit(0); } list<string> testlist = new arraylist<string>(); string xml = this.getxmlfromurl(url); // getting xml document doc = this.getdomelement(xml); // getting dom element
nodelist nl = doc.getelementsbytagname(key_item);//line 104
// looping through item nodes <item>3 myarray = new string[2][nl.getlength()]; (int = 0; < nl.getlength(); i++) { // creating new hashmap hashmap<string, string> map = new hashmap<string, string>(); element e = (element) nl.item(i); // adding each child node hashmap key => value string id = map.put(key_id, this.getvalue(e, key_id).tostring()); string name = map.put(key_name, this.getvalue(e, key_name)); string cost = map.put(key_cost, this.getvalue(e, key_cost)); string desc = map.put(key_desc, this.getvalue(e, key_desc)); // adding hashlist arraylis (string key: map.keyset()) { // system.out.println("key : " + key); system.out.println("value : " + map.get("url")); myarray[0][i] = map.get("url"); } testlist.add(map.get("name")); // testlist.add(map.get("url")); //map.get("url"); } return testlist; }
preparelistdata
private void preparelistdata() { listdataheader = new arraylist<string>(); listdatachild = new hashmap<string, list<string>>(); // adding child data listdataheader.add("recent audios"); listdataheader.add("english lectures of month"); listdataheader.add("women's lectures of month"); listdataheader.add("lectures of month"); listdataheader.add("kalaam-e-muhabbat"); //this dynamic populating happens streammanager stm = new streammanager();
listdatachild.put(listdataheader.get(0), stm.audiomanaer(0)); // line 127
listdatachild.put(listdataheader.get(1), stm.audiomanaer(1)); listdatachild.put(listdataheader.get(2), stm.audiomanaer(2)); listdatachild.put(listdataheader.get(3), stm.audiomanaer(2)); listdatachild.put(listdataheader.get(4), stm.audiomanaer(2)); for(int i=0;i<streammanager.myarray[0].length;i++) { system.out.println("all urls coming"+streammanager.myarray[0][i]); } }
updated :
i have found problem is not able no read xml file on other server
the error message
01-01 08:07:01.408: e/error:(1503): expected: /meta read: head (position:end_tag </head>@16:10 in java.io.stringreader@405d1c08)
Comments
Post a Comment