Reciving sms in a handset

Hai all
I am trying to receive sms in a mobile i have application in a j2me but it does not accept incomming messages in a real mobile in emulator it is perfecly alright
.import javax.microedition.midlet.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.wireless.messaging.*;
import java.io.IOException;
public class SMSReceive extends MIDlet
    implements CommandListener, Runnable, MessageListener {
    Command exitCommand  = new Command("Exit", Command.EXIT, 2);
    Command replyCommand = new Command("Reply", Command.OK, 1);
    Alert content;
    Display display;
    Thread thread;
    String[] connections;
    boolean done;
    String smsPort;
    MessageConnection smsconn;
    Message msg;
    String senderAddress;
    Alert sendingMessageAlert;
    Displayable resumeScreen;
public SMSReceive() {
        smsPort = "5000";
        display = Display.getDisplay(this);
        content = new Alert("SMS Receive");
        content.setTimeout(Alert.FOREVER);
        content.addCommand(exitCommand);
        content.setCommandListener(this);
        content.setString("Receiving...");
        sendingMessageAlert = new Alert("SMS", null, null, AlertType.INFO);
        sendingMessageAlert.setTimeout(5000);
        sendingMessageAlert.setCommandListener(this);
        resumeScreen = content;
public void startApp() {
         String smsConnection = "sms://:" + smsPort;
         if (smsconn == null) {
            try {
                smsconn = (MessageConnection) Connector.open(smsConnection);
                smsconn.setMessageListener(this);
            } catch (IOException ioe) {
                ioe.printStackTrace();
        connections = PushRegistry.listConnections(true);
        if (connections == null || connections.length == 0) {
            content.setString("Waiting for SMS on port " + smsPort + "...");
        done = false;
        thread = new Thread(this);
        thread.start();
        display.setCurrent(resumeScreen);
public void notifyIncomingMessage(MessageConnection conn) {
        if (thread == null) {
            done = false;
            thread = new Thread(this);
            thread.start();
public void run() {
         try {
            msg = smsconn.receive();
      StringBuffer buf = new StringBuffer();
                 String s=(((TextMessage)msg).getPayloadText());
     Display dis=Display.getDisplay(this);
     TextBox textbox=new TextBox("MESSAGE",s,17,0);
     textbox.addCommand(exitCommand);
     textbox.setCommandListener(this);
        dis.setCurrent(textbox);
        } catch (IOException e) {
            // e.printStackTrace();
public void pauseApp() {
        done = true;
        thread = null;
        resumeScreen = display.getCurrent();
public void destroyApp(boolean unconditional) {
        done = true;
        thread = null;
        if (smsconn != null) {
            try {
                smsconn.close();
            } catch (IOException e) {
                // Ignore any errors on shutdown
public void commandAction(Command c, Displayable s) {
        try {
            if (c == exitCommand || c == Alert.DISMISS_COMMAND) {
                destroyApp(false);
                notifyDestroyed();
            } else if (c == replyCommand) {
        } catch (Exception ex) {
            ex.printStackTrace();
}In the above code i had changed the smsconnection string to
sms://00919895051914:0
still it not receives (my mobile service provider is airtel in kerala india)
above number isthe smssenter number.
what i have to do
by
Hasanul Banna
Thanks in anticipation

Hello Ahmad,
the server may send the image in "chunked encoding", and your code is not prepared for it.
c.getLength() returns -1 then.
Also, you may test the image creation method with a local file.
Also. maybe this method helps:
Image.createImage(InputStream stream)
Regards
Karsten Meier

Similar Messages

  • Cannot recive SMS after Upgrade to 4.6.1.310

    Hi,
    I hope someone can help me with my SMS issue. I cannot receive any SMS on my BB after the upgrade to v 4.6.1.310.
    If anyone send me a SMS they get the status as Delivered but I dont receive any SMS notification.
    I have no isssue with Sending SMS.
    I have tried my SIm with other handsets and I can receive SMS on other handsets.
    Please someone Help.

    Same problem
    I recently exchanged at Apple Store my iPhone 3GS, which had been desimlocked.
    I changed carrier yeserday - phone was OK.
    After upgrade to 6.1 later in the day, the phone was simlocked on the former carrier !

  • My iphone 5 send sms but not recive sms

    IPhone 5 sends text messages but not recive text messages when the message sent from another mobile phone I notice that the message
    Send but to not recive to my mobile

    For me I get sms but cannot send any. I am using IOS 6.1 on IPohone 5

  • BB pearl 8130 having troble sending and reciving SMS from verizin cell phones

    when I send a SMS to a verizin cell phon somtimes the phone gets it some time it dose not.  I don't have verizin i have alltel.  also i dont recive text from my freinds ether.  someone please help me!!!

    Hello Fenrir,
    Welcome to the BlackBerry Support Community Forums.
    Can you please specify the version of the hand held software on your BlackBerry Smartphone. Options>About (3rd line from the top). Can you also clarify what is happening when you try to send an email, when does this issue occur?
    Thank you
    -DrP
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click Solution? for posts that have solved your issue(s)!

  • Send/recive SMS through usb cabel and nokia pc suite

    Hi All,
    I'm new here and I hope to get support,
    I connect my mobile nokia 3110c to the pc using usb and nokia pc suite everything is fine and work,
    Now, My goal is to send sms using java file called after insert trigger on oracle DB
    How can I do this? What I should using socket or....? What I should read? or using any other sms server program or any example.
    Thanks in Advance,
    Manssi
    Edited by: JavaIQ on Oct 2, 2007 10:10 AM

    {color:#000080}Nokia PC suite is not required, but the modem driver for your device must be available on your PC.
    Download smslib from
    {color}{color:#0000ff}http://code.google.com/p/smslib/{color}{color:#000080}
    Check out the code samples in src/java/examples/modem in the zip file.
    Note that sending SMS through a mobile device will restrict you to about 7-8 messages per minute (typical).
    Darryl{color}

  • I cant send or recive sms only if i on wifi

    I cant send or receive sms only if i am on wi fi

    Hello there, Marisolfromok.
    The following Knowledge Base article provides some great steps for troubleshooting your issue:
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • How to handle multiple SMS using push registry

    Hello all
    I m using push registry. for incomming sms
    My application have some tasks after reciving sms form a particular phone no. Application will starts When u get a SMS from a number say 122222.
    After reciving an sms application is busy in further task.
    What will happen when another sms comes??
    Will Application Suspendes?? or application listen that sms??

    hi vinay,
    My name is lakshman.I am alos trying to implement the sms and call option to my application.
    If you don't mind can you give me suggestions in the following
    1) how to Implement the call option in our application
    2)how to implement the sms option in our application
    i am waiting for your reply
    thanks in advance
    or else give me the site address where i can find the solutions
    ok thankyou
    lakshman

  • Nokia lumia 800: how to make a backup of sms to pc

    I would like to know how I can make a backup of my sms-messages on my Nokia lumia 800 to my pc (windows vista). I tried Zune, but that programm only gives the possibility to backup pictures and music. Installing Nokia PC Suite didn't work out. I could'nt connect my Nokia lumia 800 to my pc (no possible via usb and bluetooth).
    Thanks for any help!

    You cannot back up SMS from WP7 handsets. The only available workaround is to copy the contents of the messages in a text file and save that to PC.

  • SMS Problems

    I had a BT DECT handset whch was set up for SMS and worked it fine.
    But now the handset has packed up and I've replaced it with a non-SMS one (Gigaset A400) in the belief that incoming texts would be delivered as a voice text.
    I sent an SMS message from my mobile, my landline rang from an 0800 number, but when I answered it was totally silent. The phone rang again shortly afterwards from the same number, but silent gain.
    The problem is I can't cancel text SMS from the handsets, the BT one is broken and the Gigaset won't handle SMS.
    What should I do?
    Thanks,
    Roger.
    Solved!
    Go to Solution.

    A while after I posted I got another call, this time from my own number.
    When I answered it I go the voice-mail menu messages, selecting "listen to new messages" I got the test text (as speech), so it looks like it's sorted itself out.
    Cheers,
    Roger

  • Sms tfrom pc to mobile

    Hi friends i am doing a new product . which deals with sending and reciveing sms from mobile to pc. since i am new to J2ME .could any any one help me regarding this . i am really blank now, pleasse help me out .

    How about using the search? This has been asked many times before..

  • Unable recieve sms messages

    I've got a 6230 which has always worked fine until last week it stopped recieving sms messages.
    I havn't changed any settings on it - the only thing i can think of thats different is that i swapped batteries with a friends phone, but the new battery i have in it is still the standard BL-5C that comes with the model and the phone was recieving messages for at least a day after i changed the battery so i don't know if this is the cause of the problem..
    Any ideas??

    Hi there
    The same thing happened to me on my brand new N95. I went through all possible tests with my carrier and they determined there was nothing wrong on their end. Was so weird as, like you, I could do everything except receive sms. I ended up taking the 10 day old phone back into the shop and they put the sim card in another handset and it didn't receive sms in that handset either, and the shops sim card did receive sms in my handset.
    So I was given a new sim card and problem was fixed. 2 days worth of received sms lost in the ether though No explanation as to why this happened. The sim card was also only 10 days old.
    So I would suggest trying your sim card in another handset and seeing if u still have the same probs.
    good luck!

  • E7: Incoming SMS hanging

    Hello
    I brought my E7  middle of May this year. I was happy in a few weeks, then the phone totally hanged. It was sent to service, and the whole hardware was changed to new.
    Now it have worked very good in a long time, with only small issues that could be related to that i do many tasks a time etc that may do it slower and hanging in a few secs a time.
    Middle of the day today, the phone started with a very confusing thing. I sent SMS, and i didnt understand that the reciver dosnt answared me. I restarted the phone. Now i got a lot of new SMS. I answared. It took a while, so i restarted the phone again, and then i got the answare.
    And a rare thing. When i got the SMS when phone is on again, is that the time of reciving SMS was WHEN the phone WAS on before i restarted. So the phone gets the SMSes, but dosnt show or give any sign about that i have new!
    I have tried to reset to factory settings etc. I use Anna versjon of Symbian. 

    am sorry but what exactly is your problem?

  • Auto reaction alerts on SMS

    Hi All,
    I have installed CCMSPING on satellite system and configured it to CEN on RZ21/RZ20 and i am able to recive mails from solman thrugh SMTP node, now i could like to recive SMS alerts on my mobile.
    Can anyone give me the detailed procedure how i need to go ahead ?
    Please guide me.
    Thanking you in advance...
    Sonali

    Check this Thread for SMS alerts...
    [SMS Alert for Service Desk in Solution Manager|SMS Alert for Service Desk in Solution Manager;
    You may need to implement third party or can do some workaround ...

  • Wi-fi and SMS

    Excuse this question, but I can't find the answer... when I have my 8900 switched to Wi-Fi and the Mobile Network is disabled, will I continue to receive text messages?  I know I'll receive emails, but don't know about texts.
    Thanks in advance.
    Love Me - Love My BlackBerry
    Z10 OS Version: 10.0.10.690
    Z10 Software Release: 10.10.90
    PlayBook - 2.1.0.1526
    Solved!
    Go to Solution.

    Hi!
    As I know. no you will not be abled to recive SMS cuz Mobile Network is disabled.

  • Nokia E63 wont send messages

    Hello
    I have just recieved my new E63 today, and it is all going swimingly- the phone can make phone calls, use the internet, recieve texts, however I CANNOT SEND TEXTS.
    I have endlessly tried to configure the texts, changing the message centre etc., ive run through the troubleshoot guide on the 3 website nothing has worked and i got tired of waiting 20 mins for customer service.
    any ideas, i am on 3 mobile.

    try to insert sim to other device so you would know if its the handset problem or your network operator..if your simcard can send sms using other handset then try to dial this number on your homescreen
    *#7780# default security code is 12345 it will restore uor original phone settings but will not delete any files from your device

Maybe you are looking for

  • Why can't i activate my iphone 3gs after upgrading it to ios 6?

    why can't i activate my iphone 3gs after upgrading it to ios 6? It says, ''There is no sim card installed in the iphone you are attempting to activate'' Thanks for your help in advance! Kayl07

  • Using CORR function with sub-queries

    I need to compute the correlation of two datasets, however here is my problem: The table stores responses to a questionnaire, with these columns: RESPONSE_ID, QUES_ID, ANS_CD What my query needs to get is the Correlation of 2 sets of ANS_CD, one with

  • How to include a time condition in a Vi?

    Hi, I need to run an event for one hour and after this time interval has elapsed, I need to stop this event (let�s call it event A) and go for event B. I have been trying to work with the Elapsed Time (LabView 7.0) sub-vi with no success. That sub-vi

  • XML C++ Parser in Solaris 2.6 could not parse with encoding UTF-16

    I tried to use UTF-16 encoding in the XML C++ Parser in Solaris 2.6. xmlinit() fails and returns error 201 - i.e.Unknown encoding. Though the ORACLE documentation has many encodings including UTF-16. Quite a few of these encodings are not working. Ca

  • Root password half lost :)

    Greetings, I do not understand something on my tiger. If I log in graphicallty as user root, I I can enter using the correct password. I log off, login using my account. Open a terminal and type su to "become"temporaly root. I then type the same pass