berlog / androzic

Automatically exported from code.google.com/p/androzic
0 stars 0 forks source link

Waypoint description html links to files on SD card #230

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is an opportunity for improvement...

What version of the product are you using?
1.4.2

Android version:
2.3.4 (HTC Desire HD)

Problem is: When I write html description for waypoint and try to link images 
from SD card, images are not shown in waypoint info window after save.

example:
as a part of html description I wrote:

<img width=250 src="file:///sdcard/Androzic/img/image.jpg" />

Nothing is shown in waypoint info window, while the location 

"file:///sdcard/Androzic/img/image.jpg" is valid and may be opened in webkit 
browser successfully.

Some time ago (can't say for sure in which version) the following link s in 
html worked well:

<img width=250 
src="content://com.android.htmlfileprovider/sdcard/Androzic/img/image.jpg" />

but they does not in current version.

It would be nice to have ability to link images from SD card in waypoint 
description and maybe even to have built-in androzic feature to connect images 
to waypoint :).

Small hint:
May be the reason 'file://...' urls does not work is that it is necessary to 
allow android WebView to load local files e.g.

description.getSettings().setAllowFileAccess(true);
description.loadData("<?xml version=\"1.0\" encoding=\"UTF-8\" 
?>"+waypoint.description, "text/html", "UTF-8");

this piece of code may be applied to com/androzic/waypoint/WaypointInfo.java 
file line 95

Does this have sense?
Thanks.

Original issue reported on code.google.com by thev...@gmail.com on 23 Feb 2012 at 5:24

GoogleCodeExporter commented 8 years ago

Original comment by novikov on 29 Feb 2012 at 7:45