Android :: HttpsURLConnection Failing Intermittently To Same URL
May 15, 2010
I think I'm experiencing the same as http://groups.google.com/group/android-developers/msg/9d37d64aad0ee357
This is Android 1.5 SDK. I happen to call several times below code(which is in a method) with
the same url and it fails intermittently. When it fails, there is no exception, the stream is empty so the
readConnection fails, and getResponseCode returns -1. Global caching is disabled, setDefaultUseCaches(false);
I suppose there must be some kind of url connection object pool somewhere.
How can I workaround this?
CODE:............................
View 2 Replies
May 20, 2009
I have been working with the HttpsUrlConnection class and have found an interesting issue, it seems to fail on every other connection. The first request connects to the server successfully but the second one always fails. Any ideas on what i may be doing wrong.
Here is my code.
code:.................
View 3 Replies
View Related
Sep 17, 2010
I use the following code snippet to connect to a server and retrieve some data:
HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection(); InputStream ins = con.getInputStream();
The code mostly works fine. If I leave the app for a few minutes, and return to it and make another request, I receive an IOException: Broken Pipe.
Once it has failed one time, it immediately works again, and will continue to do so until I leave it for a while once more.
I don't know if this is an Android specific thing, or general Java, but it doesn't happen on my desktop test version.
View 7 Replies
View Related
Aug 30, 2010
I try to establisch a HttpsURLConnection with:
CODE:.................
But I get an Exception:
CODE:......................
But I can't find out, why. The same example is everywhere across the web.
View 2 Replies
View Related
Mar 9, 2010
I am using HttpsURLConnection to post data to a web server.
Here is the function I wrote to get the result. (see the code below)
Very strangely, when the function be first called in my program it would very likely return -1; and then I re-call the function after the first call, it would always work ok.
So I wonder if there is anything I am missing in the code that when the function be firstly called, the missing party is be "initialized", in that the followed call goes OK.
Here is my code of the function:
CODE:....................
View 3 Replies
View Related
Jan 31, 2010
I'm hoping someone could help me out with intermittent connections I'm getting using code with HttpsURLConnection.
The code I'm using is below:
CODE:...............
The connection works the first time everytime when I use it to pull a json file. However, when I use the connection again to send a command, it always fails the first time. It then typically works if I send the
command quickly ( within 5 seconds), but fails if I wait a while. I don't think its a SSL issue because it connects the first time correctly, but I could be wrong here. I also tried many different
variations such as adding:
CODE:.............
However, I had no luck. Any help would be greatly appreciated.
View 2 Replies
View Related
Aug 16, 2010
I try to build an https client for android and i need do get some request of an Servlet but when i use the getInputStream method the applicaion hangs.
There is no error only hanging when i call the method.
CODE:..................
This is only to check the call, but it didtn work.
the subscribe method works, when i comment out the line with the inputstream, the server show me all is correct. I can try the same with the Firefox and it works and i can see the request. i also put the keystore into the TrustManager.
View 2 Replies
View Related
Sep 27, 2010
I'm a problem with a HttpsURLConnection that I can't seem to solve. Basically, I'm sending up some info to a server and if some of that data is wrong, the server sends me a 500 response code. However, it also sends a message in the response telling me which bit of data was wrong. The problem is that the message is always empty when I read it in. I think this is because a filenotfound exception always gets thrown before the stream can be read. Am I right? I tried reading the errorstream as well but this is always empty.
Here's a snippet:
CODE:........................
View 3 Replies
View Related
Mar 12, 2010
I have some Android code that can send files to my webserver using an HttpsUrlConnection, but when it tries to send larger files I get an OutOfMemory exception when opening the OutputStream. Can anyone offer some assistance?
It looks something like this:
code:..............
This is where I try different things. The closes solution has been: httpConn.setChunkedStreamingMode(1024); In this case, I don't get the OutOfMemory immediately when opening the OutputStream, but I see the heap growing as I os.write() and it eventually runs out.
code:..............
View 7 Replies
View Related
Mar 30, 2010
I've got a problem with my application when I make a number of requests using the HttpsUrlConnection class.
My program makes the first request using the HttpsUrlConnection class to retrieve a file. It then makes a second request to the same server to retrieve a different file. What happens however is that periodically I'm getting a -1 HTTP response code on the connection.
When the failure occurs between the two requests I see the following line of trace in logcat:
D/OpenSSLSessionImpl( 699): Freeing OpenSSL session
This seems to happen fairly consistently. If I retry the second request after it has failed it generally works and I get the requested file from the server.
Note that if I don't see the OpenSSL session being freed the second request works fine the first time.
Some other information:
1) I'm not calling disconnect on the connection
2) I'm don't always read the entire file from the server after the first request
3) I always close the InputStream in the event that I get an InputStream on the first connection
How to prevent the OpenSSL session from being freed.
View 2 Replies
View Related
May 15, 2010
I'm experiencing the same as http://groups.google.com/group/android-developers/msg/9d37d64aad0ee357
This is Android 1.5 SDK. I happen to call several times below code(which is in a method) with the same url and it fails intermitently. When it fails, there is no exception, the stream is empty so the readConnection fails, and getResponseCode returns -1. Global caching is disabled, setDefaultUseCaches(false);
How can I workaround this?
CODE:.........................
View 4 Replies
View Related
Nov 24, 2010
I'm having a big issue with a static HTTPS connection method. Every second request fails and HttpsUrlConnection.getResponseCode() returns -1. So every second call works well, returning data as expected.
It's the method of a static class I'm using in different corners of my application. I would guess there is anything I don't clean up correctly when the method returns the first time and that whatever causes a problem might get destroyed through a second call of the method. But I'm having a hard time finding any clues.
I'm currently using this class to talk to hosts with invalid SSL certificates. Not going to use this in the final version of the app, but right now I need to save money. ;)
CODE:.......................
View 1 Replies
View Related
May 10, 2010
Anyone else have this problem with the HTC Droid Incredible on Android 2.1 rebooting itself intermittently? In the last 2 weeks, it has rebooted it self about 5 times that I know of. NO, I am not rooted. No, I have not seen any update notifications.
View 15 Replies
View Related
Jul 24, 2009
This is an intermittent bug in one of my apps. I don't expect anyone to solve it immediately, but I'd appreciate any thoughts on how to start debugging!So, my app lets users edit an item (in the EditPage activity). When they press the Back key, the desired behaviour is that it saves their edits and returns them to the home page (the HomeList activity). The code for this is below. It works fine. Except.The bug is this. Some users report that sometimes when they reopen the application after a pause, they are seeing *not* the home page, where they left the application - but the previous edit activity. Crucially, they are also seeing the edit activity without their saved edits - effectively losing their most recent edits.I've been able to reproduce this myself. It only happens after the application hasn't been opened for a while. If I save something, minimize the application and reopen it straight away, it shows the HomeList activity just fine, and the edits have all been saved. But if I save something, leave it for a couple of hours and then reopen it, it shows the previous EditPage activity, without the saved edits (i.e. in the state that the EditPage activity was previously launched).
Any ideas, anyone? I had wondered whether it was due to the Back button being used to return the user to the HomeList activity - maybe Android thinks that the Back button means that the HomeList is not the most "recent" activity, instead the EditPage is. I'd like to carry on using the Back button if possible, though. And in particular, I'm puzzled why it only happens after the app has been idle for an hour or so, and not immediately? Is it something to do with Android's memory management?
View 4 Replies
View Related
Apr 8, 2010
Here's a crashlog. It happened on n1 after a rotation. Looks like the swap function is called with a wrong arg. Log ...
View 2 Replies
View Related
Oct 26, 2010
I included the Android Market licensing (LVL) in my application and is currently using it to block invalid users. However users are emailing me that they are legit and include proof that they indeed bought the application. In looking at the errors generated during authentication, I get something along the line of "failed to reach server 505 error" which basically means that the Android Market server isn't responding and authenticating the users correctly.
In my personal experience when I encountered this once in my testing (I was hoping it was unique but it's not), I had to wait 30 mins before it finally worked. My phone was using wireless and clearly had no network issues. Ultimately the Android Market server is glitch and faulty (which is nothing new) and was just not responding and authenticating for around 30 mins. This leads to an extremely crappy experience for my users.
Other than dropping using this licensing scheme, I don't know what else to do. Android market connection is just too faulty for everyday usage. Do other developers have a better experience? Others using LVL at all? Others with similar experience?
View 3 Replies
View Related
Aug 3, 2013
Since updating to 4.3 both my and my girlfriend's Nexus 4 clock keeps jumping back 8 hours. Then corrects itself. Then goes wrong again, a few times per hour.
We bought the phones in the UK where there is an 8 hour time difference.
When we look at clock it says UK time is actually Los Angeles and Los Angeles is UK. It swaps them, which makes no sense.
Turning auto time zone off makes no difference, it's getting it from AT&T directly.
View 3 Replies
View Related
May 16, 2013
just joined up and looking for an answer to an issue I'm currently experiencing with my HTC ONE X. Phone has been fine, now suddenly the phone will not wake up. Everything works fine when initially turned on- can put it to sleep, wake it up with no problems (so the button is working fine) but if I leave the phone for 5-10 mins then try to wake it up I get nothing. So currently am having to constantly have it so the screen never goes off which is hardly ideal (especially on this phone considering the battery isn't the best to start with...!)
Phone is not rooted and on Vodafone UK. Running 4.1.1
View 3 Replies
View Related
Jul 13, 2009
I'm writing a game using the drawing method from Chris Pruett's opengl spritemethodtest demo. The Activity running my opengl view works fine on initial load, and about half the time after turning off the phone and turning it back on. However, the other half, it locks up. I'll get a "lock_layer timed out (is the CPU pegged?)" warning that keeps repeating. I tried running the debugger to find the exact line that the error is occurring on, but the strange thing is that this error won't occur if I'm running the debugger on my G1. It only happens under normal operating conditions. Any help would be appreciated, as this bug really has me stumped.
Here are my onPause and onResume activity methods:
CODE:.............
Here's a stack trace, running from the initial onCreate call to the lockup (I added some extra Log warnings to illustrate when different lifecycle methods are being called):
CODE:..................
View 2 Replies
View Related
Jun 9, 2010
Sometimes my music player (TuneWiki or MixZing)randomly turn on & even though I will pause they they will keep turning on.It normally happens when I am listening to Last.FM or FM Radio.This used to happen on my HTC Hero to.
View 6 Replies
View Related
Sep 1, 2010
In the last day or so Gmail has intermittently stopped pushing to my EVO. I can hit refresh and the mail appears. All settings are correct, background data, auto-sync and the Gmail account are all checked.
View 4 Replies
View Related
Jul 9, 2009
Just got my Magic today (Rogers) and things went pretty smoothly. Phone unlocked fine, AT&T's APN entered correctly, web browsing is good, Exchange is up and running, etc. But, I am having a problem dialing outbound calls, it is only working intermittently. I'm in a known good service area (5 bars) and have strong signal. Half the time I try to make an outbound call, it fails after about 5 seconds of just sitting there and saying "dialing" - it just craps-out and I get the fast busy signal and a "called failed" message. I try again - same thing. Every once and a while it will go through - and then the cycle happens all over again. This isn't happening in any of my other devices. Could there be a setting in the "phone" area that I have to tweak or something? Obviously a phone that doesn't make calls consistently is no good to me!
View 1 Replies
View Related
Aug 23, 2010
Basically on Saturday it was raining hard where I live and I was out and about with my tattoo in my pocket. I used it a few times whilst out but made sure it didn't get too wet although I personally got drenched and the phone was in my wet trouser pocket! That evening the touch screen stopped responding completely, nothing would happen when I touched the screen at all! The directional buttons like home and menu worked however. I then took the battery out and put it back in, but still no luck, the touch screen was dead. Resigned to having to send it back to HTC, I left it switched off over night. The next morning I switched it on again and it started to work fine again!! No problems, so I thought the problem had passed.
But then a bit later in the day the same thing happened again, touch screen not responding but this time as well although I wasn't touching the screen the tattoo was pressing the touch screen button in the bottom left hand corner of the screen on its own!? So that made me think that the touch screen was indeed broken! I then performed a complete factory reset last night, and yet again after that the phone was working fine again. But then again when my alarm went off this morning, the touch screen was not responding again and the tattoo was pressing that same button again on its own, on and off. So I took the battery out again, left for a few hours, just turned it back on now and the tattoo is working fine again!
View 3 Replies
View Related
Aug 8, 2010
Loving the phone, the auto-dim works great when I pull the phone closer or away from my face. My issue is when I'm playing a ROM on my phone for an extended period of time (maybe 15 minutes), I notice that the screen either gets brighter for a few moments, or will get dimmer. The seems to happen without any warning or prompting maybe it occurs because I accidentally hit the home button, then return to the ROM and once the phone knows I'm just playing the ROM it dims to conserve battery? And when I say dim, I mean ever-so-slightly. It doesn't turn black or anything.
View 1 Replies
View Related
Aug 20, 2010
Just got my Droid X and love it so far. However, I'm having an odd bluetooth issue. I paired my DX with my Jawbone Icon, and everything worked fine, at first. However, now it seems to disconnect the jawbone arbitrarily. Strangely, the blue bluetooth indicator at the top of the DX display stays lit as though it's connected, but the earpiece becomes unable to initiate or answer calls. To resurrect the earpiece I have to turn it off, wait for the bluetooth indicator to go white, and then turn my earpiece back on. At that point, it connects and works fine for a while until it happens again. I guess it's possible there's a problem with the earpiece, but it always worked fine with my iPhone 3G.
View 11 Replies
View Related
Oct 2, 2010
My captivate turns off after a period of non use during the day. Is there a fix?
View 4 Replies
View Related
Sep 17, 2010
Have a new X on the way... and I know for certain it wasn't there when I first received it because I specifically checked for dead pixels before I started customizing everything.... it just showed up one day, no drops, nothing significant.
View 7 Replies
View Related
Jun 17, 2009
Can anyone tell me how to use oss sound in android. If tried to open '/dev/eac', it is failing.Please tell me a solution for this.
View 2 Replies
View Related
Jul 7, 2010
We are seeing some very strange results in media playback on HTC EVO devices.
In our call to MediaPlayer.create(getApplicationContext(), uri), we get failures with the following stack trace:
CODE:..................
This code works just fine for many, many thousands of other devices out there.
View 4 Replies
View Related
Nov 13, 2009
I use Android 1.5 on HTC Hero. I've a mapapp that needs GPS functionality. Sometimes when I start up the application I get the following error.I check that "Enable GPS sateliites" setting is checked. One more piece of information. Whenever I get the error, I reinstall the application, it works ok. Google Maps works fine. What is wrong with my code?
View 2 Replies
View Related