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

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()

Related

How to use recording feature using Twilio Client (VoIP)

I am using Twilio Client (VoIP) with nodejs for making a call from my device to a phone.
I want a recording functionality also with this but I don't see this API supports it.I see rest API which supports this but then it not supports VOIP.
can someone please provide a sample code or any help for this.
very sorry for a silly question but I am new to programming.
Thanks in advance.
The JavaScript Client is actually not making the recording but the TwiML does. You setup your device and establish a connection to Twilio. Audio from your device's microphone is sent to Twilio, and Twilio plays audio through your device's speakers, like on a normal phone call.
This is analogous to the way Twilio handles incoming calls from a real phone. All the same TwiML verbs and nouns that are available for handling Twilio Voice calls are also available for handling Twilio Client connections.
So assuming that you are calling a customer's number and want to record the call, you will need to pass this instruction in the TwiML, i.e:
<Response><Dial record=true>[Number to call]</Dial></Response>
Or in node.js:
resp.dial({
record:'true'
});
After the recording is complete, it gets assigned a recording SID just like recordings created via the verb, and you can fetch it via the REST API as documented here:
https://www.twilio.com/docs/api/rest/recording#list

how to send notification (email, SMS, whatever) stealthy programacticly linux

I have seen many of the posts relating to sending email under linux but they do not address my particular need.
I want to implement code (C/C++) in my linux application that will send me back some kind of notification (in a stealthy way) under a certain program condition. All it needs to send me is less than 50 bytes of status data. The only thing I am guarenteed is that the box will be on a local network which will have access to the Internet via the usual gateway.
One possibility would be to send me a text to my wireless carrier like this:
mynumber#verizon_gateway.com. But that assumes that I have a mail client available on the linux box which is not a guarantee. If I programmed this at the socket layer directly using SMTP I would have to manage a TCP connection which is not what I prefer to do.
Any suggestions of what would be a possible way to send me a notification from my linux app?
Thanks,
-Andres
For email you could use something like SendGrid, specifically their WebAPI - this will allow you to send email with only a HTTP request.
For SMS you could use something like Nexmo, which will allow you to send an SMS with a HTTP request.
Note that you'll have to include your API credentials in the compiled code - a potental security issue (for your credentials).
Disclaimer: I do a bit of developer evangelism for Nexmo.

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

Sending SMS using Java ME application

I want to a Java ME application that transfers any SMS received to a PC using bluetooth. The PC can then direct the Java ME application via bluetooth to send a response SMS. Is there library available for this architecture or I have to design it myself?
Is this approach correct or a better one exists? I want to use bluetooth as then I will not have dependency on the cable.
You'll need to create this yourself, however you'll find that you can't do what you want with J2ME.
J2ME can't access any old SMS that the handset receives, only ones sent to a specific port upon which the MIDlet is listening. So to get all the other SMSes, create a bluetooth serial/dial-up connection to your handset in the way I've described in this answer.
Create a PC client which repeatedly issues AT+CGML commands (as described in the AT command set document linked to in the answer above), to see when an SMS has been received. Use AT+CGMR to read and parse the message text. Then use AT+CGMS to sent a response. This can all be done over bluetooth.
It's better to use the serial connection to send a response, because a MIDlet cannot usually be triggered to open based on incoming bluetooth data.
Hope this helps.
You may have already achieved your task, anyway for the reference I think it is much better if you try using Gammu . I'm using it for the same task (Send / receive SMS through PC ) with a simple bat file I have written, works like a charm.
Anyway you don't need any J2me program for this.
Wammu takes care of making the connection to phone and sending AT commands.

Resources