I have connected my nokia through data cable to USB port. I need a program in java to access the gsm module of my mobile and send text messages.
which API i need to use for it? communication need to be taken place through USB port.
Thanks & Regards,
Sri
You can use smslib. It is a very reliable solution. It supports GSM phones and GSM modems connected via serial port interfaces or IP interfaces.
Look here for more.
Have a look at Kannel. It is not a Java application, BTW.
Java API for Kannel
An Example
Sending SMS with SMPP, Kannel and Java
The phone needs to be hooked up via a serial port for RS-232. Using either a USB data cable or a USB-to-RS232 adapter and a serial data cable.
Use Java Communications API to connect to the Phone.
Then use the AT command to send and receive SMS messages. There is and example here. It is not specific to Nokia, but it is pretty much a standard command set.
Related
Scenario : 1
Suppose there are two phones A and B. phone B sends a message to phone A. Phone A has that message in its inbox. Both the phones are nokia multimedia phones that can be connected with my laptop via nokia pc-suite.They can also be connected via Bluetooth with my HP laptop.
Scenario : 2
A valid sim card of my local operator is inserted into a modem and the modem is connected with my laptop. I can read messages sent in that number(sim) by using the software provided with the modem.
Question:
The received text message will be the input of my java program. How can I read that message with my java program. Solution for any of the two scenarios will solve my problem.
It would be very helpful for me if someone provide me some resources regarding this issue. I am interested to implement it by java but it would be also helpful if the resources are not in java platform but relevant to my task.
You can connect GSM modem built in Mobile Phone via bluetooth or RF232 connection, then send AT Commands. Pure java conenction functions should not be enough to make it possible. So you can use low level API coded by C programming language then connect it with Java applicatio via JNI.
I want to read sms from sim which is connected to my laptop by dongle(USB connector) using java code, I know that I have to use AT commands but I don't know which commands and how ???
If you are using Windows 7 and a reasonably new modem, you don't have to use AT commands. You can use the Windows Mobile Broadband API (it is available from Win 7 onwards).
It includes interface functions for SMS.
You need to enable a serial data connection via the USB connector to your GSM device/phone.
You will also need some type of terminal emulation software to connect and communicate to your phone.
You did not say what Operating system/Hardware you were trying to do this from, or what model of phone, this can affect the AT command set you need to use to access the SMS info, so I can't be more specific.
I have done this a few years ago using a bluetooth connection to a Motorola Razor from a mac Laptop, using a small Realbasic program to send and recieve SMS messages as a proof of concept for sending server monitoring messages to IT staff via sms. You can google the AT for GSM command set.
I want to develop an chat application to chat between two or more android devices using wifi network.The application should be able to send or receive strings from each other. I have an experience of using Bluetooth network between pc and android. Can any give me any suggestion or right direction. Thanks in advance.
You can be able to chat between two android devices in Android Version 4.0.There is an API called 'Wifi P2P'.More information can be had from here:
http://developer.android.com/reference/android/net/wifi/p2p/package-summary.html
If you are thinking about connecting devices that are under the same WiFi AP/router and without setting up any server, then I would suggest you to consider using UDP multicast which has been available since API level 1:
http://developer.android.com/reference/java/net/MulticastSocket.html
UDP does not guarantee data delivery (could be lost), so I would use UDP multicast for device discovery, and open up a TCP connection for data that requires guaranteed delivery. TCP listening port can be advertised via UDP multicast so that everyone can connect with each other over TCP. (There may be 3rd party tool that does this low level stuff for you.)
maybe XMPP will help, google talk uses the same protocol.
The Extensible Messaging and Presence Protocol (XMPP) is an open
technology for real-time communication, which powers a wide range of
applications including instant messaging, presence, multi-party chat,
voice and video calls, collaboration, lightweight middleware, content
syndication, and generalized routing of XML data.
things you need to do:
1. you need a server computer to run XMPP server, there are lots of open source implementations.
2. you need a XMPP client running on your android device, there are also lots of open source implementations running on android platform.
How can I receive SMS through a GSM modem so that I can use this SMS for further processing and send back a reply SMS.
I do not have particular idea on how to achieve this.......
I prefer using java language for this project and I am using Linux OS.
You might want to give a look at SMSLib:
SMSLib is a programmer's library for sending and receiving SMS
messages via a GSM modem or mobile phone. SMSLib also supports a few
bulk SMS operators.
To send an SMS using a 3G modem, you need to use the appropriate AT commands. First you need to set the modem to text mode:
AT+CMGF=1
Then you send your message:
AT+CMGS=<number><CR>
<message><CTRL-Z>
Where <CR> is a carriage return (ASCII 13), and <message> is the message you want to send, <CTRL-Z> is ASCII 26, and <number> is the number you want to send your message to.
To read received messages, you do this:
AT+CMGL=<stat><CR>
Where <stat> is one of: "ALL", "REC UNREAD", "REC READ" (with the quotes), meaning all messages, unread messages, and read messages respectively.
To do this in Java you'll need to use the Java communications API. Here's a short example:
http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html
hi i'm using RXTX library the code goes here!.. and its works fine for me , i searched a lot of things to get correct method finaly got the key to sms!.. :D
String mValue = "AT\r";// strating to communicate with port starts here!
mOutputToPort.write(mValue.getBytes());
mOutputToPort.flush();
Thread.sleep(500);
mInputFromPort.read(mBytesIn);
value = new String(mBytesIn);
System.out.println("Response from Serial Device: "+value);
mValue = "AT+cmgf=1\r";
mOutputToPort.write(mValue.getBytes());
mOutputToPort.flush();
mValue="at+cmgs=\" Mobile number\"\r";
System.out.print(mValue);
mOutputToPort.write(mValue.getBytes());
mOutputToPort.flush();
mValue="at+cmgs="\032";//calling ctrl+z
System.out.print(mValue);
mOutputToPort.write(mValue.getBytes());
mOutputToPort.flush();
mOutputToPort.close();
mInputFromPort.close();
Take a look on SMSJ: a fully functional library that allows sending and receiving SMS using either GSM modem or several popular web services.
Take a look at the Java SMSLib API.
From the web site : "SMSLib is a programmer's library for sending and receiving SMS messages via a GSM modem or mobile phone. SMSLib also supports a few bulk SMS operators."
You shoud take a look at your modem manual. Some devices support telnet connection and you can sent AT commands via command line.
If this is your case you have to learn about (sometimes specific for each device), and code an application that uses telnet to communicate with your modem.
Apache Commons Net project can be useful.
Some AT commands guides:
http://www.portech.com.tw/data/Siemens%20TC35I_AT.pdf
http://www.sierrawireless.com/resources/faq/AirLink/Redwing/Redwing_GPRS_UsersGuide.pdf
Alternatively you can try to use one of the libraries suggested by others.
U can use many methods ...
SMS Enabler
SMS Lib for java
Ozeki sms gateway
For recieving SMS best and simple solution will be
SMSenabler it will save your SMS instantly to file or database and u can retrieve it
Free version supports upto 12 characters
and if you want to send sms then you can use [enter link description here][Ozeki] Ozeki sms server gateway
I wish to connect 10 usb modems to a windows/linux pc and send AT comments to them to send sms and receive sms from them. Is this possible in Java?
I think it is possible. You just have to know the COMM port ID for each modem. I do not know pure java way to discover these IDs. So, you need some platform specific way (e.g. WMI on windows or some command on Unix). But once you have ID it should not be a problem.
Assuming the USB modem implements a serial interface, it should get a COMM port id. If so, you can use RXTX to talk to the model.
afaik, you can use serial communication while talking to usb devices as long as device hardware contains an ftdi chip or so. I used a c++ serial lib in a Qt project, talking to an Arduino connected on a usb port. arduino appears as a com device.
otherwise, you may look at the jusb project: http://www.ibm.com/developerworks/library/j-usb/index.html