Browser widget android local file problem

Alan alanstenhouse at hotmail.com
Thu Aug 24 09:29:51 EDT 2017


Am having a problem loading a local file that displays a Google map on the Android emulator. LC 8.1.6.

I was also having a problem with local HTML files in general, but got that going. Using the same method for a dynamically created map document, located in the specialfolderpath("documents") folder doesn't seem to work. See below for code that doesn't work followed by code that works.

1. Code that doesn't work is (using a file from the "documents" specialFolder):
---
       put specialFolderPath("documents") & slash & "MAP.html" into tMapFile
	-- tMapFile = /data/data/com.scruffmonkey.echidnaCSI/files/MAP.html   -- Why is the path /data/data/...  and not /data/app/...  as in the next example?
       if the platform contains "android" then
            set the url of widget "myMap" to tMapFile
       else
            put fileConvertToFileURL(tMapFile) into tURL
            set the url of widget "myMap" to (tURL)
       end if
---


2. While code that works is (using a file from the resources folder):
---
      put specialFolderPath("resources") & "/data/fun_facts.html" into tFile
     -- tFile = /data/app/com.scruffmonkey.echidnaCSI-2/base.apk/data/fun_facts.html
      if the platform contains "android" then
         set the url of widget "infoscroll" to (tFile)
      else
         put fileConvertToFileURL(tFile) into tURL
         set the url of widget "infoscroll" to (tURL)
      end if
---


Any ideas why there's a difference between the resources and documents specialFolderPaths?

Why does the "documents" specialFolderPath here start with /data/data/  and the resources one start with /data/app/  ??

I've also tried setting the HTMLText of the widget but that also doesn't seem to work.

Help please! :-)

cheers

Alan



More information about the Use-livecode mailing list