| Reply | « Previous Thread | Next Thread » |
|
hi ,
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. Issue: 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. steps tried: 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. |
|
How many threads do you create? Just one? Or two: one for the connection and one for the animation?
What device are you using? Cheers, Graham. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
There are two threads one for animation and one for connection.
|
|
Join Date: Mar 2008
Posts: 2,161
Location: The Capital of I N D I A
raj_J2ME
Offline
Forum Nokia Champion
|
|
Hi,
For the connection time out you can store the time at the time of the connection starting...then keep on check the time in loop (run())..as soon as the current time reached equal or greater then 3 min then set the connection time out and then handle the keypressed... Thanks R a j - The K e r n e l |
|
Some actions do cause all threads to stop, depending on the device. For example, accessing RMS.
What quantity of data are you receiving? Over what kind of connection? On what device? Cheers, Graham. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
i am connecting to a web service through stubs .
i am using CLDC.size is variable.i am getting pics one at a time, and its few details. with regards |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| login dialog send to server and retrieve data from server | samsee | Python | 4 | 2008-12-13 18:37 |
| J2ME encrypt C# decrypt | josual | Mobile Java Networking & Messaging & Security | 13 | 2008-10-20 05:29 |
| Socket : server gets data only when I exit client app | viku_006 | Mobile Java Networking & Messaging & Security | 4 | 2007-06-25 13:26 |
| 6600 gprs 发送大量rtp延时问题 | dicson_hu | Symbian | 9 | 2005-11-04 03:12 |
| Clarifications on User Data, User Data Binary and User Data Header | saijee | General Messaging | 2 | 2004-09-15 23:47 |