Windows store app - How to avoid App Hang when app is doing a Server communication process for long time?

Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,866 Reputation points
2019-12-12T12:22:23.487+00:00

Hi,

I am having a widows store app running in Windows 8.1. In that, I am doing some server communication. the process step is as below

  1. Before starting server communication, i show a loading screen by showing a UI with Progress ring in a popup.
    1. Disable the Corewindow's input as below to avoid any interaction in UI.
    Window.Current.CoreWindow.IsInputEnabled = false
    1. Start the function which talks to server. [Which takes maximum 15 seconds to 25 seconds]
    2. Once get the response from server, i close the popup
    3. I enable the Corewindow's input as below for enabling app's interaction await Task.Delay(TimeSpan.FromSeconds(0.1));
      Window.Current.CoreWindow.IsInputEnabled = true;
      await Task.Delay(TimeSpan.FromSeconds(0.1));

When the app showing, i am just touching the loading screen continuously. now app crashes and eventlog says that it is as App Hang.

How to solve this?

anyone please give me solution..

Thanks.

Universal Windows Platform (UWP)
0 comments No comments
{count} vote

Accepted answer
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,866 Reputation points
    2019-12-12T12:28:39.07+00:00

    Hello,

    The error log looks coming from the server communication. And please avoid set IsInputEnabled as false In general, we use Loading control to disable input during the service connection.

    alt text

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.