-1

Been trying to use the Sony camera API and I've been experimenting with the Remote API Sample app.

This App seems to work fairly well, but I've notice that sometimes when launching the Camera Activity with the live view I'm getting an IOException:

06-20 12:58:46.696: W/SimpleLiveviewSurfaceView(8216): IOException while fetching: null

This seems to be originating from the readBytes method in the SimpleLiveviewSlicer this is the line of code:

int readlen = in.read(buffer, 0, trialReadlen);

This can be reproduced by Launching the SampleCameraActivty , then pressing back to go back to CameraRemoteSample Activity and then launching the SampleCameraActivity by clicking on the URL again.

It doesn't happen every time , but often enough for it to be a problem.

Anyone on the Sony Camera team seen this? It seems that the inputstream is getting corrupted somehow.

taf
  • 429
  • 5
  • 11
  • Could be this problem http://stackoverflow.com/questions/19258518/android-httpurlconnection-eofexception . I think the code is actually throwing a EOFException which is a sub class of IOException. – taf Jun 20 '14 at 14:41

1 Answers1

0

As this post says:

Android HttpUrlConnection EOFException

There is an issue with the Android HttpUrlConnection. Sometimes it throws a EOFException which in this case surfaces as an IOException.

My solution was to use a different Http lib. In my case I used OKHttp by the guys at square:

http://square.github.io/okhttp/

Community
  • 1
  • 1
taf
  • 429
  • 5
  • 11