Note that there are some explanatory texts on larger screens.

plurals
  1. POMono for Android - Activity crash upon service call
    primarykey
    data
    text
    <p>My application has a UI (implemented with an <em>Activity</em>) and a service (implemented with the <em>IntentService</em>). The service is used to send data (synchronous, using <em>NetworkStream.Write</em>) to a remote server as well as to update the transmission status to the UI (implemented using <em>Broadcast Receiver</em> method).</p> <p>Here is my problem: </p> <ul> <li><p>The application works properly if the size of the buffer used for the NetworkStream.Write is 11 KB or less.</p></li> <li><p>However, if the size of the buffer is larger than 11 KB, say 20 KB (this size needed in order to send jpg images), then the sevice keeps working properly (verified with log file), nonetheless the UI its gone (similar as if device's back button is pushed) and I can't find the way to bring it back. Its important to point out that in this case the Activity its not going into <em>OnStop()</em> nor <em>OnDestroy()</em> states.</p></li> <li><p>At first I thought this would be some <em>ApplicationNotResponding</em> related issue due to a server delay, yet the UI crashes after about 5 sec.</p></li> <li><p>Moreover, this only happens with the Hardware version. The emulator version works fine.</p> <pre><code>// SEND STREAM: Byte[] outStream = new Byte[20000]; // -- Set up TCP connection: -- TcpClient ClientSock = new TcpClient(); ClientSock.Connect("myserver.com", 5555); NetworkStream serverStream = ClientSock.GetStream(); serverStream.Write(outStream, 0, outStream.Length); serverStream.Flush(); // . . . // RECEIVE STREAM: inStream.Initialize(); // Clears any previous value. int nBytesRead = 0; nBytesRead = serverStream.Read(inStream, 0, 1024); // -- Closing communications socket: -- ClientSock.Close(); </code></pre></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload