Named my RPi 512MB @jerpi_bilbo
Posted
by hinkmond
on Oracle Blogs
See other posts from Oracle Blogs
or by hinkmond
Published on Fri, 26 Oct 2012 00:45:18 +0000
Indexed on
2012/10/26
5:10 UTC
Read the original article
Hit count: 238
/Java Embedded
To keep our multiple Raspberry Pi boards apart from each other, I've now named my RPi Model B w/512MB: "jerpi_bilbo", which stands for Java Embedded Raspberry Pi - Bilbo (named after the Hobbit from the J.R.R. Tolkien stories).
I also, set up a Twitter account for him. You can follow him at: @jerpi_bilbo He's self-tweeting, manual prompted so far (using Java Embedded 7.0 and twitter4j Java library). Works great! I'm setting him up to be automated self-tweeting soon, so watch for that... Here's a pointer to the open source twitter4j Java library: download here Just unzip and extract out the twitter4j-core-2.2.6.jar and put it on your Java Embedded classpath. Here's how @jerpi_bilbo uses it to Tweet with his Java Embedded runtime: |
import twitter4j.*;
import java.io.*
public final class Tweet {
public static void main(String[] args) {
String statusStr = null;
if ((args.length > 0) && (args[0] != null)) {
statusStr = args[0];
} else {
statusStr = new String("Hello World!");
}
// Create new instance of the Twitter class
Twitter twitter = new TwitterFactory().getInstance();
try {
Status status = twitter.updateStatus(statusStr);
System.out.println
("Successfully updated the status to: " +
status.getText());
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
That's all you need. Java Embedded rocks the RPi! And, @jerpi_bilbo is alive...
© Oracle Blogs or respective owner
