Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
phloide
Visitor

Newbie needing help

I am a programmer, but I am also autistic, and I have a lot of problem "starting" something using "documentation". I know it sounds like handholding, but if I have a channel i want to start, what are the step-by step (I understand bullet points well). I have built a channel on the Roku interfact, but need some help with what the "Application Package" is. Is this a program I need to write, or is this an oop that i am supposed to download and adjust? I figure i need to grab a cloud account of some sort to host my material, and then insert the links, but its just the "getting it started" thing i am having issues with.

Basically, I am wanting to do a simple special interest subscription channel. I don't need anything fancy at first - it's going to be one of those "either you want it or you don't" channels... I am mostly in the PHP/PERL/SQL world, but I am pretty adaptable to picking up new languages - but mostly by manipulating examples.

I really appriciate any assistance
0 Kudos
4 REPLIES 4
squirreltown
Roku Guru

Re: Newbie needing help

"phloide" wrote:
I am pretty adaptable to picking up new languages - but mostly by manipulating examples.

Thats a good thing, because there are really no tutorials, and unlike PHP, where you can find an answer easily with Google, the only place to get answers is this developer board. The people here are friendly and want to help you, you just have to have some idea of what you are asking. Tearing apart existing example channels is the way to learn.

If you havn't already, download the Software Developers Kit (SDK). Read Chapter 7.1 and 7.2 in the DeveloperGuide.pdf and Chapter 3.1 and 3.2 in ChannelPackagingAndPublishing.pdf . These explain how to get a channel you are working on or one of the SDK examples into your Roku box and then how to make an application package.

Application Package - You take your source code text files (.brs) and images and zip them together. Then you use your web browser to send that zip file to the Roku box to test the channel. If its the way you want, you then use the browser again to download the channel From the Roku back to your computer as a package (.pkg) file. This is your application package (your channel) that you will then upload to Roku with your developer account to make a private channel.

the bullet points for all this would be:

• register as a developer at http://www.roku.com/developer

• Download the Software Deveplopers Kit (SDK)

• Read Chapter 7.1 and 7.2 in the DeveloperGuide.pdf and Chapter 3.1 and 3.2 in ChannelPackagingAndPublishing.pdf and do what it says there.

Good Luck.
Kinetics Screensavers
0 Kudos
RokuJoel
Binge Watcher

Re: Newbie needing help

Well, I can't go into a full step by step here, but:

Generally speaking, you start with a Sub Main:

Sub main()


you create a screen:

screen=createobject("roPosterScreen")


the items you see on a screen, which represent media items are built on type roAssociativeArray, a simple example:

item={Title:"A Movie"
ShortDescriptionLIne1:"Actors doing stuff on Film"
ShortDescriptionLIne2:"filmed in HD"
hdPosterURL:"http://www.mywebsite.com/AMovie/HDimage.jpg"
sdPosterURL:"http://www.mywebsite.com/AMovie/SDimage.jpg"}


Multiple associative arrays are pushed into an Array:

mediaarray=[item,item,item]


The content is loaded into the screen:

screen.setContentList(mediaarray)


and then you show the screen:

screen.show()


typically, you want to create a message port, so you can listen for input from the user, and assign that port to the screen:

port=createobject("roMessagePort")
screen.setMessagePort(port)


A while loop and if/then statements are used to listen for and respond to messages on the port:

While True
msg=wait(0,port)
if type(msg)="roPosterScreenEvent" then
ndx=msg.getindex()
if msg.isListItemSelected() then
print " you clicked on ";mediaarray[ndx]
else if msg.isScreenClosed() then
return
end if
end if
end while


and you need to close your Sub Main() with an End Sub.

executable code is stored in the source folder in a project and the files must end in .brs

The name of the source files don't matter except as human reference points to the content of the files. A complete program could look like this:


Sub main()
screen=createobject("roPosterScreen")

item={Title:"A Movie"
ShortDescriptionLIne1:"Actors doing stuff on Film"
ShortDescriptionLIne2:"filmed in HD"
hdPosterURL:"http://www.mywebsite.com/AMovie/HDimage.jpg"
sdPosterURL:"http://www.mywebsite.com/AMovie/SDimage.jpg"}

mediaarray=[item,item,item]
screen.setContentList(mediaarray)
screen.show()
port=createobject("roMessagePort")
screen.setMessagePort(port)

While True
msg=wait(0,port)
if type(msg)="roPosterScreenEvent" then
ndx=msg.getindex()
if msg.isListItemSelected() then
print " you clicked on ";mediaarray[ndx]
else if msg.isScreenClosed() then
return
end if
end if
end while
End Sub


I suggest you open an example like simpleposter in the SDK, open the .brs file in the source folder and erase everything inside it, and use it as a testbed for experimenting with Brightscript programming, for example, you could paste the above code in and see what happens when you load it onto your device and run it.

- Joel
0 Kudos
phloide
Visitor

Re: Newbie needing help

the lack of commas between elements on the objects is going to drive me nuts...its against my religion to have elements of an object seperated by enter or space... need that comma,,,,,,,,,,
0 Kudos
TheEndless
Channel Surfer

Re: Newbie needing help

"phloide" wrote:
the lack of commas between elements on the objects is going to drive me nuts...its against my religion to have elements of an object seperated by enter or space... need that comma,,,,,,,,,,

You are welcome to use commas. In fact, you have to if you put more than one element on a single line. They're optional if you separate the elements with a line break.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.