Application for receiving application not working..

Hi..experts.
i m new to j2me programming. plese help me.
I got an application for receiving SMS from net. i nstalled it on nokia N73. but it's not working.
this is the code of that app...
package receivedemo.sms;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import javax.microedition.midlet.*;
import java.io.*;
public final class ReceiveMidlet extends MIDlet
//The data we expect to receive.
private static final String TEST_DATA = "This is just a test";
public ReceiveMidlet()
//Signals the MIDlet that it has entered the Active state.
public void startApp()
//Get the display object for this MIDlet.
Display d = Display.getDisplay(this);
//Create and start a new WorkerThread.
Thread t = new WorkerThread();
t.start();
//Create a new Alert.
Alert alert = new Alert("Starting DynamicPushRegisry");
//Display the alert for 2 seconds.
alert.setTimeout(2000);
d.setCurrent(alert);
private class WorkerThread extends Thread
public void run()
//Get all connections registered with the PushRegistry
//for the current MIDlet suite.
String[] connections = PushRegistry.listConnections(true);
if ( connections.length == 0 )
//Nothing is registered, register a connection.
try
//Dynamically register a socket connection
//on port 50000.
PushRegistry.registerConnection("socket://:50000",
"receivedemo.sms.ReceiveMidlet","*");
} catch (ConnectionNotFoundException e)
message(e.toString());
} catch (ClassNotFoundException e)
message(e.toString());
} catch (IOException e)
message(e.toString());
else
//A connection is already registered and data is arriving.
//Fetch the incoming data.
fetchData(connections[0]);
//Shut down to wait for data.
message("Done");
System.out.println("correct till here");
notifyDestroyed();
//Fetches the incoming data.
private void fetchData(String connection)
try
//Open the connection.
Connection c = Connector.open(connection);
if ( c instanceof StreamConnectionNotifier )
//Open an InputStream.
StreamConnectionNotifier scn = (StreamConnectionNotifier)c;
StreamConnection sc = scn.acceptAndOpen();
InputStream input = sc.openInputStream();
//Extract the data from the InputStream.
StringBuffer sb = new StringBuffer();
byte[] data = new byte[256];
int chunk = 0;
while ( -1 != (chunk = input.read(data)) )
sb.append(new String(data, 0, chunk));
//Close the InputStream and StreamConnection.
input.close();
sc.close();
String s = sb.toString();
//Test the data for validity.
//If invalid an exception is thrown.
Assert.assertTrue(TEST_DATA.equals(s),
"Failed to receive proper string: " + s);
//Display the received data.
message("Received: " + sb.toString());
} catch (IOException e)
message(e.toString());
//Display a String message to the user.
private void message(String msg)
//Create a new Alert with the message.
Alert alert = new Alert(msg);
//Display the alert for 5 seconds.
alert.setTimeout(5000);
Display.getDisplay(this).setCurrent(alert);
//Signals the MIDlet to stop and enter the Pause state.
public void pauseApp()
//Signals the MIDlet to terminate and enter the Destroyed state.
//Unconditional when set to true. The MIDlet must cleanup and release
//all resources. Otherwise, the MIDlet may throw a
//MIDletStateChangeException to indicate it does not want to be
//destroyed at this time.
public void destroyApp(boolean unconditional)
//Throws an IllegalStateException with the supplied error message.
final class Assert
private Assert()
static public void assertTrue(boolean exp, String failmsg)
if (!exp)
throw new IllegalStateException(failmsg);
plzz help me...it's important for me. Thanks a lot

when i send a SMS there is no reaction from application.
i don't know how is this failing.
i am very troubling about this.
i have to receive the SMS that comes to the inbox.
if you have any working source code please give me.
Thank you so much.
Edited by: RavindraDiwakar on Sep 14, 2008 8:17 PM

