Android Can't Find Path to Web folder

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Android Can't Find Path to Web folder

Mike Bonner via use-livecode
I give up! What is the magic that gets the browser widget on Android to see a local html file

(it always works in iOS)

given the following directory layout

myApp.livecode # the standalone is built from this
      /module
           lexicon.livecode  # with nothing but a browser widget which points too:
                /web
                    index.html

if have tried all manner of:

hard coded:

     set the itemdel to "/"
     get item 1 to -2 of the effective filename of this stack
     put it & "/web/index.html" into tURL
     set the URL of widget "Browser" to ("file://" & tURL)

# this works on iOS but not on Android

# Various incarnations of

if isMobile() then
     # this work on iOS
     # but not on Android
   
  put specialFolderPath("engine") into tRoot
  set the URL of widget "Browser" to ( "file://" &tRoot & "/modules/lexicon/web/index.html")

else
     # works on desktop

    put specialFolderPath("resources") into tRoot    
    set the URL of widget "Browser" to ( "file://" &tRoot & "/web/index.html")
end if

??

BR




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

RE: Android Can't Find Path to Web folder

Mike Bonner via use-livecode
BR,

I do it and use the same path for both mobile platforms. The only thing I
can think of is that I move the html folder tree to a folder in "the
documents folder". I also zip it up for brevity in the package. When the app
starts the first time(or app update) I unzip it to the documents folder. I
delete the tree before unzipping for an app update. If you need the LCS of
the un-zipper or folder tree deleter let me know.

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]


-----Original Message-----
From: use-livecode [mailto:[hidden email]] On Behalf
Of Sannyasin Brahmanathaswami via use-livecode
Sent: Saturday, April 07, 2018 11:08 PM
To: How LiveCode
Cc: Sannyasin Brahmanathaswami
Subject: Android Can't Find Path to Web folder

I give up! What is the magic that gets the browser widget on Android to see
a local html file

(it always works in iOS)

given the following directory layout

myApp.livecode # the standalone is built from this
      /module
           lexicon.livecode  # with nothing but a browser widget which
points too:
                /web
                    index.html

if have tried all manner of:

hard coded:

     set the itemdel to "/"
     get item 1 to -2 of the effective filename of this stack
     put it & "/web/index.html" into tURL
     set the URL of widget "Browser" to ("file://" & tURL)

# this works on iOS but not on Android

# Various incarnations of

if isMobile() then
     # this work on iOS
     # but not on Android
   
  put specialFolderPath("engine") into tRoot
  set the URL of widget "Browser" to ( "file://" &tRoot &
"/modules/lexicon/web/index.html")

else
     # works on desktop

    put specialFolderPath("resources") into tRoot    
    set the URL of widget "Browser" to ( "file://" &tRoot &
"/web/index.html") end if

??

BR




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Android Can't Find Path to Web folder

Mike Bonner via use-livecode
In reply to this post by Mike Bonner via use-livecode
I find that on Android you don't use the "file:" prefix - try:

set the url of widget "about" to (specialFolderPath("resources") & "/web/index.html")

HTH

cheers

Alan

> On 8 Apr 2018, at 7:30 pm, Sannyasin Brahmanathaswami <[hidden email]> wrote:
>
> I give up! What is the magic that gets the browser widget on Android to see a local html file
>
> (it always works in iOS)
>
> given the following directory layout
>
> myApp.livecode # the standalone is built from this
>      /module
>           lexicon.livecode  # with nothing but a browser widget which points too:
>                /web
>                    index.html
>
> if have tried all manner of:
>
> hard coded:
>
>     set the itemdel to "/"
>     get item 1 to -2 of the effective filename of this stack
>     put it & "/web/index.html" into tURL
>     set the URL of widget "Browser" to ("file://" & tURL)
>
> # this works on iOS but not on Android
>
> # Various incarnations of
>
> if isMobile() then
>     # this work on iOS
>     # but not on Android
>
>  put specialFolderPath("engine") into tRoot
>  set the URL of widget "Browser" to ( "file://" &tRoot & "/modules/lexicon/web/index.html")
>
> else
>     # works on desktop
>
>    put specialFolderPath("resources") into tRoot    
>    set the URL of widget "Browser" to ( "file://" &tRoot & "/web/index.html")
> end if
>
> ??
>
> BR


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Android Can't Find Path to Web folder

Mike Bonner via use-livecode
This worked both iOS/Android

There was no need to copy from when web tree to documents folder.

The keys were:

1) no "file://"

2) on desktop the "resources" is the one with "lexicon.livecode"  which is relative the "/web" in the same directory.
But it still requires slash… in web environment slash wouldn't work, but here it's needed.
Because it building an absolute path from $HOME

3) on mobile this, the full path from the Standalone executable is required.


=========
on preOpenCard
   set the rect of widget "Browser" of me to the rect of this card
     # response web app…. automatically fit any screen.
 
   if isMobile() then 4

      set the url of widget "Browser" to (specialFolderPath("resources") & "/modules/lexicon/web/index.html")
 
     else
 
     # desktop

      set the url of widget "Browser" to (specialFolderPath("resources") & "/web/index.html")
 
     end if

end preOpenCard
========


On 4/8/18, 12:28 AM, "Alan" <[hidden email]> wrote:

    I find that on Android you don't use the "file:" prefix - try:
   
    set the url of widget "about" to (specialFolderPath("resources") & "/web/index.html")
   
    HTH
   
    cheers
   
    Alan

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode