The Source for Java Technology Collaboration
User: Password:



Tim Boudreau

Tim Boudreau's Blog

How to start writing apps for TiVO in NetBeans, in 5 minutes or less

Posted by timboudreau on February 04, 2005 at 01:07 PM | Comments (4)

The TiVO folks have a Java SDK for writing applications that run on a TiVO (well actually the code runs on the server, and the visualization happens on the user's TV), along with a simulator that lets you run and debug applications on your computer. Here's how to very simply set up NetBeans to run/debug TiVO applications.

These instructions are for a current NetBeans 4.1 development build, but the process is very similar for NetBeans 4.0.

First, you will need to download the TiVO SDK , and unpack it to, e.g., /tivo

Now, in NetBeans:

  1. Select File | New Project to open the New Project Wizard.
  2. Select the General category in the left-hand pane, and Java Application in the right-hand pane, and press Next . On the next pane of the wizard name the project TivoTest , and press Finish to create the project.
  3. Right click the TivoTest node in the Projects tab of the Explorer window (to the left of the editor) and choose Properties from the popup menu that appears, to show the Project Properties dialog.
  4. Select the Build | Compiling Sources node in the left-hand pane of that dialog, and Click the Add Library button on the right. This displays a list of libraries NetBeans already knows about. If this is the first time you've used the TiVO SDK, you'll need to set it up as a library; otherwise, steps 5 through 7 can be skipped.
  5. Click the Manage Libraries button in this dialog. In the next dialog, click New Library at the bottom left. In the New Library dialog, type Tivo and press enter to close the dialog.
  6. The Library Manager dialog will now show a new library on the left called Tivo, with no contents. Click the Add Jar/Folder button on the left. In the file dialog that appears, navigate to wherever you unpacked the TiVO SDK. Select hme.jar and simulator.jar , and press the Add JAR/Folder button at the bottom of the file dialog to accept them.
  7. Now switch to the Sources tab, and click its Add JAR/Folder button, and add src.zip , so javadoc comments will be visible with code completion for the TiVO SDK classes. Future projects can simply be pointed at the library which you have just created.
  8. Click the Add Library at the bottom of the Add Library dialog button to add the new TiVO library to your project. Click OK to close the Project Properties dialog.
  9. Now that all the dialogs are closed, you should be looking at the Main class that was generated by the New Project Wizard. Change the superclass to be Application . Press Alt-Shift-F (Ctrl-Shift-F on Macintosh) to auto-import com.tivo.hme.sdk.Application , the superclass.
  10. Insert the following code into the Main class (don't delete the main (String[] args) method!):
        protected void init(Context context) {
            root.setResource(createText("default-36-bold.font",
                Color.white, "Hello from an application!"));
        }
    
  11. Now just insert the following line in the existing main (String[] args) method:
        Simulator.main(new String[] {Main.class.getName()});
    
Press F6 to run the app, press F5 to debug it.

For anybody interested, they appear to be running a developer contest .

Now if there were just something on TV aside from plastic surgery, car makeovers and Law and Order...is it just me or did American television go completely insane over the five years I was living overseas?


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • > is it just me or did American television go completely insane over the five years I was living overseas?

    I don't think all of American television, but for the US, you're definitely right!

    Like you, I think having an SDK for the TiVO is conceptually quite cool. Yet while I think it makes the value proposition for TiVO go up, the abysmal quality of US television still negates it.

    I think I will stick to J2ME experimenting with PDAs.
    (hint: an entry on that would be super cool!)

    John

    Posted by: cajo on February 06, 2005 at 10:13 AM

  • it is a waste of time looking for any good information in an american television set (irrespective of the number of channels). it is a real shame but you have to let go, i guess. maybe that is one of the reasons for the success of the internet?

    Posted by: eitan on February 09, 2005 at 07:56 AM

  • Tivo has opened huge can of worms with this one.
    Imagine what this is going to look like when the ability to display Java applications on your TV screen is combined with superb Java networking capabilities.
    On the "useful" end, imagine sending your parents a link to web-startable application which will be able to show pics of their grandkids on their living room TV.
    On the other end, imagine the world where image sharing (of ALL kinds of images) comes to your TV.
    Especially when they add the abilitiy to play the video stream on Tivo. That plus BitTorent client bootstrapped via JXTA app (to avoid censorship) will end the media world as we know it.

    Posted by: mgarber on February 09, 2005 at 01:18 PM

  • As others have pointed out, ending the midia world as we know it wouldn't be an entirely bad thing.

    Seriously--cool project. I don't watch TV, but I'm tempted to buy a tivo just to hack it.

    Posted by: mikel on February 09, 2005 at 03:17 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds