×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    1

    to receive and send sms from and to mobile and PC in java

    hi friends . i am developing a project by which any student of my college can receive his result by sending sms to a mobile which is connected to computer.then computer will search his result and send his result in form of sms to mobile which is connected to computer.Then this mobile will send that sms to user. can u help me how to receive and send sms from mobile to pc in java code. can you help me by providing java code. i will be grateful to u if u help.

  2. #2
    Registered User
    Join Date
    Sep 2010
    Posts
    2

    Re: to receive and send sms from and to mobile and PC in java

    heyy manoj..which cellphone are you using..
    i am able to send sms using my nokia phones but not able to receive any sms..
    the command AT+CNMI is giving error..
    please help
    i am using nokia 6085 and 5130-c2

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    3

    Re: to receive and send sms from and to mobile and PC in java

    I remember that I had the same problem working on a mobile phone.

    I think most of them don't support this , here is a link http://www.developershome.com/sms/ch...andSupport.asp

    Not sure but try this AT+CNMI=? it should show you if the command is supported.
    I am using an industrial GSM modem and it returns:

    +CNMI : (0-3)(0 -3)(0,2)(0-2)(0,1)

    If your mobile phone supports it then try the fallowing sequence of commands:

    ATZ
    AT+CMGF=1
    AT+CNMI=2,1

    Hope it helps,
    Dobre

  4. #4
    Registered User
    Join Date
    Sep 2010
    Posts
    3

    Re: to receive and send sms from and to mobile and PC in java

    Quote Originally Posted by manoj_2580 View Post
    hi friends . i am developing a project by which any student of my college can receive his result by sending sms to a mobile which is connected to computer.then computer will search his result and send his result in form of sms to mobile which is connected to computer.Then this mobile will send that sms to user. can u help me how to receive and send sms from mobile to pc in java code. can you help me by providing java code. i will be grateful to u if u help.
    I didn't try this in Java , but I have an old sample to exaplin the concept:

    This is written in Delphi:
    Code:
    procedure TForm1.SendSMS(tel,mesaj:string);   
    begin
    ComPort1.Writestr('ATZ'+chr(13)); // reset device
    delay(1000);
    ComPort1.Writestr('AT+CMGF=1'+chr(13)); //  operate in SMS text mode.
    delay(1000);
    ComPort1.Writestr('AT+CMGS="'+tel+'"'+chr(13));
    delay(1000);
    ComPort1.Writestr(mesaj + chr(26)); // character with ascii code 26
    delay(3000);
    end;
    There must be a serial port component in Java and the code would look similar.

    The reason why I put a delay there is because it takes a while to execute the command , normally this is not the correct way to do it but it works.
    The best way to do it is to have a handler , that reads the data received from the mobile phone.

    When you send ATZ you have to wait to receive an OK and only after that send the next instruction AT+CMGF=1 , and so on...

    Try just to send an SMS for now, and then try to implement the receive SMS feature.

    If you try to code it in C sharp I could help you faster with concrete sample code , I am currently working on something very similar in C sharp.
    All the best,
    Dobre
    Last edited by dobre88; 2010-09-17 at 18:00.

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    1

    Re: to receive and send sms from and to mobile and PC in java

    Quote Originally Posted by dobre88 View Post
    I remember that I had the same problem working on a mobile phone.

    I think most of them don't support this , here is a link http://www.developershome.com/sms/ch...andSupport.asp

    Not sure but try this AT+CNMI=? it should show you if the command is supported.
    I am using an industrial GSM modem and it returns:

    +CNMI : (0-3)(0 -3)(0,2)(0-2)(0,1)

    If your mobile phone supports it then try the fallowing sequence of commands:

    ATZ
    AT+CMGF=1
    AT+CNMI=2,1

    Hope it helps,
    Dobre
    I have a question. How to send mms in PDU ???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×