Reading SMS from inbox in j2me - java-me

I am using j2me technology. My application is for sending and receiving sms. Sender can not send sms on specific port and sms always goes to inbox. Is it possible to read sms from inbox in j2me?

No you cannot read SMS from inbox in J2ME. However you can do so using AT commands as I described in this answer.

You can not read SMS from Inbox directly. For reading SMS from Inbox you need APIBridge.jar. Using this .Jar file you can read the SMS from inbox too.
For Sending SMS on a particular port, try this Sending/Receiving SMS from MIDlets
The API Bridge package includes a server component and set of plug-ins that are installed on a Nokia Symbian device. This device component is complemented by a JavaScript™ library, set of ActionScript classes, and a JAR file containing classes and resources that enable the use of the features of the shipped plug-ins.
The other features of APIBridge.Jar is as follows,
Uploading files.
Capturing video, image, and audio.
Reading files.
Resizing images.
Creating image thumbnails.
Using the logging service.
Using the location service.
Using the media management service.
Sending DTMF tones in an active call.
Please note that APIBridge.jar works for Symbian OS Based Phone Only. Not for S40 Device

Yes it can be done with AT-command. I have done it before. J2ME can't read your native SMS can came with the phone unless you write a background processes in Symbian C++ that extracts the SMS from your inbox and handles it to your Java ME application.
In the AT command implementation, you use the following algorithm
Set the phone on text mode by doing this - "AT+CMGF=1" + RETURN, then also send AT+CMGS="RECIPIENT NUMBER " + CTRL+Z. Then, before you can send the AT command to the GSM modem, in your J2ME program, you need to use CommConnection framework i.e. serial port protocol.

You can receive/send SMS messages using WMA https://web.archive.org/web/20070205092831/http://java.sun.com/products/wma/
A sample application can be found here

Related

How to use minicom to communicate via sms with my usb modem?

I am using a huawei e355 usb modem on linux. I would like to send my usb modem texts from my cell phone and would want my usb modem to store it in some log file and may be communicate back. How do I go about doing this?
I went through a lot of articles but they were more about setting up the modem rather than using it in this particular way.
The best option for your needs would be Gammu. You can download it here http://wammu.eu/. You can also get it over your paket manager.
There is a python API available which makes interacting with texts easier.
For your needs I would recommend you run the gammu-sms daemon (gammu-smsd) and have a script which interacts with the contents of your sms. Check the RunOnReceive variable in the /etc/gammu-smsdrc file.
Try http://www.question-defense.com/2010/07/27/use-minicom-for-linux-modem-dialup-at-command-testing.
This allows you to send and receive texts from the modem; you can then set a callback for what to do once a text is received. I'm currently working on something along these lines, too, so I don't have a complete answer, but this should get you started.

Is there any telephony framework in linux?

I have a USB 3g modem, On windows it comes with software with which, I can use it for calling, sending and receiving SMS. Now, I want to write similar open source application in linux ( I also want to provide DTMF detection functionality ).
In windows, we can achieve this through TAPI, what are the similar technologies/frameworks in linux? Is there any similar opensource application ( I want to use as a reference )?
Yes it is is called ofono - project started by Intel/Nokia for Maemo/Moblin. From wikipedia:
oFono is a free, open source project for mobile telephony (GSM/UMTS)
applications. It uses high-level D-Bus API for use by telephony
applications. It uses 3GPP standard. It is free software released
under the terms of the GNU General Public License v2.
And Asterisk and Freeswitch are PBX software and probably are not what you are looking for.
Freeswitch
I'm not sure about a USB modem, but for VOIP telephony, Freeswitch is excellent. It uses a generic socket API to make it extensible via any number of languages. It can handle inbound and outbound calls, text-to-speech, voice recognition, etc.
My Vodafone Merlin card was recognized as a ttySx ant it was possible to interact by simple AT-commands like with old analog modems. There were also extra commands for reasing the sim card address book, sms and I believe also for sending sms.
We use sms tools: http://smstools3.kekekasvi.com/
The SMS Server Tools 3 is a SMS Gateway software which can send and receive short messages through GSM modems and mobile phones.
You can send short messages by simply storing text files into a special spool directory. The program monitors this directory and sends new files automatically. It also stores received short messages into another directory as text files. Binary messages (including Unicode text) are also supported, for example ring tone messages. It's also possible to send a WAP Push message to the WAP / MMS capable mobile phone.
The program can be run as a SMS daemon which can be started automatically when the operating system starts. High availability can be ensured by using multiple GSM devices (currently up to 64, this limit is easily changeable).
The program can run other external programs or scripts after events like reception of a new message, successful sending and also when the program detects a problem. These programs can inspect the related text files and perform automatic actions, for example storing information into a database (for example MySQL or Microsoft SQL Server), sending an automatic reply, forwarding messages via eMail (SMS to eMail gateway), ... and whatever you like."
Asterisk would be the usual suspect for what you want - http://www.asterisk.org/

