Android :: HttpsURLConnection.getInputStream Hangs

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.

Android :: httpsURLConnection.getInputStream hangs


Android :: HttpsUrlConnection Problem

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

Android :: Problem With HttpsURLConnection

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

Android :: ClassCastException With HttpsURLConnection

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

Android :: Query About The Usage Of HttpsURLConnection

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

Android :: HttpsURLConnection And Intermittent Connections

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

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 View Related

Android :: HttpsURLConnection Connection Problems

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

Android :: Sending Huge Files With HttpsUrlConnection

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

Android :: HttpsUrlConnection And OpenSSL Freeing Session

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

Android :: HttpsURLConnection Returns -1 Code On Second Request

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

Android :: Every Second HttpsUrlConnection Request Of My Static Method Fails

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

Android :: UI Thread Which Hangs Up?

Nov 16, 2010

I have to draw list of 30 articles. I tired using list view but there was some problem as I wanted to user alternate colors like first is white and 2nd is blue where as again 3rd is white and 4th is blue and it goes on..

So I decided to have scrollview and table into it. I set the view using setcontentview which shows loading dialog. then in aysnc task's "doInBackground" method i fetch all articles into the object and then in "onPostExecute" I run a for loop on the object and in each loop i make table row insert article and then insert row into table. and then dismiss loading dialog box.

As i have tabular view in my app and If i remove loading dialog box. While the UI is rendered if someone clicks on other tab. UI is hanged up, After loading all table rows It goes to other tab.

Even after using asynctask why this happens ?

View 10 Replies View Related

Android :: Phone Hangs On Startup Screen

Jun 3, 2010

I'm using a Drioid Eris version 2.1. When I turn on my phone it stays on the starting screen (the androids on skateboards) and won't go to the next one. I think it may have happened after I updated my SD Card Reader app because that's the only thing I can think of that caused this problem, thought it might be something else. How do I fix this?

View 5 Replies View Related

Android :: Hangs On Launching Unit Tests

Oct 3, 2009

I got a problem launching unit tests. I did: * new android project in eclipse, new android test project in eclipse * added one test case, added one test suite * run as-> android junit test hangs on "Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5556".I got eclipse galileo, newest ADT and android 1.6 sdk

View 5 Replies View Related

Android :: Market Upload APK File Hangs

Sep 8, 2010

I've been trying to upload an APK file to the Android Market for a few days, and the upload process hangs with the spinning icon just rotating. I've let the upload run overnight and it still hangs.

1) The APK file is 28 MB

2) I've uploaded an APK file to the Android market before and it is now for sale.

Is there a way to find out what the error is?

View 2 Replies View Related

Android :: How To Debug An Application That Hangs After Awhile

Oct 22, 2010

I've built my first Android application and it works pretty well, except that it hangs/freezes up when it's left running for several hours.

It doesn't always do this - it's inconsistent.

This is an awful question to ask, it's so broad, but how should I go about troubleshooting this problem?

My guess is that I'm not managing my exceptions well and something's happening that I'm not dealing with effectively.

Is there a good resource of information on testing and debugging Android/Java applications like a Web site or a book?

I'm just looking for someone to shove me in the right direction.

View 4 Replies View Related

Android :: 320 Kbps Mp3 Hangs Device/player

May 26, 2010

Anyone having problems. I tried in the browser and it hangs as well, so not convinced it is my use of the MediaPlayer, which hangs passing it a 320 kpbs mp3.

http://hellovegetables.com/music/HV692%20Krazy%20Baldhead%20-%20The%2...

Happens in Android 2.1

View 3 Replies View Related

Android :: System Hangs While Giving Build

Feb 10, 2010

I am giving product build in Android 1.6 in Ubuntu using make. First time it is fine. But next time onwards if I try to build it again without cleaning it, the system hangs after some time. Even if I try remove the out folder to clean, the system hangs. So every time a fresh build takes too much time. Did anyone face this issue? I am using 1 GB RAM, 1 GB swap space and 40 GB linux space(65% space is free).

View 5 Replies View Related

Android :: Menu Option Starts Thread - Hangs

Mar 12, 2009

I am developing a game based on the SurfaceView/LunarLander example in the sample code. I have one activity, with one menu option that is "new game". My activity listens for the menu selection, and once new game is selected, doStart of the Game thread is called. The game starts up after 3-4 seconds, but the menu option sticks around on the screen until the game has started. I think the main thread is waiting on the doStart to do its thing, but since it's creating a new thread, how do I get it to just start the thread and continue its business of hiding the menu option right away, instead of after 3 seconds?

View 6 Replies View Related

Android :: SDK And AVD Manager Hangs When Rename Temporary Folders

Jan 28, 2010

I run Android SDK and AVD Manager in Vista and have problems installing components. The installer downloads components successfully, but at the end of the installation it hangs for about minute and then asks to disable AV software. If I choose 'No', the installer stops with error message like: "Filed to rename directory '...' to '...' ". Thus, I have to unpack downloaded components and place them to proper folders manually. I have no AV software.

View 1 Replies View Related

Android :: Application Hangs Or Collapses On Submitting Data In The Sign Up

Jun 10, 2010

below is the code of a sign up form, when we CLICK second time to submit the entered details, the application collapses and hags just displaying the dialog_thread....On executing very first time it rum perfectly. The code of dialog_thread is given after onClick(). how to get rid of this problem and let the application run smoothly.

public void onClick(View arg0)
{// TODO Auto-generated method stub
alert_dialog ad=new alert_dialog();
try
{
if(arg0==signup)..................

View 1 Replies View Related

Android :: Getting Result Of Executed Shell Command Fails / Hangs

Sep 15, 2010

I try to execute shell commands, this does work as it should. Even the result comes back (as is see on LogCat). The problem ist the last line of the result. Every time a readLine() on the last line occurs (which shouldn't occur, temp should be null), the app hangs forever and doesn't come back from the readLine call. Maybe you find the error. I tried readUTF and standart read(), all the same problem. And yes, the app got su-rights.

try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
DataInputStream osRes = new DataInputStream(process.getInputStream());
for (String single : commands) { os.writeBytes(single + " ");
os.flush(); String temp = new String();
while( (temp = osRes.readLine()) != null) { Log.v("NITRO", temp);
result2 += temp + " ";
} } os.writeBytes("exit");
os.flush(); process.waitFor();
} catch (IOException e) { Toast.makeText(Main.this, "Error", Toast.LENGTH_LONG);
} catch (InterruptedException e){ Toast.makeText(Main.this, "Error", Toast.LENGTH_LONG);
}

That is the StackTrace where it hangs when I stop debugger when hanging:

OSFileSystem.readImpl(int, byte[], int, int) line: not available [native method]
OSFileSystem.read(int, byte[], int, int) line: 118
ProcessManager$ProcessInputStream(FileInputStream).read(byte[], int, int) line: 312
ProcessManager$ProcessInputStream(FileInputStream).read() line: 250
DataInputStream.readLine() line: 309
Main$2$1.run() line: 84
ViewRoot(Handler).handleCallback(Message) line: 587
ViewRoot(Handler).dispatchMessage(Message) line: 92
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4627
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 868
ZygoteInit.main(String[]) line: 626
NativeStart.main(String[]) line: not available [native method]

View 1 Replies View Related

Android :: Moto Droid Camera Hangs EVERY Time OnTakePicture

Jan 7, 2010

All, I've googled over and over again to find a solution and while I found a bug regarding camera release, etc I can not for the life of me seem to get the cam code to work. Every time I executed takePicture the system simply hangs, sometimes it calls the PictureCallback, but most of the time it simply hangs.Weird issues about not being able to read /data/ap_gain.bin files, etc

View 1 Replies View Related

Android :: Camera Still Regularly Hangs With Cupcake / Requiring Power Cycle

May 1, 2009

I found that the old bug reported in http://code.google.com/p/android/issues/detail?id=1578 where only a power cycle brings back the camera still persists with the official Cupcake firmware on my ADP. When it happens - and I've encountered it several times in a few days now - no camera application can access the camera. A power cycle is needed to recover from this locked camera state.

View 8 Replies View Related

HTC EVO 4G :: FM Radio App Hangs Up While Tuning?

Jul 13, 2010

At my desk, my 5th gen Ipod Nano's scan function finds 24 perfectly clear stations. The Evo's scan finds NO stations. If I manually tune the stations found by the ipod on the Evo, I can find 9 out of the 24 with acceptable reception. And, the radio app occasionally hangs up while tuning, and must be restarted before it works again. Do I have a defective unit with respect to FM radio, or are they all like this? (not a big deal, since I didn't even know it had FM when I bought it, and I still have the ipod for this purpose.

View 35 Replies View Related

HTC Desire :: Hangs Up During Calls?

Jul 5, 2010

Hello, I recently got a HTC Desire and I've experienced that it often hangs up on the person I'm talking to because my ear touches some button on the display. I've tried turning on the screen lock, and that works sometimes but not always, so I would like to find a permanent solution.

View 1 Replies View Related

Android :: System Hangs And Video Playback Not Smooth After Froyo Manual Update

Aug 11, 2010

I did the manual Froyo update on my Moto Droid couple of days ago after following instructions on a reliable forum. However, I have been having problems like system hangs and video playback not smooth like before. I wanted to get back to my original 2.1 firmware and wait for the OTA update instead. Is there any way I can switch back to the old firmware update of 2.1?

View 12 Replies View Related

HTC Desire :: Phone Hangs On Shutdown

Oct 21, 2010

im not sure why or what ive done but when i try and shut the phone down it just hangs at the "shutting down" screen for hours. it went 4 hours lastnight without shutting off. the only way to get it to stop is to pull the batt or it sometimes works to plug it into the computer with the usb cable. ive also noticed that mixzing wont read the sd card, keeps saying memory card is unavailible. could it be the same thing in both cases? the memory card is having issues? ive only had the phone for 2 weeks. i can save to and read from the card when mounted as a disc drive and i can shoot and save pics and videos as well as double twist reading from the card just fine. is there something im missing? this is driving me nuts im on telus, android 2.1, not rooted or modified in any way.

View 6 Replies View Related

HTC EVO 4G :: Phone Hangs Up - Way To Turn Off The Sensor?

Jul 22, 2010

My wife and i both have the EVO and for some reason she is always hanging up on people. is there any way to turn off the sensor so that when the phone is takin away from your face it doesnt light up the end call button?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved