Well....50 mph is about 22 m/s - so driving at that speed in a
straight line you are firing web queries off at the rate of
approximately 1 every 2 seconds.  Running sql queries over the web on
a 3G network I'm not really surprised that the app locks up and has
lag.

Why not write a little app to fire off one of your queries every 60
seconds or so and record the round trip time for one of your typical
queries.  Then go and drive around in different locations and at
different speeds and see what sort of real life response you get?  My
guess would be that the critical point is not your app but the
network.

You could also try writing an app that just writes a timestamp every
50 meters and drive around to see how frequently your queries are
going to be run.



On Jan 14, 11:12 pm, cellurl <[email protected]> wrote:
> I run GPS, and query a web based mysql every 50 meters of driving.
> People tell me the app locks up and has lag, so I put each query in a
> new thread. This seems to create a backlog of threads (at least in the
> emulator).
>
>         URL url = new URL("http://www.website.org/marks.php";);
>
>         HttpURLConnection urlConn = (HttpURLConnection) url
>                 .openConnection();
>         BufferedReader in = new BufferedReader(new InputStreamReader(
>                 urlConn.getInputStream()));
>         String inputLine;
>         while ((inputLine = in.readLine()) != null)
>                 response.append( inputLine );
>
> 1. Are dozens of threads wrong? Do I just use two and leave it at
> that?
> 2. Should I keep connection open as I have heard others speak of?
> 3. Will I ultimately be forced to sqlite and the new headache of db
> synchronization?
>
> Anyone have any experience to offer?
>
> Thanks in advance,
> -cellurl

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to