|
-
Aug 17th, 2013, 07:54 PM
#1
Thread Starter
Lively Member
Re: My app freezes due to internet connection. How to solve this?
Btw, do I need to make this if-check while the whole XML is being loaded and this would mean that I would have to use a do-while loop. Because if I firstly check whether the state is 200 (and wait about 5 seconds if it is not to recheck again) and then after the state = 200, do all the XML loading and parsing? I think that wouldn't make the app freeze but it still would take a lot of time to display the data.
I still don't get why the app freezes? I mean, if there is any problem with the XML loading or parsing I've added the code to display it, but instead it freezes. Or is it the fact that I am loading a form while another one is still in the process of being completely loaded?
-
Aug 17th, 2013, 08:00 PM
#2
Re: My app freezes due to internet connection. How to solve this?
 Originally Posted by kevinKZzaka
Btw, do I need to make this if-check while the whole XML is being loaded and this would mean that I would have to use a do-while loop. Because if I firstly check whether the state is 200 (and wait about 5 seconds if it is not to recheck again) and then after the state = 200, do all the XML loading and parsing? I think that wouldn't make the app freeze but it still would take a lot of time to display the data.
When you get the 200 you can load your DOMDocument with the XML. The DOMDocument does all of the parsing, all you are doing is spelunking your way through the resulting DOM (object tree), you are not parsing anything.
This process should be far faster than getting the data over the Internet.
 Originally Posted by kevinKZzaka
I still don't get why the app freezes? I mean, if there is any problem with the XML loading or parsing I've added the code to display it, but instead it freezes. Or is it the fact that I am loading a form while another one is still in the process of being completely loaded?
We haven't seen any of your code but you admitted to using a synchronous .Open call. That is where your program was hanging.
I'm not sure I can help much more.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|