Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6446] Android: Titanium.Network.HTTPClient.send - V8/Rhino - Android 2.x - send() loads text instead of image

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-27T20:39:26.000+0000
Affected Version/sRelease 1.6.2, Release 1.7.2, Release 1.7.3, Release 1.7.5, Release 1.8.0.1, Release 2.1.2, Release 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-20 API, 2012 Sprint 20
ComponentsAndroid
Labelsapi, qe-and082012
ReporterDustin Hyde
AssigneePing Wang
Created2011-12-02T18:10:53.000+0000
Updated2012-12-05T22:28:36.000+0000

Description

Titanium.Network.HTTPClient.send loads text instead of image (log and screenshot attached). Bug specific to Android 2.x. Behavior not found in iOS or Android 3.x. Steps to Reproduce: 1. Run KitchenSink (or KitchenSink-Nook if using the NookColor to have a valid test configuration). 2. Go to Platform > XHR > File Download. 3. Click "Set Web View (Data)". Expected Result: Image should display. Actual Result: Text displays (screenshot attached). Errors log (attached).

Attachments

FileDateSize
device-2011-12-02-175321.png2011-12-02T18:10:53.000+0000124734
log.txt2011-12-02T18:10:53.000+00004019

Comments

  1. Evgenii Tcarev 2012-08-22

    Occurs on: Titanium Studio, build: 2.1.2.201208201549 SDK version: 2.1.2.v20120821160113 Devices: Motorola Droid (2.2.3)
  2. Karl Rowley 2012-09-12

    There's a URL in this code that is no longer valid: GET','http://www.appcelerator.com/wp-content/themes/appcelerator/img/a-logo.png In this case, the HTTP server returns a web page that includes some "404" text. If I replace the invalid URL with a valid one here, it works as expected: ttp://codedog.net/wp-content/uploads/2011/09/appcelerator.png This is the same issue as for other tickets with invalid URL's.
  3. Ping Wang 2012-09-18

    On Android, webview.setData(TiBlob data) only works for html-string. It does not work for binary data, eg. image. This is a native Android behavior. In the Android [doc](http://developer.android.com/reference/android/webkit/WebView.html#loadData(java.lang.String, java.lang.String, java.lang.String)), it points out: {quote} The 'data' scheme URL formed by this method uses the default US-ASCII charset. If you need need to set a different charset, you should form a 'data' scheme URL which explicitly specifies a charset parameter in the mediatype portion of the URL and call loadUrl(String) instead. {quote} And there are several related discussion: http://code.google.com/p/android/issues/detail?id=596 http://stackoverflow.com/questions/5267124/how-to-display-image-with-webview-loaddata Will modify the KS test. PR https://github.com/appcelerator-developer-relations/KitchenSink/pull/34
  4. Tamila Smolich 2012-12-05

    Closing as fixed. Tested on: Titanium Studio, build: 3.0.0.201211301903 Titanium SDK, build: 3.0.0.v20121204181658 Devices: HTC Nexus One (2.2.2)

JSON Source