【发布时间】:2013-06-30 10:35:56
【问题描述】:
我创建了一个应用程序,它在启动时将文件 (xyz.html) 下载到 sdcard 的根目录中。
我尝试使用以下文件路径:
file:///mnt/sdcard/xyz.html -> works in Google chrome on Nexus 4
file://mnt/sdcard/xyz.html
file://xyz.html
file:///android_asset/xyz.html -> did not work
但所发生的只是“网页不可用”。 需要帮忙。 从 sdcard(sdcard 的根目录)查看/访问文件的正确文件路径格式是什么?
块:
screen1.initialize
if else test- 全局 d = 空? 然后 web1.goToUrl>dropbox.com/.....(文件被下载) web1.GET 别的 webviewer1.goToUrl>file:///mnt/sdcard/xyz.html .w2 .w3 .w4 webviewer5.goToUrl>文件///mnt..
web1.gotFile
webviewer1.goToUrl...(同上)
btnShow.clicked
将 webviewer1,2,3,4,5.visible 设置为 TRUE
btnHide.clicked
将 webviewer1,2..5.visible 设置为 FALSE tinydb1.storeValue [标签:标题] [要存储的值:webviewer1.CurrentPageTitle] 将 label1.text 设置为> tinydb1.getValue [tag: title]
【问题讨论】:
-
文件路径 file:///mnt/sdcard/xyz.html 如果在 chrome 浏览器 (Nexus 4) 中打开会显示页面
-
您的文件路径
file:///mnt/sdcard/xyz.html是正确的。发布块的相关部分。 -
所以有 5 个 webviewer 显示相同的 html 文件?尝试先运行一个 webviewer 并在 Web1.GotFile:
mapViewer1.GoToUrl=(value)map中进行修改。您将在定义中找到的 (value)map 块 -
Failure.. url 作为直接值打开 /storgae.../map.html 并且在这种情况下网页不可用。在第二种情况下,
file://join textvalue之后没有打开任何东西。保持空白。这绝对不是连接问题,因为我已经确定了 3g 连接。 -
(value)map 变量仅在 Web1.GotFile 事件中可用,并提供下载的 html 文件的路径...
标签: android html filepath android-sdcard app-inventor