For the past couple weeks I have been working on a custom dashboard and a communication class to go along with it. I was able to use my class in Java SE projects, but I tried to use it in an FRC project and I cannot compile it because it says that InetAddress cannot be found. I tried importing java.net.InetAddress but it did not work either because of the limited classes we have in FRC. Any suggestions on what I should do?
Aside from copying a large portion of the Java libraries onto your project, there’s probably little you can do. Last year, we wanted to use some math functions from the native Java libraries, but couldn’t figure how to do it, so we just copied entire files from there into our project.
If you’re making a custom dashboard, can’t you make it a standard Java project?
I used NetBeans on another computer to make a Java SE Project that would be the graphical interface on the driver computer, that worked perfectly. I also wrote a class that would allow the robot to communicate with the computer and it worked fine on the PC, but I tried to import the jar that contains the library into my FRC project, but it keeps saying that my package (org.serviterobotics.comm), doesn’t exist. So that is why I tried to use InetAddress to see if I could compile my classes with the rest of the project. As for your workaround, could you please tell me exactly what files you copied and where you copied them to, I thought of doing this but wasn’t sure what to copy. Thank you
It looks like InetAddress relies on a lot of other stuff so I doubt copying it over would work. When we did tried to copy the math functions last year, it worked because most of it had to do with some basic, self contained math. So I don’t know…
Sorry, but maybe someone else can help you.
For network communication from your FRC robot, you can use the “Generic Connection Framework” in Java ME.
See http://developers.sun.com/mobility/midp/articles/genericframework/ for an article in the GCF.
Also look at a presentaion “Java For FRC” that contains hints on more advanced topics for Java on your rorbot.