I am using j2me technology. I send sms and then I want to receive sms on port "0", not to go in inbox. I can receive on port "5000" but sender can not make changes, and I must receive on default port. But when I am listening on port "0" the message go to inbox. Is is possble to access the message, when my app listening od default port("0")?
Old question, but for anyone finding it when searching:
Sadly you cannot receive SMS sent on the standard port with JavaME. It's just not possible with JavaME.
Related
I need to write an application in Node.js which sends some UDP packets to a given IP address and Port as well as listening for UDP packets from the same IP and Port.
Other examples i have seen all seem to mention a Client and Server architecture with one side sending and the other receiving. I need to do both in one app.
My question is: Can i send and receive on the same socket or should i have one for each as below?
const Send= dgram.createSocket('udp4');
const Recieve= dgram.createSocket('udp4');
Thanks
You only need one socket - it's possible to both send and receive on the same one.
However to be able to receive the socket will need to be "bound" to a local port using socket.bind().
I'm writting a program that simulates nodes in network. Every node is listening to some port on local for incoming requests. If a request is received it replies to sender of the request. The reply is sent after a socket is created associated with the address of the sender of the request. Since sender is using some port on localhost and has used bind to listen to id, trying to bind to the same port with an other process results in a messages that states that the port is already taken (bound).
How should I solve this in order to be able to simulate server/client on the same machine? I am using UDP protocol for this program.
You solve this by using different ports for client and server interaction. A useful example would be how client and server interact during DHCP. The client sends requests via UDP on port 67 and the server sends responses back via UDP on port 68.
I have an existing app which broadcasts UDP packets containing text.
Is it possible to write a GoogleCast Receiver app which will listen for these messages (from specific IP address and port) and display them on the TV?
Because I already have the software (VB) to broadcast the packets, I don't really want to have to write a sender app
A sender app doesn't broadcast anything; the sender app just communicates with the Chromecast to instruct it how to load the receiver and to pass any instructions from the viewer. So you'll still need to write both ... the sender will be sort of the remote control (to at least get the communication started), and the receiver will be the consumer of the UDP packets that the Chromecast displays.
Can you please explain following doubts?
When my j2me application is listening for sms on specific port, will it run as a server or client? Because if the two application run on same port, who will receive the sms?
And please suggest me, which port I should use to receive the sms, so that I would not loose any sms which is supposed to receive. Actually I have seen the answer for this same question. But I have not got the clear idea. Please suggest me on this.
I am little bit confused. I think when your first application is listening a particular port ( suppose 5001 ) then the other application can not listen it. It might throw error.
for the second question please check this url. This Url will tell you which port you should not listen for your development purpose.
Is it possible to have a j2me app on a mobile to act as a "SMS gateway" that will handle incommming messages, do a query on a database via GPRS and reply the user back?
This is entirely possible on any J2ME handset that supports JSR 120 (i.e.: most of them). However as Wonil said, you can't just process ANY incoming SMS message. It has to be an SMS sent to a port number on which your app is listening (using a server connection as Wonil explained).
It wouldn't be automatic unless the app was signed (as confirmation is generally required for sending SMS and network access).
Another approach is to tether your phone to a PC using a USB cable/bluetooth/IR, open a serial connection using the phone as a modem, and write a program to listen for new SMSs using AT+CGML as described here. This would allow ANY incoming SMS to be processed (no port number required), and without any annoying confirmation prompts.
HTH
I think you should check about JSR-120 documentation to confirm.
But, in my thought it might be impossible. If you want to receive message by using JSR-120, you should assign specific end point(port number) to listen as like below:
serverConn = (MessageConnection)Connector.open("sms://:5000");
So, you can't catch all SMS messages. It can't be a gateway then.
It probably depends if your phone supports it. Have a look at the J2ME Wireless Messaging API:
The Wireless Messaging API (WMA) is an optional package for the Java 2
Platform, Mobile Edition (J2ME) that
provides platform-independent access
to wireless communication resources
like Short Message Service (SMS).
http://java.sun.com/products/wma/overview.html
This article has some examples which can probably serve as a starting point for what you want to achieve: http://www.ibm.com/developerworks/wireless/library/wi-extendj2me/
Edit: as others have pointed out, you might not be able to receive all messages.