a) Should I not call the service from the FinishedLaunching method in AppDelegate?
You get a limited time to run your application, i.e. return from FinishedLaunching , or the iOS watchdog will kill your application. This is approximately 17 seconds (but may vary between device / iOS versions).
Anything that takes some time is best done in another thread running with FinishedLaunching . This is even more important if you use network services because you cannot be sure how long (or even if) you will receive a response.
b) Am I calling the service incorrectly?
It looks good. However, remember that the simulator has faster access to the network (most likely), much more RAM and CPU power. A large dataset can take a lot of memory / processor time to decode.
Starting from another thread will at least take extra time. It can be as simple as adding the code (below) inside your FinishedLaunching .
ThreadPool.QueueUserWorkItem (delegate { window.BeginInvokeOnMainThread (delegate {
You can see how Touch.Unit does this by looking at TouchRunner.cs .
Note: you can test without using (requesting) compressed data, since time / memory for unpacking may not be very useful on devices (compared to the simulator). Actual testing must be confirmed;)
source share