Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6766559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:50:44+00:00 2026-05-26T14:50:44+00:00

I have an iPhone app which is pulling just about all it’s data from

  • 0

I have an iPhone app which is pulling just about all it’s data from ASP.NET MVC services.

Basically just returning JSON.

When I run the app in the simulator, the data is pulled down very fast etc.. however when I use the actual device (3G or WiFi) it’s extremely slow. To the point that the app crashes for taking too long.

a) Should I not be calling a service from the FinishedLaunching method in AppDelegate?

b) Am I calling the service incorrectly?

The method I’m using goes something like this:

public static JsonValue GetJsonFromURL(string url) {
     var request = (HttpWebRequest)WebRequest.Create (url);
     request.AutomaticDecompression = DecompressionMethods.GZip |     DecompressionMethods.Deflate;
     using(var response = (HttpWebResponse)request.GetResponse()) {
          using(var streamReader = new StreamReader(response.GetResponseStream())) {
                 return JsonValue.Load(streamReader);
          }
     }
}

Is there a better or quicker way I should be querying a service? I’ve read about doing things on different threads or performing async calls to not lock the UI, but I’m not sure what the best approach or how that code would work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:50:45+00:00Added an answer on May 26, 2026 at 2:50 pm

    a) Should I not be calling a service from the FinishedLaunching method in AppDelegate?

    You get limited time to get your application up and running, i.e. returning from FinishedLaunching or the iOS watchdog will kill your application. That’s about 17 seconds total (but could vary between devices/iOS versions).

    Anything that takes some time is better done in another thread, launched from FinishedLaunching. It’s even more important if you use networking services as you cannot be sure how much time (or even if) you’ll get an answer.

    b) Am I calling the service incorrectly?

    That looks fine. However remember that the simulator has a faster access to the network (likely), much more RAM and CPU power. Large data set can take a lot of memory / CPU time to decode.

    Running from another thread will, at least, cover the extra time required. It can be as simple as adding the code (below) inside your FinishedLaunching.

    ThreadPool.QueueUserWorkItem (delegate {
        window.BeginInvokeOnMainThread (delegate {
            // run your code
        });
    });
    

    You can have a look at how Touch.Unit does it by looking at its TouchRunner.cs source file.

    note: you might want to test not using (asking) for compressed data since the time/memory to decompress it might not be helpful on devices (compared to the simulator). Actual testing needed to confirm 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone app which, when it launches, loads in data from a
I have an iPhone app which gets a response from a php file. This
I have a simple iPhone app which accesses some remote data on start-up then
I have been developing an iPhone app which queries a server that relays data
I have an iPhone/iPad app which uses Core Data. In my DB I have
An iPhone app which I am creating generates reports from a Core Data database
I am writing an iPhone app which uses core data for storage. All of
Let us say I have an audio iPhone app which takes input from the
I have an iPhone app which communicates with a server to get the data
I am developing an iphone app which will fetch the data from CSV file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.