| Reply | « Previous Thread | Next Thread » |
|
Hi
I am a java developer from South Africa. I am trying to write a sms midlet using the NOKIA 3410 api and emulator. But up to now I could not get my application to work. here's my code: public class SMS1000 extends javax.microedition.midlet.MIDlet { public void startApp() { System.out.println("start"); sendBookMark(); System.out.println("end"); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void sendBookMark() { String gsm_number = "0833024749" ; try { String addr = "com.nokia.sms://"+gsm_number; System.out.println("start connection"); MessageConnection conn = (MessageConnection)Connector.open(addr); System.out.println("conn made"); TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE); msg.setPayloadText("test sms"); conn.send(msg); System.out.println("msg send"); }catch(Exception e) { System.out.println(e); } } } The code compiles without any problems. But as soon as the midlet tries to make the connection to send the sms it throws an IOException. And I tried everything to get it to work but I had no luck. I would really appreciate it if you could help me. You can email me: johan.meyer@intec.co.za |
|
Hello
It would be good to use constructor in your code, and make also high level UI komponent that has a command send. Here is the send method which should work. public void sendBookMark() { String Pnumber = "123"; String Message ="Message"; try { String addr = "com.nokia.sms://"+Pnumber; MessageConnection conn = (MessageConnection)Connector.open(addr); TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE); msg.setPayloadText(Message); conn.send(msg); }catch(Exception e) { System.out.println(e); } } Remember to import all necessery libraries: import javax.microedition.lcdui.*; import javax.microedition.midlet.MIDlet; import com.nokia.mid.messaging.*; import javax.microedition.io.*; Download the latest vesion of 3410 SDK from forum nokia web pages. I hope this helps you |
|
I managed to solve my problem. All I needed to do was to upgrade my cellphone's software. I am currenlty running version V05.06 of the NOKIA 3410 software and the SMS application is working perfectly.
|
|
Glad ya solved your problem....
You are the first South African I've come across in the forum. This is just a friendly HI! and Good Luck with your mobile developments... |
| Psychocrackpot |
| View Public Profile |
| Find all posts by Psychocrackpot |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|