TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Underground Playground > Developers Corner
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 02-15-2005, 12:16 PM   #1
TiVoPony
TiVo Forum Special Member
 
TiVoPony's Avatar
 
Join Date: May 2002
Location: Alviso, California
Posts: 2,194
Smile Getting Started with Eclipse

Want to write an HME app? Maybe you've dabbled in code before, but never Java. It's not hard, but getting the tools to work is always the first hurdle.

Want to get started? Here's one way, and it won't cost a penny. Note that I won't go into all the why's, but rather focus on the how's...let's get you up and running.

First, download the following:

The Java SDK 1.42 from java.sun.com

The HME SDK from tivohme.sourceforge.net

The Eclipse IDE from www.eclipse.org

Install/unzip all of that into a set of directories. Doesn't matter where. But remember where you put 'em.

Fire up Eclipse. You'll want to go back to eclipse.org and read through the first couple of sections of the faq, there's a link right on the front page. Work your way down to 'How do I write a "Hello World" program?. Try that...get that working first. It'll show you some of the basics.

Now let's try the same thing with HME.

Create a new project (you should probably go ahead and 'close' your old project by right-clicking on it and selecting 'close'). Name it anything you want. Eclipse will create it, and automatically add the JRE System Libraries to it (standard Java libraries).

Now Right click on the new project (in the explorer window on the left side of the screen), and select Properties. Go to Java Build Path. Select Libraries. Select Add External JARs. Browse and find the files named HME.jar and hme-host-sample.jar in the HME SDK directories. Select both of those, press OK, and Eclipse will add the hme.jar and hme host libraries to the project too.

