|
-
Jul 26th, 2006, 12:48 AM
#1
Thread Starter
Fanatic Member
auto-send sms
hi, whats wrong with my code?
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
private void sendSMS(){
MessageConnection conn = null;
try {
conn = (MessageConnection) Connector.open("+1234567890");
TextMessage msg = (TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setPayloadText("hello world  ");
conn.send(msg);
} catch (IOException ex) {
ex.printStackTrace();
} finally{
if(conn != null){
try {
conn.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
}
when i compile this it shows
Project "sms" loaded
Project settings saved
Building "sms"
C:\WTK25\apps\sms\src\sms.java:1: 'class' or 'interface' expected
private void sendSMS(){
^
1 error
com.sun.kvem.ktools.ExecutionException
Build failed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|