B bluedude Well-Known Member Licensed User Longtime User Mar 4, 2011 #1 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.
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.
F FrankR Member Licensed User Longtime User Mar 4, 2011 #2 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
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?
Erel B4X founder Staff member Licensed User Longtime User Mar 4, 2011 #3 You can also implement a 'retry' method that will try to connect again (up to a predefined number of attempts) if the connection fails. Upvote 0
You can also implement a 'retry' method that will try to connect again (up to a predefined number of attempts) if the connection fails.
B bluedude Well-Known Member Licensed User Longtime User Mar 4, 2011 #4 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
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?
B bluedude Well-Known Member Licensed User Longtime User Mar 4, 2011 #5 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
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.
Erel B4X founder Staff member Licensed User Longtime User Mar 4, 2011 #6 Such issues may also be related to resources not being released. Are you releasing all responses, with Response.Release? Upvote 0
Such issues may also be related to resources not being released. Are you releasing all responses, with Response.Release?
B bluedude Well-Known Member Licensed User Longtime User Mar 5, 2011 #7 Nope, good point. Didn't know existence of that command. Upvote 0