Where can I get to download Java comm api? - java

I want to write some programs using Java comm api. I am not able to find site/page from which I can download this API. Can anyone please tell me where can I get this API?
Basically I want to send SMS to mobile from PC. Mobile will connect to PC through USB cable. I would also like to know what are the possible ways to send SMS to mobile? (I am looking for option which wont incur me money)
Thanks in advance !
EDIT 1
I am not allowed to use third party APIs. It seems that Java comm API is dead now. So is there any other way to send messages to mobile from pc?

Download javax.comm api library from here : http://www.java2s.com/Code/Jar/c/Downloadcomm20jar.htm
In my opinion, the best alternative to javax.comm is rxtx.
Sending SMS over Serial Connection
For sending sms over serial connection you have to use AT command.
Here are some examples on other languages (but the concept is same).
http://linux-101.org/script/python-code-sending-sms-messages-usb-connected-mobile-phone
http://www.developershome.com/sms/howToSendSMSFromPC.asp
http://www.codeproject.com/KB/vb/AT_commands.aspx
I'd suggest you to test the commands on app like hyperterminal( alternative for win 7 : http://helpdeskgeek.com/windows-7/windows-7-hyperterminal/) first.

I would recommend RXTX. It doesn't use the javax.comm package, but it follows the same API, with a little extra.

If this is still relevant for you (maybe others, though);
Serialio.com are the true experts on serial communication. They have an excellent package (SerialPort) which I have used since 1997, and never given me any problems, and since then they have added support for Java Comm API as well as an endless number of platforms.

It might be an older version, but MIT hosts a copy of javaxcomm.zip here.

Try this source at oracle.com:
Misc. Java SE Tools and Libraries Downloads

Related

Using dial-up modems or GSM modems in Java

I want to communicate with my DFM-562IS D-Link modem (that is connected to my computer's mainboard via a PCI slot) using Java. The goal is listening for incoming calls and receive a code that the user enters on the other-side after connection (by his/her phone's keypad).
So far my searching on the Internet didn't give me anything useful and I found some closed old threads only (Here and here for example).
I just want to know if is it possible? and If so, give me a guildline please.
I really appreciate for shedding a light on this issue.
Thanks in advance
Update:
If the goal is achievable with GSM modems, please provide the related solutions for the issue in your answer also.
I'm sure it's possible, but I doubt it's very popular these days!
I don't know much about modems, but presumably if you can't find a higher-level library then you could communicate with them via the serial port using the Java Communications API or RxTx.
To see an exmaple of communication with a GSM modem, have a look at SMSLib.
If you are looking to support IVR, then you may not be able to find Java support for it. Software like FreeSwitch may help.

How to detect message threads using JavaMail on Android?

I'm writing an email client for Android using the javamail-android library. I would like to detect Gmail threads to be able to display all messages from one thread together. I'd rather not download all messages in the inbox folder though. What I want is to display only recent messages/threads. How can I do it and do I have to use external libraries for this?
I managed to find java-gmail-imap which seems to be doing what I want. Does anyone have any experience with it and/or can suggest possible alternatives?
For Android, you can use my port here. I have used it for a project successfully, I just replaced the java dependencies with Harmony implementations and turn it in a Android library project to make sure one is not using anything that isn't supported. You can make a jar out of it (which I should :P ).
The latest JavaMail release includes support for all the Gmail IMAP protocol extensions, including the ThreadID, but I have no idea if it works on Android, which isn't real Java.

Can an android application(client) communicate with a java web server using sockets?

I need an android application to communicate with a java web server using sockets, but can't seem to find any information regarding this. I have only been able to find information about java to java and android to android.
When I first tried doing this, I used the basic knock example taken from Lesson: All About Sockets, most likely written before the android OS existed, and adapted the server side to run on an android. That way I didn't have to make an user interface and could just focus on the communication. The code is here: EchoClient, KnockKnockServer, and KnockKnockClient.
The problems I initially ran into included:
Making sure that both sides knew which port to use.
Making sure I had set the permissions on the Android side to use the internet.
Making sure the client knew the ip of the server.
I posted my version of this code here. It worked one year, and then I had to fiddle with it again when I used it for my class this year. My students got it working, though. You'll get a security flag when you go to the site, since I don't want to pay for an officially registered certificate, but that is a rant for another day :-)
Here is an example how to use sockets in Android. With web server you should do the same. If you want to work with http protocol here is another link.

Networking with ios

I have an application that was written in Java and runs on the users machine. I now want to build an application on the iPhone which will communicate with my java app.
Can somebody point me in the right direction on how I can send and receive TCP packets with the iPhone, I want to of course be able to do that using wifi and 3G.
Thanks,
You use the NSStream classes. I've found it pretty easy to use.
See the SimpleNetworkStreams for an example.
One problem I found is that the iphone sdk does not include the NSStream method getStreamsToHost:port:inputStream:outputStream: which is what Mac OS examples use to open a NStream connection but there are lots of places that show you how to create your own like here.

Make a USB Device, Control It In Java

I'm thinking about making a physical controller (device?) with knobs, buttons, and LEDs. I'd like to interact with it using Java (respond to the knobs, light up LEDs, etc). The reason I mention Java is two-fold: first, I know Java well1. Second, I've written the rest of the program I need to interface with in Java (though there are ways to talk to the Java program from another language).
I would like the device to connect via USB and be (computer-)platform independent.
I haven't the slightest idea of where to start, except to start reading the Arduino website. Is this my best/only option? Is there something better suited for communicating with Java?
Note: I know that Arduino has something to do with Java (not sure what), but it seems like code must be written in a subset of C.
How would I get moving on this topic?
1 - No laughter, please.
The Arduino development environment is written in Java.
But the standard language you write a program for the Arduino platform is effectively C++.
The Arduino platform is based on an Atmel AVR chip. There is at least one Java VM for AVR chips. There are other languages available for the AVR such as Forth and BASIC (although I could only find commercial versions, so I'll if you want to find them, search for "AVR BASIC").
The Arduino uses a virtual COM port to communicate between the host computer and it. A virtual COM port emulates an old style serial line but is done with USB. You can use the Java communication API to then have a Java program running on the host computer communicate with your physical device.
For some encoders and buttons, you probably want to implement a USB HID device. If you're going to produce more than a couple of them, you'll want to do a custom board. Check out V-USB, an open-source library for making USB HID devices using Atmel microcontrollers. They have a bunch of examples of projects that use this library.
You could probably make this look like a HID joystick, using the encoders to produce X/Y axis information and having the buttons act like buttons. They you could use standard Java gaming APIs to read the joystick values.
Can you expand on your need for a custom device? It seems to me that designing hardware has a pretty high barrier to entry and that most applications I can think of would be better resolved by repurposing an existing piece of game controller hardware. If you really need new hardware, then i suggest you start by googling 'USB development kit' or
'USB development board' which will get you links like this, this and this.
As for working with USB hardware from Java, I've played around with the JUSB library a bit and it looks promising, but appears to be limited to Linux only because the Windows version of the native library half of the library hasn't been written. Alternatives can by found by googling 'HID java'.
Ok, computer-platform independant? What platforms are you targetting? That would depend on the driver and support for that said platform, what does the usb device do? Is it a mass storage device...You may have to look around and see if you can find a device driver that can talk to the device...
Hope this helps,
Best regards,
Tom.
I know for the serial port there were libraries that existed for interacting with it (rs232 library). Googling for java and USB returned several answers (the first was called jUSB). That would be the first type of thing I would be looking for.
sample for java usb connection to freescale microcontroller:
http://javausbapi.blogspot.com/

Categories

Resources