what is the purpose of using USSD Commands in our J2ME Application? Is this possible?

I heard there is USSD Commands in Mobile.But i dont know what it is? i was googling two more sites.i did not understand it.Please anybody having knowledge about USSD Commands, share with me.
How it is useful when we using USSD Commands with our j2me midp 2.0 application development?
Please suggest me some useful URL's to get this properly.
Also, i would like to here about AT Commands too?
Thanks & Regards,
P.SARAVANAN
USSD is Unstructured Supplementary Service Data.
GSM standardizes on the syntax (i.e. message transport) of USSD but not on the semantics (i.e. what one can do with USSD is network-operator-specific).
USSD applies a request/response pattern. A user sends a USSD request which is processed by the network and eventually answered with an USSD reponse. In a nutshell, USSD allows an end user sending numerical commands. These commands are transported by protcol functionality within the SS7 signalling stack from the mobile device to the mobile network MSC (mobile switching center, the nework node controlling the mobile network). The network operator configures the MSC to handle specific USSD requests, typically to forward them to various other network elements. Among them are:
HLR (home location register, the user database) to switch on/off telephony services.
IN (intelligent network, the realtime billing platform, among others) voucher management system for prepaid top-up.
USSD gateway to branch out USSD messages to external systems.
These network elements then generate USSD responses which are transported back to the user.
Using USSD from J2ME is offered via:
Devices supporting JSR 120 (Wireless Messaging API). Consult manufacturers development documentation or device databases to check which devices are covered.
AT command (AT+CUSD) via serial interface emulation.
The user composes some message—usually rather cryptic—on the phone keyboard.
The phone sends it to the phone company network, where it is received by a computer dedicated to USSD.
The answer from this computer is sent back to the phone.
The answer could be seen on the phone screen, but it is usually with a very basic presentation.
The messages sent over USSD are not defined by any standardization body, so each network operator can implement whatever it finds suitable for its customers.

Sending an SMS from mobile browser

Is it possible for a mobile browser to send an SMS using the device's built-in capabilities?
By that I mean, NOT using some online SMS services provider but actually making the mobile device send the SMS (same you would do using J2ME).
There are lots of different mobile browsers out there, so I doubt that this is standardised. Safari/iPhone supports SMS URIs, which strikes me as a sensible approach to the problem and one that might be more widely supported than just the iPhone.
Based on the link (above) I found, and a comment from Zamel, I suspect this would work:
SMS
Although with a real phone number, and possibly escaping the + sign as %2B.
Some versions of the Opera Mini browser provide a javascript interface for authoring SMS messages to be sent from the user's phone.
Also, some versions of Nokia's Symbian browser include a javascript interface with similar functionality.
There might be others, but these are the only two I've found documentation for so far.
I think a GSM modem is capable of acting as a SMS Gateway but you have to have the software installed on the modem to do this. You might also look into the Carrier Gateway Emails to SMS as another option. Example is AT&T number#txt.att.net
There are a couple of free services popping up these days like ZeepMobile that you might also want to look into.
What exactly are you trying to accomplish?
No as a mobile browser is specifically built to render markup (html) documents. Therefore, if you wanted to send SMS via a mobile browser it would call a web server page and send from the server NOT the mobile browser.
Mobile OS and their applications have quite a lot of limitations. The closest you will see is the ability to hyperlink a phone # in a mobile browser to send a message but it will be handled via their SMS app not the browser.
Its not possible . You can call device functionality from browser . That is the way to go about it . Webkit lets you do it
Android and blackberry support
"mailto:" and "tel:".
Android supports "sms:" (and maybe iPhone, I don't have one :))
good luck and please post your result.
It's a good thing that is not possible. It would be quite a security risk IMHO. I imagine spammers would be all over it.

Developing applications for Nokia 5310

EDIT:
Is there any other phone systems that allow connecting into the native messaging system to read input in the composer?
There is absolutely no way to do this in standard J2ME.
Symbian phones will allow you to write C++ code that comes close to doing what you describe.
You may not be able to directly query the text editor GUI control for its content but you can create your own messaging module and have your own message editor or you can read messages in the draft and outbox folders of the local store.
5310 is Series 40 based so I would assume that you can't capture input from the native messaging composer. The S40 platform is fairly closed.

Resources