Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Loading initial data from the server - Where to place code?

$
0
0

Upon app launch, I want to connect to my server and obtain a chunk of data.

My plan is to check for internet connection first, and if it's unavailable notify the user to connect to the internet and tap "OK" to try again.

Now, I've read that some people use AppDelegate.FinishedLaunching() for initialization code. But I know that we shouldn't take longer than 17 seconds to return from that method, which means I can't really use that. (Also, if I want to display a message to the user, wouldn't I need to do that in a view controller somewhere?)

Another option is in Main.cs, but also in there I think I cannot notify the user?

I should be able to do this in my first View controller, but it seems that AppDelegate.FinishedLaunching() won't return before ViewDidLoad() returns, so again I have the 17 second problem.

Am I missing something? What other options do I have?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>