I am trying this code for sending and receiving sms. The midlet doesnt execute after the call to Connector.open() method. When executed , after call to open() the emulator ask for "permission" to use message. I click yes/no but the emulator doesnt grant permission and nothing happens. The midlet gets stuck at this alert(permission to use message). I hav given the permission for send& receive in project setting also but avail to no use.
Code... --------------------------- for receiving:- msgcon=(MessageConnection) Connector.open("sms://:1234");
for sending:- msgcon=(MessageConnection) Connector.open("sms://5550000:1234");
the execution of midlets stops on both send/receive open() calls, at the permission alert.
Hi, Do you have network access while using emulator. Please note that while you are behind the proxy, you should make sure that you set the proxy settings in order for emulator to connect to network. Thanks,
Hi, I think this is due a fundamental rule of IO. Did you open the connection in a different thread. If not the UI gets frozen. Always do the IO in a new thread. Regards.
SCJP 1.4, SCMAD 1.0<br />SCWCD, SCBCD (in progress)
Joined: Nov 07, 2000
The problem was , i dint do the call to open in a different thread, i did it in the commandaction() , the sun emulator was throwing a warning to open the connection in different thread, bt i overlooked it since it was just warning. now i hav come to know that the Sun emulator doesnt let the code go forward if the open()/send()/receive() calls arn't made in seperate thread.
I made 2 different classes for sending and receiving (both implementing Runnable) and put the open+receive and open+send code in their respective run method and guess what the code ran smoothly.