How to handle "out of balance" situation in java-me sms app? - java-me

A j2me app is sending sms. Now SIM card in the mobile phone is prepaid and is out of balance,
So app cant send the sms. Do we get any exception in this case ???
As far as I know it gives IOException, I have handled the same but it is not working...

Related

PSTN to Internet

I'm making a PSTN interface for some voice chat software I use, just for personal use. My current plan is this:
With a mobile phone, I call a number registered with Twilio and input a keypad sequence to authenticate myself.
My server instructs Twilio to forward a SIP call to my server.
I decode the SIP stream and pipe it into my (NodeJS-run) voice bot for the voice chat, and the voice chat data from the other callers are sent back to the phone.
Is there a simpler way to do this, or is this the best plan? If possible I'd like to cut SIP out of the equation since decoding that is probably a pain. The voice bot at the end is necessary, but everything else could be changed. The core requirement is that PSTN data is turned into a computer-readable stream on the Internet and that the Internet stream can be sent back to the phone.

How can I receive incoming sms in JavaME?

I'm developing an application in javaME and I'm trying to receive incoming sms but there is a way to catch them that is working only with ports and there must be two applications but I want to send sms in a phone without using javame application to other phone that hasn't javame application.
I want to receive incoming sms without using port. How can I do this, is it possible?
In Java ME, You can't read SMS from inbox. There is a way to read SMS from Inbox, but it is for symbian phone like S60 series ( Nokia E72,E5 ) etc only.
In S60 series phone using API Bridge jar file, you can achieve your requirement. Please check out http://www.developer.nokia.com/Resources/Tools_and_downloads/Other/APIBridge/ page for more details.

SMS sent from j2me not recieved by non-java phones like android and gsm modem

I need to send a pattern like "username,password,0,1,1,1,0,1,0" using sms from j2me app to a gsm modem that is not in my control. It is used to reserve foods.
If anyone send a sms to provided number of the gsm modem using any mobile phone normally (like how you send sms to anyone), it will reply an answer.
My problem is sms sent from my j2me app is received by any java phone, but the gsm modem doesn't get it (as I didn't receive the reply and the food is not reserved). Same as gsm modem android phones don't receive my sms.
I used the typical j2me libraries to send sms. I tried TextMessage, no luck. Then I tried BinaryMessage, it didn't received by gsm modem but android received it!
Another thing is that I couldn't find any complete source, documentation or examples about sms pdu. Is the binary payLoad all the full sms format sent using BinaryMessage?
At the end I would now is it possible to send normal text sms using BinaryMessage? Any examples?
Thanks in advance.
Regards, Ali.
You should try to send sms by AT commands, compose message and send it sending by commands: (AT+CMGS, AT+CMSS)
Here is tutorial for it
At the bottom you have full list of topics about AT commands and SMS sending.
For using AT commands tutorial for AT commands in java me

J2ME WMA send SMS for device without MIDlet installed

I'm using the WMADemo from the J2ME samples to send and receive SMS.
If I send one SMS from the SMSSend MIDlet for one device that doesn't have SMSReceive MIDlet installed the message goes to the inbox.
Is there any way to prevent this from happening?
Thanks.
I assume you want the message to be received by the MIDlet if it's present, and to be discarded if it's not installed, is that right?
There's nothing you can do about that, it's down to the individual handset. Some handsets (e.g. Nokia S40) will silently discard an SMS sent to a port number if there is no MIDlet listening for the message, whereas others will just display it as if it were a regular SMS.

Is it possible to have a J2ME app get an SMS and send it to a computer?

That's basically my question, I have written the code for sending/receiving SMS but it's basically a "server/client" so I can't get the SMS that are sent directly to the phone number instead of through the j2me program. Is it even possible?
It is quite possible to write an app that receives an incoming SMS, extracts the message and sends it to server through a HTTP call. You can then make that server send that SMS to another phone.
Using the Wireless Messaging API (JSR 120) you can receive SMS to a JavaME application. However, you must register to receive SMS on a particular port, and you cannot read SMS from the phone's standard inbox.
Register:
import javax.wireless.messaging.MessageConnection;
MessageConnection connection =
(MessageConnection) javax.microedition.io.Connector.open("sms://:1234");
There are 2 different methods of receiving SMS:
event-driven using javax.wireless.messaging.MessageListener
using blocking method javax.wireless.messaging.MessageConnection.receive()

Resources