I am developing an application for WP7 . For tests I used an emulator and everything was cool. For communication with the server used WebClient and RestClient . But after testing a ready-made application on a real device, such a thing came to light:

 private void LoadData() { var webClient = new WebClient(); webClient.DownloadStringCompleted += DownloadStringCompleted; webClient.DownloadStringAsync(new Uri(Constants.Url1)); //Point_1 } private void DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { //Point_2 } 

On the emulator between Point_1 and Point_2 0.8-1.2 seconds. On the device (HTC Radar) between Point_1 and Point_2 15-20 seconds.

 var request = new RestRequest(url) {Method = Method.POST}; //Point_3 RestClient.ExecuteAsync(request, response => { //Point_4 } 

On the emulator between Point_3 and Point_4 0.3-0.5 seconds. On the device (HTC Radar) between Point_3 and Point_4 18-22 seconds.

I have 3 questions:

  • First: Is this normal?
  • Second: Why is this happening?
  • Third: How can you solve this problem of wasting time?
  • Can the Internet speed on the device brake? - Chad
  • No, the device and computer use the same network. - jimpanzer

1 answer 1

You are using asynchronous loading. It allows other operations to be performed in parallel, therefore, most likely, the device does something else during the download. MB, updated ...

Well, yes, about the speed of an Internet on the device - so what, that the same network? Speedtest checked? Or something else?

  • The problem occurred only in debug mode on the phone. The solution turned out to be creating a xap file and uploading directly to the phone. - jimpanzer 2:22 pm