I'm building a simple gui in Java that has three selections which I'm going to place on the RPI. Depending on the selection, I need the RPI to output differing signals to a separate microcontroller that will
determine the operation of a larger mechanical system.
I can't seem to find anywhere that explains how to get a Java program to send output signals from an RPI based on user selection. Any and all assistance and guidance would be much appreciated.
Java code is run on a virtual machine which in itself will have no interface for controlling Raspberry Pi GP I/O pins. You will have to use a separate Raspberry Pi -specific native library, which you might be able to access through the Java Native Interface. Luckily the work seems to have been done for you, as a Java library like this exists.
Related
I have a Vex ARM Cortex-based Microcontroller and a Raspberry Pi B model, so I had the idea of having the Microcontroller send information through the UART Ports to the Pi. I have everything working on the Microcontroller's end since can easily test that it reads and writes to itself, but my trouble comes in when I try to program the Pi. I am using Java to write the program and I am also using the Java rxtx library. After I got a simple program that would test the ability to send and receive things I tried to run it and got the UnsatisfiedLinkErorr: no rxtxSerial in Java.library.pathwhich I fixed by going in and editing the native library location to the one for mac, as I am writing this on a mac. I then run it on my mac and it gets to the point of it seeing that the tty that I gave it was used or something along those lines, which is good since that means everything ran correctly. However, when I go to Pi it does not work and I get the same error UnsatisfiedLinkErorr: no rxtxSerial in Java.library.path, so I think that it is the native library location not being for linux, but I do not know which machine type I should use since there are three to choose from, if that is even the problem.
I have a basic understanding of network programming but i have never had anything to do with USB ports.
This is what i am trying to achieve
I need to write a program in Java, to communicate to a device which is connected to USB port and then later send commands.
I tried terminal as follows earlier but it didn't quite work
ls -l /dev/tty.*
screen /dev/tty.usbserrial-FTYRDSX7 9600
The above didn't work out.
So if someone can just guide with what Java classes i should be looking into and if there are any APIs that should help me get started
Unless you're required to build it from the ground up, use a library such as usb4java (also here). Trying to manage it as a block device and interpreting whatever protocols etc., etc is not worth the effort unless there something very unique to your problem.
So i ended up using jssc which is much easier to use with strait forward syntax and methods
I'm trying to find a developer to write a desktop program that has a pretty basic function. It will notify users, via some dialog (or alert) that some program is about to access the web cam. It could be skype or facetime, or whatever it is, the program should be aware of when the OS's camera is going to be accessed and notify the user. Yes, even if the user is initiating the camera themselves via Skype, the notification would still appear.
My question is this. If I need this program written in Java, is it possible? Obviously I am trying to get it done in Java so it would run on Windows and Mac.
If it is not possible, then it seems as though I'd have to write 2 separate programs on Windows and Mac.
I've come here to get suggestions so that I can connect with the right developers. If you have any suggestions, I'd be happy to hear them. Thanks!
No, you can't write this in Java. Whatever approach you take will be very system-specific (and will probably require enhanced privileges). You could write a JNI library and a Java interface, but it'd probably be about the same amount of trouble to write programs to the native UI libraries.
Disclaimer: I am not a professional developer; I'm just a hobbyist, and a relatively inexperienced one at that, so I apologize for what figure to be some very basic questions. (and yes, I've search the forums)
I've recently been working on a "deal finder" program which is written using a combination of Java and R. The basic steps that I've completed so far are:
Load data on various deals into Java using a particular eCommerce API
Write the data that I need to a series of text files
Load the data from the text files into R
Manipulate the data in R and assign a "score" to each deal
Sort by score to produce a ranked list of deals
Here's where I need help: I'm currently running the program manually by running my Java program in Eclipse and subsequently running the R script. This is obviously inconvenient (and also a bit addictive), so what I'd like to do instead is:
Run the program continuously or at some predefined interval (say every minute)
Send a notification to my iPhone or (if that's too difficult) my desktop whenever
there's a new deal whose score is above a certain threshold.
The problem: I have no idea where to begin with the two tasks above. My coding experience is limited to a bit of Java and math/stat languages like R and MATLAB. I have zero experience with web/mobile development, servers, etc., but I am willing to learn. What I'm hoping to get from this forum is not a completely specified solution, but instead just some general direction. If someone can give me a sense of how this should be done, how much work it would be, what language(s) I would need, etc., that would be immensely helpful.
Two more things I should probably mention: 1) This program is only for my personal use, so the resulting application, whether it be on my phone or desktop, can have very minimal functionality beyond the ability to send/receive notifications. 2) If it makes things easier, I think I can eliminate the dependency on R and write everything in Java.
Any help will be greatly, greatly appreciated.
Two more things I should probably mention: 1) This program is only for my personal use, so the resulting application, whether it be on my phone or desktop, can have very minimal functionality beyond the ability to send/receive notifications.
You may want to use a third-party notification app like Boxcar and its Provider API for this, then.
Depending on your operating system, there are programs that allow you to schedule tasks to run. Cron in Linux or Windows Task Scheduler for instance. You can easily find guides for these online.
Have you considered using email? Rather simple to do from java and wouldn't be platform specific.
How can i gain control on window based appliaction in java.
I am not asking like world or Excel.
I am asking for a window based application, suppose a media player(not specific window media player) any media player that is running on window.
How would you control the windows based application if you took Java out of the equation?
Does the program provide a COM interface? There are a number of Java-COM
bridges.
Does the program provide a plug-in API? You could write the DLL in C/C++, then either use JNI/JNA to interact with the DLL from Java, or use some kind-of interprocess communications layer.
Do you have have some view in the to low level Win32 message pump of the program? Then perhaps you could create native DLL to send messages via SendMessage on behalf of the java program.
It really depends on what you expect to do with the program, and what the program provides. There is no built-in functionality allowing one program to control another program, especially from Java.