i am in the middle of developing an application which fetches data from server
and displays it.I am using low level api for graphics.ie using canvas class.
when i have to call a web service i start a thread.on run method i paint the
screen in a rectangle with a line moving to and fro .
in the background thread i fetch data from the server.
the problem occurs when the data takes time to be fetched from the server.
the moving line stops,while the data takes more time.
solution i need:
i need the line to move to and fro till i receive data.
even if it is for 1 sec or for 2 minutes.
after that i need to fix a limit so that if the data has not been fetched in a stipulated time lets say 3minutes i need to give a message of "connection timed" out and "retry" message.
increase the time duration of the thread.still painting stops(to and fro motion stops) and
after getting sought of stuck for some time the data is then retrieved.
what the problem might be:
when one thread(background for fetching data) is stuck(taking time).the other thread also stops.
ie it is sought of synchronous.