java.net.SocketTimeoutException

bluedude

Well-Known Member
Licensed User
Longtime User
Hi,

I have developed a mobile app. with B4A that uses a backend API and overall it works great but I get a lot of java.net.SocketTimeoutExceptions

I tested a few things and when this happens the connection is still there because my device browser works.

Also checked the backend but this works too all the time (on a very stable fast server).

Setting .timeout does not seem to solve the problem.
 

FrankR

Member
Licensed User
Longtime User
I think you need to say more and/or post some source to get an assist.

Also, how are you running the app? On hardware or in the emulator?
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
I run it on a Nexus One and I get this error a lot of times. Not sure why because I know for sure the code is correct. I'm not getting any other errors.

I do something similar like Erel did in his Flickr sample (I cannot share the code). I first do a http call for some text data (using an ID for that session) and then just after that I try to get an image download. So basically these are two calls within a second, one to send data somewhere and one to get an image.

Maybe calling these just after each other is a problem?
 
Upvote 0

bluedude

Well-Known Member
Licensed User
Longtime User
Mmm, ok.

Just thought about it, probably better to use a webview to get it fixed. I use Google Static maps to get an image with latest location but that is probably easier with a webview.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…