As a developer, I naturally ask myself "what would it take to build one of these apps?" When I first looked, the answer seemed to be "send us a lot of money and buy a special development machine and we'll see". Sorry, but I'm not that interested. (Apologies if I misunderstood and this was never the policy).
But having just moved house, cut the cord and now being completely dependent on streaming services, the incentive to understand it has gone up a notch. A roku device is - or can be - a pleasure to use, whereas controlling a television from a computer can be a lot of hassle - even with a remote. Moreover, as we are now in a smaller place, we only have one TV and I have a spare device to play with!
Getting Started
So I looked into this again yesterday and it would seem you can put any modern Roku device into "developer" mode, although I almost fell about laughing at the sequence you need to use on the remote in order to make it happen.But it works, just like the instructions say. After noting the IP address, I was able to create my password, reboot and connect over WiFi. (If you ever do lose the address it's available under Settings and System Information on the About tab, along with other useful information such as your model number and OS Level).
Now to try loading a sample app ... Hmm, hello world looks good. But there isn't even a README.
Digging around on the website, this article has the relevant set of instructions, so let's try that. In section 3 it has a link to the ZIP file we need, so we can download that, and see what happens.
Wow! Look at that! Greeted by my own TV!
What Else Have I Learnt?
Obviously I've done a lot more googling than I have described here and learnt a lot of things. Hopefully these next few blog posts will impart a taste of that knowledge. But for now some teasers.
It would seem that Roku devices a programmed in a proprietary language called "BrightScript". Obviously, this language is designed around making it easy, safe and secure to develop applications for Roku devices. Sadly, it looks a lot like Visual Basic with COM: the language is incredibly like the BASIC I learnt 40 years ago; and the Interface and Component model looks very much like COM.
Applications are written purely in script and then assembled into a ZIP file for sideloading or distributing. There is no separate "compile" step (although there is presumably a JIT step on the device).
It would seem the process of uploading applications can be automated rather than depending on using a web browser. The documentation references using a makefile for this purpose but presumably curl or any build tool could do the job.
Leafing quickly through the documentation, there seem to be other tools to round out the experience, such a scene designer and a profiler, but I haven't dug any deeper than that.
There are development plugins for Eclipse, Sublime and Atom, although what they do I have no idea.
There are development plugins for Eclipse, Sublime and Atom, although what they do I have no idea.
What Next?
For me, the big questions are about the development cycle:
- How easily can I incorporate this into my existing build tools?
- Can I do everything on a Mac? Or do I need to deal with some Windows box?
- How do I track down errors?
- Is there a unit testing library?
- What other tools are in the toolset and how do they work?
Contents
This is the first in a series of blog posts. The others (in order) are:
- Roku Tools
- Unpacking "Hello, World"
- Hello, Goodbye
- Playing a Video on Roku
- Debugging a Roku Application
- A Working Roku Video Player
I did not have an entirely smooth journey into the land of Roku development. While I won't burden you with all the details of everything I struggled with, I have tried to indicate the problems I ran into and how I solved them.
No comments:
Post a Comment