Create a new package within that project. You can name it whatever you want...our guys use com.tivo.hme, you can use anything, just try to make it unique to you. All lower case. This creates a hierarchy of folders within your eclipse 'workspace' folder, matching whatever you type (eg. empty 'hme' folder inside a 'tivo' folder inside a 'com' folder.

Create a new class within that package. Name it HelloWorld (mind the capitalization, java is picky). Eclipse will create a new class and will auto-fill a bunch of information for you...the start of a program. Select it all, and delete it.

Open up the sample HelloWorld.java app from the HME SDK using any text editor. Copy everything from there into the new class you created in Eclipse (replacing the auto-fill stuff).

Find the line near the top that says 'package com.tivo.hme.samples.HelloWorld'...change it to say 'package xxx.yyy.zzz' where xxx.yyy.zzz is the name you gave your package earlier. All lowercase.

One more thing and you're ready to try and run this thing. You need to copy the icon file from the HME SDK directories to the package. This is easy. Just go to 'My Computer' or 'Windows Explorer' or whatever you use to browse files on your PC. Go to the HME SDK directory you created, and dig through to where the source (src) for the samples are. In the directory called Hello you'll find an icon.png file. Drag that over to the package icon you created in Eclipse. The file will be copied into the Eclipse directories for your java project.

Now, select 'Run' from the menu bar, and scroll down the drop down window and select Run... Don't choose Run As!

A Run window will open. Click on Java Application (to the left), and then press the 'new' button. It'll create a new file labeled 'New_configuration'. Highlight it. This is the runtime configuration for this particular program. Change the Name: to something that makes sense (like HelloWorld). The Project name should be auto-filled. Below that is Main Class. Make sure that 'Include external jars when searching for main class' is checked on. Type the following into the Main class dialog: com.tivo.hme.host.sample.Main.

Now click the 'Arguments' tab (still in the Run dialog window). Under 'Program Arguments' type the packagename.classname (eg. com.tivo.hme.HelloWorld, or xxx.yyy.zzz.HelloWorld). That's the packagename followed by the classname...you need both this time.

Remember to pay attention to capitalization.

Now click 'Run'.

You should see a console window open at the bottom of the screen, and it'll say something like this:

1062ms: Registered http://192.168.3.6:1247/hme/
1140ms: 192.168.3.6 handleHTTP: /hme/icon.png

You can either double click the simulator.jar file in the HME SDK directories, or go to 'Music, Photos & More' on your TCD and view your application. The backdoor for turning on MP&M is clear clear 0 0 on the System Info screen.

If you can get through the above, and you see "Hello World" on your TV...you did it! Now you can focus on learning Java, rather than trying to make the tools behave.

Cheers,
Pony

edit - updated to reflect the new hosting implementation in SDK 1.3+
__________________
Director of Product Marketing
TiVo Inc.

Last edited by TiVoPony : 10-24-2005 at 06:40 PM.
TiVoPony is offline   Reply With Quote
Old 02-16-2005, 09:30 AM   #2
martinp13
YHTBMABIITY
 
martinp13's Avatar
 
Join Date: Mar 2001
Location: Fort Worth, TX
Posts: 10,624
TC CLUB MEMBER
Thanks Pony... always nice to have a lantern to help guide you through the swamp! Can't wait to get home and give this a try.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Come join us October 5-12, 2014!
martinp13 is online now   Reply With Quote
Old 02-16-2005, 04:08 PM   #3
dropd
Registered User
 
Join Date: Dec 2003
Posts: 244
Good job Pony. Eclipse is definitely a nice ide for beginners and experts alike.

I would also recommend creating a second "Run..." configuration where instead of using the "Factory" class as your main executable, you use the "Simulator" class. (Keep the arguments string the same). That way, you can test your app in the simulator with one click, instead of having to start the factory and then launch the simulator from outside eclipse.
dropd is offline   Reply With Quote
Old 02-16-2005, 05:09 PM   #4
TiVoPony
TiVo Forum Special Member
 
TiVoPony's Avatar
 
Join Date: May 2002
Location: Alviso, California
Posts: 2,194
Quote:
Originally Posted by dropd
Good job Pony. Eclipse is definitely a nice ide for beginners and experts alike.

I would also recommend creating a second "Run..." configuration where instead of using the "Factory" class as your main executable, you use the "Simulator" class. (Keep the arguments string the same). That way, you can test your app in the simulator with one click, instead of having to start the factory and then launch the simulator from outside eclipse.
Good idea, that's slick.

You also have to add both hme.jar and simulator.jar when you're setting up your project.

I'll add it in as an option above. Thanks for the suggestion!

Pony
__________________
Director of Product Marketing
TiVo Inc.
TiVoPony is offline   Reply With Quote
Old 02-16-2005, 05:10 PM   #5
TiVoPony
TiVo Forum Special Member
 
TiVoPony's Avatar
 
Join Date: May 2002
Location: Alviso, California
Posts: 2,194
Quote:
Originally Posted by martinp13
Thanks Pony... always nice to have a lantern to help guide you through the swamp! Can't wait to get home and give this a try.
You're welcome.

Drop a post here when you get Hello World running.

Pony
__________________
Director of Product Marketing
TiVo Inc.
TiVoPony is offline   Reply With Quote
Old 02-16-2005, 07:43 PM   #6
trojanrabbit
Cat Nurse
 
trojanrabbit's Avatar
 
Join Date: Mar 2001
Location: Near the banks of the River Charles
Posts: 3,286
Thanks, Pony.

Been a bad day for installing things, tried to install a printer on my old fileserver PC, the program ran once, said there wasn't enough disk space, and won't run again (there's plenty of space now), of course it's running WINME so I get what I deserve. Went to install all of the java stuff on this laptop and somehow I screwed up and deleted something I shouldn't have. That's what I get for using this laptop in bed.

Think everything is installed now and happy so I'll try what's in your post.
__________________
Paul
RIP Buddy (1992-2006)
RIP Lucky (2001-2013)
trojanrabbit is offline   Reply With Quote
Old 02-17-2005, 08:08 AM   #7
gman622
Registered User
 
Join Date: Feb 2005
Posts: 111
you also easily fool around with all the samples included in the SDK by choosing File>Import>Existing Ant Buildfile
(first change the pathelement of hme.jar) and browse to hme_sdk_ea1\samples\build.xml
gman622 is offline   Reply With Quote
Old 02-17-2005, 12:50 PM   #8
fisherk
Registered User
 
Join Date: Sep 2004
Posts: 27
Cool I have been using Eclipse to build my Home Automation app but have been building then running every time. Now I run it right in the simulator from elcipse...
Very nice - thanx!
fisherk is offline   Reply With Quote
Old 02-17-2005, 02:20 PM   #9
trojanrabbit
Cat Nurse
 
trojanrabbit's Avatar
 
Join Date: Mar 2001
Location: Near the banks of the River Charles
Posts: 3,286
Ah, success! Hello World appears on the Kitchen TiVo

Time to try some of the other demos.

Now if only I could do this on the Humax DVD..... j/k
__________________
Paul
RIP Buddy (1992-2006)
RIP Lucky (2001-2013)
trojanrabbit is offline   Reply With Quote
Old 02-18-2005, 02:21 PM   #10
TiVoPony
TiVo Forum Special Member
 
TiVoPony's Avatar
 
Join Date: May 2002
Location: Alviso, California
Posts: 2,194
Quote:
Originally Posted by trojanrabbit
Ah, success! Hello World appears on the Kitchen TiVo

Time to try some of the other demos.

Now if only I could do this on the Humax DVD..... j/k
Congratulations!

Feels good to get something running, doesn't it?

HME is coming to the DVD platforms, we started with the standalones. Remember, for now it's really a developers-only kind of feature, it's not intended yet for the average consumer. Later this year you'll see it more front and center, and on more boxes.

Cheers,
Pony
__________________
Director of Product Marketing
TiVo Inc.
TiVoPony is offline   Reply With Quote
Old 02-18-2005, 09:31 PM   #11
VaderFan
Registered User
 
VaderFan's Avatar
 
Join Date: Jan 2005
Posts: 5
Thanks TivoPony for posting that walkthrough, certainly made things easy. Now I can put up provacative messages for my wife to check during commercials if I can keep her from pressing the skip button long enough.

PonyPoker is pretty sweet too!

Last edited by VaderFan : 02-18-2005 at 10:30 PM.
VaderFan is offline   Reply With Quote
Old 02-20-2005, 07:32 PM   #12
shady
We have chickens!
 
shady's Avatar
 
Join Date: May 2002
Location: Morgan Hill, California
Posts: 3,691
Thanks for the tutorial Pony. This got me up and running really quickly. I'm now playing with and looking through the samples.

just need some inspiration now!!!

shady is offline   Reply With Quote
Old 02-21-2005, 11:01 AM   #13
N.Tx.Beginner
Registered User
 
Join Date: Feb 2005
Posts: 2
Tivo HME Samples in Eclipse

Quote:
Originally Posted by gman622
you also easily fool around with all the samples included in the SDK by choosing File>Import>Existing Ant Buildfile
(first change the pathelement of hme.jar) and browse to hme_sdk_ea1\samples\build.xml
Sorry if this should be obvious, but can you post and example showing how to change the pathelement of the hme.jar?
N.Tx.Beginner is offline   Reply With Quote
Old 02-24-2005, 11:26 AM   #14
gman622
Registered User
 
Join Date: Feb 2005
Posts: 111
Quote:
Originally Posted by N.Tx.Beginner
Sorry if this should be obvious, but can you post and example showing how to change the pathelement of the hme.jar?
this is what i changed my build.xml to include:

<property name="hme.jar" location="C:\TivoHME\hme_sdk_ea1\hme.jar"/>

<pathelement path="${hme.jar}"/>


of course you need to change "C:\TivoHME\hme_sdk_ea1\hme.jar" to wherever your hme.jar is located.

btw you can also add the bananas samples to the hme samples.
right click on TiVo HME Sample Applications:Import>File System, then browse to C:\TivoHME\bananas_ea1\sample\src Seclect All>Finish
then you add bananas.jar to your Java Build Path-Libraries(Add External Jars...)
gman622 is offline   Reply With Quote
Old 02-25-2005, 01:02 PM   #15
jeffrey_ropp
Registered User
 
Join Date: Dec 2003
Posts: 36
Question Getting started with Bananas...

TivoPony,

First, thanks for a nice writeup to get us java newbies moving. I've played around with a similar writeup that allowed me to write HelloWorld using another IDE, NetBeans. Would you say this environments are similar or does eclipse offer something uniquely well suited to HME dev?

More importantly, I'd love to see a sample project (or writeup - but preferably the former) that shows the way when using the bananas classes. I successfully got a project to run, but I'm not entirely sure how it worked nor could I walk someone thru it! Would you be up for another writeup with attachments?

Many thanks,
Jeff
jeffrey_ropp is offline   Reply With Quote
Old 02-26-2005, 12:44 AM   #16
boscodegama
Registered User
 
Join Date: Feb 2005
Posts: 137
Thanks for the getting started in Eclipse. I had recently started checking it out prior to HME being released but hadn't done anything serious in it yet. I'm definitely excited by the opportunities.

Anyway, I know enough about Java to be dangerous but don't know a lot of the methodology and practices. Anyone want to clue me in on how to create a Web Start JNLP from my project?



thanks..
boscodegama is offline   Reply With Quote
Old 02-27-2005, 05:36 AM   #17
jnk27
Registered User
 
jnk27's Avatar
 
Join Date: Dec 2001
Location: Massachusetts
Posts: 35
YeeHaa! It's alive.

Thanks.
John
jnk27 is offline   Reply With Quote
Old 03-01-2005, 06:36 PM   #18
N.Tx.Beginner
Registered User
 
Join Date: Feb 2005
Posts: 2
Thanks, gman622.
N.Tx.Beginner is offline   Reply With Quote
Old 03-04-2005, 09:16 AM   #19
rrr22777
Registered User
 
Join Date: Jul 2002
Posts: 529
Thank you TivoPony. I got HelloWorld to work. My motivation to do this was to change the default zip code in GoogleMap Plus!
rrr22777 is offline   Reply With Quote
Old 03-04-2005, 10:30 AM   #20
quell
Registered User
 
Join Date: Jul 2002
Posts: 5
Smile Thank You!

Thank You! Thank You! Thank You!


Very usefull post.

I was totally stuck trying to get this to run until I read your post.

quell is offline   Reply With Quote
Old 03-06-2005, 08:51 PM   #21
DVDerek
&amp;amp;lt;WittySaying /&amp;amp;gt;
 
Join Date: Sep 2002
Location: Boston, MA
Posts: 6,450
Hello World Running! W00t! Netflix Queue, Here I come...
DVDerek is offline   Reply With Quote
Old 03-07-2005, 08:39 PM   #22
Judremy
Registered User
 
Join Date: Jun 2004
Location: Dearborn Heights, MI
Posts: 97
OK, I'm trying to make my own Bananas app using BananasSampleScreen & TextScreen as templates. The problem is I put these both in com.judremy.hme similar to the example by TivoPony and try to get them to run, but the error I keep getting is:

error: no constructor: com.judremy.hme.ScreenBack.<init>()
error: make sure the class is public and has a public default constructor


ScreenBack is similar to BananasSampleScreen
HelloWorld is similar to BText

Any help is appreciated.
__________________
Jeremy Soronen
Toshiba SD-H400 250GB w/ Tivo Wireless Adapter
Tivo HD 1 TB w/ wired LAN
Judremy is offline   Reply With Quote
Old 03-09-2005, 12:45 PM   #23
ZeoTiVo
I can't explain
 
ZeoTiVo's Avatar
 
Join Date: Jan 2004
Posts: 25,486
Quote:
Originally Posted by martinp13
Brittney Spears* will be at TC-Con 2005 in Las Vegas! Check it out!

* Delicious asparagus appetizer available at the Montecito Hotel & Casino .
I am holding out for the Avril LaGreenBeans
__________________
You just need to disable your sense of shame for all humanity and click past the break
ZeoTiVo is offline   Reply With Quote
Old 03-09-2005, 12:51 PM   #24
ZeoTiVo
I can't explain
 
ZeoTiVo's Avatar
 
Join Date: Jan 2004
Posts: 25,486
Quote:
Originally Posted by jeffrey_ropp
TivoPony,

First, thanks for a nice writeup to get us java newbies moving. I've played around with a similar writeup that allowed me to write HelloWorld using another IDE, NetBeans. Would you say this environments are similar or does eclipse offer something uniquely well suited to HME dev?

Many thanks,
Jeff
nothing uniquely suited to HME but eclipse is emerging as the standard platform upon which most other good IDES for Java are built. NetBeans may be from the source of Java but eclipse is much more universal and eclipse 3 is just the way to go.
__________________
You just need to disable your sense of shame for all humanity and click past the break
ZeoTiVo is offline   Reply With Quote
Old 03-09-2005, 01:28 PM   #25
dropd
Registered User
 
Join Date: Dec 2003
Posts: 244
Quote:
Originally Posted by ZeoTiVo
nothing uniquely suited to HME but eclipse is emerging as the standard platform upon which most other good IDES for Java are built. NetBeans may be from the source of Java but eclipse is much more universal and eclipse 3 is just the way to go.
Um, I disagree wholeheartedly with this statement. It is both an oversimplification and factually incorrect.

Eclipse and NetBeans are probably the two most popular "free"/open-source IDE development platforms. Both focus on Java, though they also support (to varying degrees) other languages.

Both can also be used as application development frameworks themselves, not just as IDEs for building external applications. That is, you can build other apps out of the eclipse and netbeans code itself that aren't ide's.

Claiming that "eclipse is much more universal" doesn't make too much sense, because the IDE field is vast, with competing Java IDEs like JBuilder, IntelliJ IDEA, Oracle JDeveloper, etc. It is true that some other IDEs are built on Eclipse, like IBM's WebSphere IDE, but it's also true that others are built on top of NetBeans, like SunOne Application Studio. But eclipse as"the standard platform upon which most other good IDES for Java are built", I don't think so.

In the open source community, eclipse definitely has more momentum right now for lots of people, partially because for a few versions eclipse was a little bit faster-seeming, and because plugins are a little bit easier to develop for eclipse. NetBeans is far from dead, and is overall still a better IDE for doing web development (like with JSPs) out of the box.

Right now, I primarily use eclipse both at work and at home, but I recognize that there's no one IDE that's perfect for everyone. Nor should there be. Healthy competition on features and price move everyone forward.

"Eclipse 3 is just the way to go" isn't very informative.
dropd is offline   Reply With Quote
Old 03-09-2005, 06:59 PM   #26
TiVoPony
TiVo Forum Special Member
 
TiVoPony's Avatar
 
Join Date: May 2002
Location: Alviso, California
Posts: 2,194
I knew there was a reason I didn't want to get into a NetBeans vs. Eclipse debate!

Anyone developing an HME app on any IDE has my support. I'm using Eclipse because...that's what I started with. Pick one and run with it! Your customers will never know which you chose.

Pony
__________________
Director of Product Marketing
TiVo Inc.
TiVoPony is offline   Reply With Quote
Old 03-09-2005, 10:53 PM   #27
hoopsbwc34
Unpaid Tivo Salesman
 
Join Date: Jan 2003
Posts: 215
Quote:
Originally Posted by TiVoPony
HME is coming to the DVD platforms, we started with the standalones. Remember, for now it's really a developers-only kind of feature, it's not intended yet for the average consumer. Later this year you'll see it more front and center, and on more boxes.
Well, I'll ask it (even though I can guess the answer) What are the chances of seeing this on DirecTivo?
hoopsbwc34 is offline   Reply With Quote
Old 03-10-2005, 07:17 AM   #28
ZeoTiVo
I can't explain
 
ZeoTiVo's Avatar
 
Join Date: Jan 2004
Posts: 25,486
Quote:
Originally Posted by TiVoPony
I knew there was a reason I didn't want to get into a NetBeans vs. Eclipse debate!

Anyone developing an HME app on any IDE has my support. I'm using Eclipse because...that's what I started with. Pick one and run with it! Your customers will never know which you chose.

Pony
I agree with this TiVoPony - my advice was more to people starting out in Java then those that have a tool set they use already. The power of Java is its versatility to be used in many different ways and not be constricted to only one supported approach. That is the very power of HME itself. I gave my simplified view and am done.

PS I had to laugh though when at the end of the post dropd siad he was using eclipse both at work and at home
__________________
You just need to disable your sense of shame for all humanity and click past the break
ZeoTiVo is offline   Reply With Quote
Old 03-10-2005, 08:41 AM   #29
dropd
Registered User
 
Join Date: Dec 2003
Posts: 244
Quote:
Originally Posted by ZeoTiVo
PS I had to laugh though when at the end of the post dropd siad he was using eclipse both at work and at home
I'm not sure why you had to laugh at this. My point was simply that it's not productive for you to criticize the guy who was asking if it was ok to work in NetBeans, or to discourage folks from finding the toolset that works best *for them*. There is NO HME advantage to using eclipse. And eclipse is far from universal.

And with that, the horse is dead and buried.
dropd is offline   Reply With Quote
Old 03-15-2005, 09:54 AM   #30
ScottKuma
Robble robble!
 
Join Date: Aug 2002
Location: NE of Cincinnati, OH
Posts: 16
W00t!! Got my "Hello, World!" Program up & running.

Now I need to figure out something to write. I'm sure it'll come to me.
ScottKuma is offline   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVoŽ is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 08:57 PM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |