I have successfully deployed the following livecode script on an android...
Code: Select all
global gRCBrowser, gCard
local sBrowserId
on preopencard
resizeStack
# quit if we are not on a mobile device
-- if the environment is not "mobile" then
-- exit preOpenCard
-- end if
if the environment is "mobile" then
# create the browser
mobileControlCreate "browser"
put the result into sBrowserId
# set up the basic defaults
mobileControlSet sBrowserId, "rect", the rect of group "rcBrowser"
mobileControlSet sBrowserId, "visible", "true"
mobileControlSet sBrowserId, "url", gRCBrowser
mobileControlSet sBrowserId, "autofit", true
put gRCBrowser into field "devURL"
end if
end preopencard
on resizeStack
layoutControls
end resizeStack
on layoutControls
set the width of graphic "navbar" to the width of this card
set the height of graphic "navbar" to round(the width of graphic "navbar" * .1)
set the loc of graphic "navbar" to the loc of this card
set the top of graphic "navbar" to the top of this card
set the width of image "navBack" to round(the height of graphic "navbar" * .75)
set the height of image "navBack" to round(the height of graphic "navbar" * .75)
set the width of image "navBackDown" to round(the height of graphic "navbar" * .75)
set the height of image "navBackDown" to round(the height of graphic "navbar" * .75)
set the width of button "btnBack" to the height of graphic "navBar"
set the height of button "btnBack" to the height of graphic "navbar"
set the topLeft of button "btnBack" to the topLeft of graphic "navBar"
set the icon of button "btnBack" to the id of image "navBack"
set the hiliteIcon of button "btnBack" to the id of image "navBackDown"
set the left of button "btnBack" to the left of field "devUrl"
set the width of graphic "bottomBar" to the width of this card
set the height of graphic "bottomBar" to round(the width of graphic "navbar" * .10)
set the loc of graphic "bottomBar" to the loc of this card
set the bottom of graphic "bottomBar" to the bottom of this card
set the width of graphic "sponsorBar" to the width of this card
set the height of graphic "sponsorBar" to round(the width of graphic "navbar" * .10)
set the loc of graphic "sponsorBar" to the loc of this card
set the bottom of graphic "sponsorBar" to the bottom of this card
set the width of graphic "Rectangle" to the width of this card
set the width of group "rcBrowser" to the width of this card
set the height of group "rcBrowser" to the height of this card - (the height of graphic "navbar"+the height of graphic "bottomBar")
set the loc of group "rcBrowser" to the loc of this card
set the top of group "rcBrowser" to the bottom of graphic "navbar"
mobileControlSet sBrowserId, "rect", the rect of group "rcBrowser"
end layoutControls
on closeCard
if the environment is not "mobile" then
exit closeCard
end if
# destroy the browser we created
mobileControlDelete sBrowserId
end closeCard
Thanks