We are building a real time traffic analysis and reporting GPS application for our 4th year University project and I am in need of a little insight. Basically we are sending an object (which we serialize) via HTTP POST to our server and wait for the server to respond. When it responds we do some stuff with the response, etc., etc.
Problem is that sometimes the server will timeout and not respond or the response for whatever reason, won't make it back and the app will hang while waiting and eventually force a close on the application after a certain length of time.
Everything as is works fine when the server responds, it is the times that it doesn't that the application crashes
Here is the relevant lines...
Does anybody have any ideas how I can rework this to only wait x seconds and then retry for example or at least do something politely so the application does not crash? Thanks in advance, really appreciate any help with this as deadline is approaching quickly!