Forum Discussion

donavonc's avatar
donavonc
Visitor
10 years ago

Check Network Connection before connecting Alert Box help

Hi guys, i need a small help
when my app opens, it need to check , if the roku device is connected to network connection
and then check if this site is working http://360abyss.com/ fine (site is up or down )

if both are working, connect to app
if not show "check network connection" message pop box in app.
here is my appMain.brs code, please help 🙂
Sub Main()

'initialize theme attributes like titles, logos and overhang color
initTheme()

'prepare the screen for display and get ready to begin
screen=preShowHomeScreen("Register", "")
if screen=invalid then
print "unexpected error in preShowHomeScreen"
return
end if


'register screen, check if linked if not show register screen, if yes connect to newhomescreen
screenFacade = CreateObject("roPosterScreen")
screenFacade.show()

doRegistration()

if isLinked()
newhomescreen()
end if

End Sub


'*************************************************************
'** Set the configurable theme attributes for the application
'**
'** Configure the custom overhang and Logo attributes
'** Theme attributes affect the branding of the application
'** and are artwork, colors and offsets specific to the app
'*************************************************************

Sub initTheme()

app = CreateObject("roAppManager")
theme = CreateObject("roAssociativeArray")

theme.OverhangOffsetSD_X = "72"
theme.OverhangOffsetSD_Y = "31"
theme.OverhangSliceSD = "pkg:/images/Overhang_Background_SD.png"
theme.OverhangLogoSD = "pkg:/images/Overhang_Logo_SD.png"

theme.OverhangOffsetHD_X = "125"
theme.OverhangOffsetHD_Y = "35"
theme.OverhangSliceHD = "pkg:/images/Overhang_Background_HD.png"
theme.OverhangLogoHD = "pkg:/images/Overhang_Logo_HD.png"

app.SetTheme(theme)

End Sub


11 Replies