File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Product and Other Certifications and the fly likes gets stuck?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark " gets stuck??" Watch " gets stuck??" New topic
Author gets stuck??

chetan dhewal
Ranch Hand

Joined: Nov 07, 2000
Posts: 61
Hi all,

I am trying this code for sending and receiving sms.
The midlet doesnt execute after the call to 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.

for receiving:-

for sending:-


the execution of midlets stops on both send/receive open() calls, at the permission alert.


Chetan Dhewal<br />SCMAD,SCJP 1.2
avi aro

Joined: Apr 13, 2006
Posts: 16
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.
Ransika deSilva
Ranch Hand

Joined: Feb 18, 2003
Posts: 524
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)
chetan dhewal
Ranch Hand

Joined: Nov 07, 2000
Posts: 61

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.

I agree. Here's the link:
subject: gets stuck??
It's not a secret anymore!