当前页面: 开发资料首页 → Netbeans 专题 → Developing Applications for TiVo in NetBeans
摘要: 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
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:
TivoTest
, and press
Finish to create the project.
Tivo
and press enter
to close the dialog.
doc
directory, so Javadoc comments will be visible for TiVo SDK classes
Future projects can simply be pointed at the library which
you have just created.
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.
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!")); }
main (String[] args)
method:
Simulator.main(new String[] {Main.class.getName()});Your complete class should look as follows:
/* * Main.java * * Created on March 22, 2005, 2:46 PM */ package tivotest; import com.tivo.hme.sdk.Application; import com.tivo.hme.sim.Simulator; import java.awt.Color; /** * * @author Brian Leonard */ public class Main extends Application { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) { Simulator.main(new String[] {Main.class.getName()}); } protected void init(Context context) { root.setResource(createText("default-36-bold.font", Color.white, "Hello from an application!")); } }
For anybody interested, they appear to be running a contest.