[Mono-bugs] [Bug 652296] New: crash if i try to download an image from the internet when i read the urlConnection's InputStream value

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Nov 9 04:46:59 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=652296

https://bugzilla.novell.com/show_bug.cgi?id=652296#c0


           Summary: crash if i try to download an image from the internet
                    when i read the urlConnection's InputStream value
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: PC
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mkestner at novell.com
        ReportedBy: Orlando.silva at cardmobili.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=399140)
 --> (http://bugzilla.novell.com/attachment.cgi?id=399140)
Sample that describes how to download an image from the internet that is
crashing

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7

What i'am trying to achive is download an image from an url to my device, i
searched in google for an tutorial for monodroid but without any results. So
then i searched by an tutorial for android, in general, and i found this
sample:
http://www.helloandroid.com/tutorials/how-download-fileimage-url-your-device
(in java). 

I already implemented it using monodroid, but after i run it in the emulator it
crashes, after executing the line "InputStream inputStream =
urlConnection.InputStream;".



Reproducible: Always

Steps to Reproduce:
1.Open the Solution attached.
2.Run the app.
Actual Results:  
I get the next message in the emulator: "The application
AndroidDownloadImages.AndroidDownloadImages) has stopped unexpectedly. Please
try again."

And this is the message i got in Android Device Logging:

E/AndroidRuntime( 2955): java.lang.RuntimeException: Unable to start activity
ComponentInfo{AndroidDownloadImages.AndroidDownloadImages/androidDownloadImages.Activity1}:
java.net.UnknownServiceException: Does not support writing to the input stream
E/AndroidRuntime( 2955):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
E/AndroidRuntime( 2955):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
E/AndroidRuntime( 2955):     at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
E/AndroidRuntime( 2955):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
E/AndroidRuntime( 2955):     at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2955):     at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2955):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 2955):     at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 2955):     at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2955):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2955):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 2955):     at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2955): Caused by: java.net.UnknownServiceException: Does not
support writing to the input stream
E/AndroidRuntime( 2955):     at
java.net.URLConnection.getInputStream(URLConnection.java:563)
E/AndroidRuntime( 2955):     at
androidDownloadImages.Activity1.n_onCreate(Native Method)
E/AndroidRuntime( 2955):     at
androidDownloadImages.Activity1.onCreate(Activity1.java:23)
E/AndroidRuntime( 2955):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 2955):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
E/AndroidRuntime( 2955):     ... 11 more
I/Process (   55): Sending signal. PID: 2955 SIG: 3


Expected Results:  
The app should not crash, and the bufferedInputStream's var should contain the
image stream.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list