【问题标题】:Problems opening xyz.html from root of sdcard using webviewer component使用 webviewer 组件从 sdcard 的根目录打开 xyz.html 时出现问题
【发布时间】: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 text value 之后没有打开任何东西。保持空白。这绝对不是连接问题,因为我已经确定了 3g 连接。
  • (value)map 变量Web1.GotFile 事件中可用,并提供下载的 html 文件的路径...

标签: android html filepath android-sdcard app-inventor


【解决方案1】:

如果您的 sdcard 安装在/mnt/sdcard,那么file:///mnt/sdcard/xyz.html 是正确的。然而,许多设备将卡(外部硬件 sdcard)安装到 extsd 或 external_sd,因此路径更改为 file:///mnt/extsd/xyz.html / file:///mnt/external_sd/xyz.html 。这些设备将板载存储视为/mnt/sdcard/。同样,这些路径可能具有特定于供应商的名称,但这些是我到目前为止所看到的。检查您的 SD 卡的安装位置并发布更多信息

【讨论】:

  • 您说the filepath file:///mnt/sdcard/xyz.html displays page if opened in chrome browser,这意味着该路径是正确的...您将块放在一起的方式可能存在错误...因此,如果不发布您的块,则无法提供无需猜测即可获得更多帮助,例如您是否使用外部锚,例如file:///mnt/sdcard/xyz.html#myAnchor?这不适用于 Android 3.x/4.x 设备。
猜你喜欢
  • 2020-04-22
  • 1970-01-01
  • 1970-01-01
  • 2012-12-12
  • 1970-01-01
  • 1970-01-01
  • 2017-04-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多