This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes How to send /receive SMS using the siemens tool kit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How to send /receive SMS using the siemens tool kit" Watch "How to send /receive SMS using the siemens tool kit" New topic

How to send /receive SMS using the siemens tool kit

Rishi Tyagi
Ranch Hand

Joined: Feb 14, 2002
Posts: 100
Hi everybody,
i want to make an application for the siemens sl45i model which can send and receive sms using phone existing connection.
I tried with the SMS class given in ....gsm package of smtk API but failed .
What i have done is :
1- i made an application which uses method in SMS class of the API given by siemens for sending the sms.
2- i run this application on sl45i and m50 emulators.
3- my computer is connected with the internet using DSL Network
I received the following error while running the application
Now My question is :-
1- Is there any other setting is to be done for running the application in emulator.
2- What are the differences are to be made in the aspplication before running the application on the real phone.

I will be really thankfull if anybody can help at this problem
Thanks in advance
sameet more

Joined: Dec 19, 2001
Posts: 10
For sending sms u erquire a sim card.i tested
it on the actual device and thru it u can send sms but cannot recieve it

sameet more <P>wireless java programmer
Rishi Tyagi
Ranch Hand

Joined: Feb 14, 2002
Posts: 100
Dear Sameet,
Thanks for the help extended.
But still there is one problem.
Now i copied the programme into the real phone through data exchange software
while running the application it gives SMS.send(String,String) method returns 18 means 18 characters sent. but the message never reach to the destination.
Could you please help me what could be the reason for this problem?
I am just writing my code here below.

//****************code starts***********
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class sms1 extends MIDlet implements CommandListener
private Form form;
private Command cmdOk,cmdExit;
private TextField msg;
public sms1()
public void startApp()
Display d=Display.getDisplay(this);
form=new Form("Send SMS");
msg=new TextField("Dest No",null,160,2);
cmdOk=new Command("Send",Command.SCREEN,0);
cmdExit=new Command("Exit",Command.SCREEN,0);
public void pauseApp(){}
public void destroyApp(boolean b){}
public void commandAction(Command c,Displayable d)
int rep=0;
String err_msg="";
String dest_no=msg.getString();
rep=SMS.send(dest_no,"test from j2me app");
}catch(Exception e)
err_msg="error :"+e.getMessage();
System.out.println("error :"+e);
else if(c==cmdExit)
{ notifyDestroyed();
sameet more

Joined: Dec 19, 2001
Posts: 10
Well the problem with ur code is
create an object of the SMS class
SMS sms = new SMS();
then use this object to send the sms
I agree. Here's the link:
subject: How to send /receive SMS using the siemens tool kit
It's not a secret anymore!