Is it possible to load data as a background process in j2me?

Even with a bad network connection?

In particular, I wrote code that launches a separate thread (from the user interface) that tries to download the file via HTTP POST. However, I found that if the connection is bad, the processor is looping for outputstream.close () or httpconnection.getheaderfield () or for any read / write that forces data over the network. This not only makes the thread stuck, but also steals the entire processor, so even the user interface becomes immune.

I tried to lower the priority of the thread, but to no avail.

My theory is that there is no easy way to avoid this behavior, so the entire j2me tutorial tells developers to create a "send data over the network ..." instead of just sending everything to the background stream. If someone can prove to me that this is wrong, that would be fantastic.

Thanks!

+3
source share
3 answers

An important aspect is the presence of a universal user interface or screen that can be displayed when a network call fails in the background. This is pretty much necessary for any J2ME mobile application or otherwise.

, , , , , (.. ) , ..

, , - , 5 1-2 .

J2ME , , .

, , , - , ( , samsung sanyo - )

, , .

+1

, . CLDC , - , ( ) . .

+1

, . . - . , . , , , . , .

0

Source: https://habr.com/ru/post/1703146/


All Articles