Similar Messages

  • Applications associated with workstations not working

    Hello,
    I have onld zen 7.x, on netware.
    Applications associated with workstations not working or appearing in one container. Not sure if it every worked. Apps work fine with users.
    I am in a bind, since I need to get the app out in the workstation space.
    It maybe rights or simple install error with the ZEN from the begining.
    thanks for any help or ideas.. Yes I know I need to get to Zen 11.
    Phil

    PhilJannusch,
    > Applications associated with workstations not working or appearing in
    > one container. Not sure if it every worked. Apps work fine with users.
    >
    > I am in a bind, since I need to get the app out in the workstation
    > space.
    Please tell us more as "not working" can mean a lot of things. So:
    Are they user or workstation associated?
    Are those for whick they do not work (users or workstations) all in the
    same container?
    In what way do they not work?
    Any errors?
    Anders Gustafsson (NKP)
    The Aaland Islands (N60 E20)
    Have an idea for a product enhancement? Please visit:
    http://www.novell.com/rms

  • HT1296 i changed my laptop and install a new itunes on it, the usual basic i authorized my new laptop and downlad applications on it but my i tunes does not sync with my ipod i alreadt reinstall and downloaded all the application still it does not work pl

    i changed my laptop and install a new itunes on it, the usual basic i authorized my new laptop and downlad applications on it but my i tunes does not sync with my ipod i alreadt reinstall and downloaded all the application still it does not work please me...tnx

    anyone please help!!!tnx

  • The file to download the app for Android is not working from my phone--it says that the file isn't there. However it does see the one for the Iphone (even though it can't use it). I'm very computer literate and am pretty sure the problem is on your end.

    The file to download the app for Android is not working from my phone--it says that the file isn't there. However it does see the one for the Iphone (even though it can't use it). I've tried it multiple times and continue to get the same message: "NOT FOUND The requested item could not be found". I also tried through the Market application on the phone but ended-up with the same result.
    I'm very computer literate and am pretty sure the problem is on your end. If this is the case then no one can download the app. I considered that perhaps because it's still in Beta that it was removed due to some other type of software issue. I would really like to use Firefox on my new Droid (2.0); when with this be available?

    Firefox will not appear in the Market for most phones with incompatible hardware. You can check if your phone is supported here:
    https://wiki.mozilla.org/Mobile/Platforms/Android
    Even on some supported devices, a bug in the Market software prevents Firefox from showing up. This may be related to the fairly recent Android Market app update. If you go to Settings/Applications/Market and choose "Uninstall" you can uninstall the update, and then search for and install Firefox from the marketplace.
    Or, if you have a supported phone, you can download the app directly by typing this address into your phone's browser: http://bit.ly/fxbeta3
    (Note: To download the app directly for an AT&T phone, you will have to search for instructions on "sideloading" the APK file, since AT&T disables the option to install from non-Market sources.)

  • Skype for android still not working

    Since nearly to months now skype for android is not working on my phone. Reinstalling and uninstalling and then reinstalling does not help. Erasing and cleaning up eather.
    It seems that the skype account is not being accepted on the phone . any sugestions?
    Greetings

    Long hold on the Skype installation item in the Store application and select "Cancel". Then move to your phone's application list, find Skype there and select "Uninstall".
    After that reboot your phone and install from the Store again.
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Lion - 2004 MS Office for Mac will not work

    My 2004 version of Microsoft Office for Mac will not work in Lion. I suspect because this is a PowerPC application. My question is this:
    Is there any program out there which will map the PowerPC to an Intel format? Other than trying to seel more products, I am surprised that Apple does not supply a mapping program for products made by Microsoft for the Apple devices.

    Eric, can you tell me where please? It's not mentioned on the Lion compatibility pages at all. (http://www.apple.com/uk/macosx/what-is/compatibility.html) nor on the 'how to upgrade' page (http://www.apple.com/uk/macosx/how-to-buy/)

  • My email verification for psn does not work...

    My email verification for psn does not work... [email protected] SORT IT OUT SONY.
    Have had a ps4 since xmas day and am still yet to use it.

    1. You must send access code to a phone number that can receive SMS
    2. You can only use one phone number per iPad; cannot share one number with two devices

  • My iphone is out of warranty and the ear receiver is not working

    My iphone is out of warranty, the ear receiver is not working as i cant hear anything from it. Only when i put the phone in speaker mode or plug the headphones i can hear, if i take it to the apple store will it get replaced for a refurbish one?

    I have tried most of the stuff that i have found in here. I held the home button and sleep button until the apple cameout, i plugged in and out the headphones, i blew air into the headphone jack, i restored my phone. I dont think it has to do anything with the earphone jack because when there are hear phones and i bring the volume up or down it doesnt say headphones in the volume bar. Any other suggestions guys? do you guys think that ill get it exchanged at the apple store without a warranty?

  • Iphone 5s receiver /earpiece not working

    My iPhone 5s' earpiece receiver is not working. :( i even tried troubleshooting provided by other threads but still no luck. :(
    Does any of you having the same issue?

    Hey RoviMat,
    Thanks for the question. I understand that you are experiencing issues with the receiver on your iPhone 5s, and that you have already attempted some troubleshooting steps. I wanted to provide the following resource to you in case any steps were missed, and if not, so you can follow the last step to contact Apple for support and service options.
    iPhone: Receiver and call audio quality issues
    http://support.apple.com/kb/ts5196
    Follow these steps to resolve the issue:
    1. Increase the volume during the call.
    2. Make sure nothing is blocking the receiver. If you're using a protective case or display film, remove it and try again.
    3. Make sure nothing is plugged into the headphone jack or the dock connector.
    4. Check the receiver opening to see if it is clogged with debris. If necessary, clean it with a clean, small, dry, soft-bristled brush.
    5. Try another location with better signal. If the audio issue happens only when on a call, it could be due to the location.
    6. If the iPhone is paired with a Bluetooth headset or a car kit, try turning off Bluetooth on your device. Learn more about troubleshooting Bluetooth connections.
    7. Restart the iPhone.
    8. Make sure your device is up to date.
    9. If the issue is not resolved after restoring the iPhone software, contact Apple Support.
    Thanks,
    Matt M.

  • LIRC(serial receiver) does not work.

    Hello,
    i have a PINNCALE Systems Serial IRC receiver, but i don't get it to work.
    [12187.956765] lirc_serial: module is from the staging directory, the quality is unknown, you have been warned.
    [12187.960012] lirc_serial: port 03f8 already in use
    [12187.960018] lirc_serial: use 'setserial /dev/ttySX uart none'
    [12187.960022] lirc_serial: or compile the serial port driver as module and
    [12187.960026] lirc_serial: make sure this module is loaded first
    I have tried to release it with setserial, but it doesn't change anything.
    setserial /dev/ttyS0 uart none
    This error comes when i try to load the kernel modul:
    modprobe lirc_serial
    FATAL: Error inserting lirc_serial (/lib/modules/2.6.38-pae/kernel/drivers/staging/lirc/lirc_serial.ko.gz): Device or resource busy
    kind regards

    This error comes when i try to load the kernel modul:
    But what does dmesg say after this? It should give an explanation I would hope.
    Also you are sure ttyS0 is where you receiver is? By the way I start this lircs service before the lircd service in rc.conf
    #!/bin/bash
    # Releases ttyS0 and loads the lirc_serial module
    # - serial support is built into Arch kernel26
    . /etc/rc.conf
    . /etc/rc.d/functions
    case "$1" in
    start)
    stat_busy "Releasing ttyS0 COM port"
    /usr/bin/setserial /dev/ttyS0 uart none
    /sbin/modprobe lirc_serial
    # Could be needed to stop treating the remote as a keyboard
    #echo "lirc" > /sys/class/rc/rc0/protocols
    stat_done
    stop)
    stat_busy "Unloading LIRC Serial module"
    /sbin/rmmod lirc_serial
    stat_done
    restart)
    $0 stop
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    exit 0
    Just a note for other readers who could have troubles with lirc_serial, my receiver does not work currently, Lirc can't detect it and developers can't fix it. Last lirc where it worked was 0.8.0, on another distribution.
    Edit: I forgot to tell you how to increase verbosity of lirc_serial, this is an excerpt from my modprobe.conf:
    # Set custom options
    #options lirc_serial irq=4 io=0x3f8 sense=1 debug=1
    # Only increase verbosity
    options lirc_serial debug=1
    Last edited by anrxc (2011-05-18 21:31:06)

  • F4 help for 0MAT_SALES is not working in BI 7

    Hi Gurus,
    The F4 help for 0MAT_SALES is not working when distibution channel is selected as (!=02) in Bex Analyzer. But for all other values for distibution channel  i am getting values in F4 help.
    Since 02 is excluded it is supposed to give values for all other combination. but it not so.
    Could anyone of you please help me on this?
    Thanks in advance.

    Closing Thread

  • Short key for copy does not work all the time now.

    After I have installed the latest OSX - Yosemite, my short key for copy does not work all the time.  It is infrequent how it works. I'm using the same keyboard that I have always used, my wireless logitech keyboard for mac.  Please help.

    I've plugged in my default mac keyboard and the short key copy still does not work.

  • I have an iMac with OS Lion. The Smartart feature for Office for Mac will not work when I am logged on to my personal user account. It works with other user accounts on the same computer, and it works after "safe start". How can I fix the problem?

    The Smartart feature of Office for Mac will not work in my user account. It works for all other user accounts on the same computer, and it works after a "safe start". How can I fix the problem?

    You may also want to search/ask in the forums run by the people who make the product which is causing you problems:
    http://answers.microsoft.com/en-us/mac/forum/macoffice2011

  • I purchased PSE 13 but have a Vista OS. It was suggested in this chat room that I download PSE 12. I did that & installed. The serial # for 13 does not work. Any thoughts on how I can get a number for PSE 12?

    I purchased PSE 13 but have a Vista OS. It was suggested in this chat room that I download PSE 12. I did that & installed 12.
    The serial # for 13 does not work. Any thoughts on how I can get a serial number for PSE 12?

    Hi
    There is a newer version of Resolution+ Plug-in released for an Qosmio X series
    [Resolution+ Plug-in v 1.1.2004|http://eu.computers.toshiba-europe.com/innovation/download_driver_details.jsp?service=EU&selCategory =2&selFamily=381&selSeries=231&selProduct=7506&sel ShortMod=null&language=13&selOS=all&selType=400&ye arupload=&monthupload=&dayupload=&useDate=null&mod e=allMachines&search=&action=search&macId=&country =all&selectedLanguage=13&type=400&page=1&ID=82406& OSID=30&driverLanguage=42]
    try it out...
    If it has not been installed properly, try rebooting your computer and reverify.

  • My itnues for pc is not working :( it shows that iTunes has stop working,I have downloaded Itnues many times but still it is not working, please help me

    my itnues for pc is not working it shows that iTunes has stop working,I have downloaded Itnues many times but still it is not working, please help me

    Please helppppp

Maybe you are looking for

  • Site error only on my G5 iMac

    I previously posted this question and am still missing something. I'm reposting in hopes someone can further explain to me what the problem is. This is the original topic: http://discussions.apple.com/thread.jspa?threadID=771703&tstart=150 I created

  • Facetime on my iPhone and iPad

    Can I use the same sign in name to use Facetime on my iPhone and my iPad 2?

  • [iPhone] UIImageView in UIScrollView

    Ok, this is something that's been hanging in my code for a while and I just can't get it to work. I just need my UIImageView to get centered in a UIScrollView and zoom working properly. The Problem is the centering, either you set the Frame of your U

  • How can I keep track of ans of quest ???? [Struts]

    hi, I am trying to develop Question-Answer pages using struts. The problem is when user selectes the right option(radio button) of different different quest. how can i keep track of these selected radio buttons ??? I mean how can i trace the value of

  • 10.4.9 and Logitech Laser Wireless Mouse MX1000

    on my work computer G5 Tower, 10.4.9 and my Logitech don't get along real well. Works good until I hit a series of keys or it just randomly freaks out and I get this weird movement on my screen where the mouse controls the screen. The dock (hiding of