Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  Question Asked By: Ravi Kancharla   on May 23 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Abhishek Singh   on May 23

1.import com.simplewire.sms.*;
2.
3.public class send_text
4.{
5. public static void main(String[] args) throws Exception
6. {
7. SMS sms = new SMS();
8.
9. // Subscriber Settings
10. sms.setSubscriberID("123-456-789-12345");
11. sms.setSubscriberPassword("Password Goes Here");
12.
13. // Optional Message Settings
14. // Specify source and destination ports that will appear
15. // in the GSM User-Data-Header
16. //sms.setSourcePort((short)0x0000);
17. //sms.setDestPort((short)0x0000);1
8. //
19. // Specify a network type "hint" - helps Simplewire
20. // choose between a TDMA vs. GSM network for example.
21. // Only useful for certain types of messages such as
22. // WAP push or MIDP Java WMA messages and if the destination23. // operator runs both TDMA and GSM networks.
24. // sms.setNetworkType(SMS.NETWORK_TYPE_GSM);
25.26. // Message Settings27. sms.setMsgPin("+11005101234");
28. sms.setMsgFrom("Demo");
29. sms.setMsgCallback("+11005551212");
30. sms.setMsgText("Hello World From Simplewire!");
31.
32. System.out.println("Sending message to Simplewire...");
33.
34. // Send Message
35. sms.msgSend();
36.
37. // Check For Errors
38. if(sms.isSuccess())
39. {
40. System.out.println("Message was sent!");
41. }
42. else
43. {
44. System.out.println("Message was not sent!");
45. System.out.println("Error Code: " + sms.getErrorCode());
46. System.out.println("Error Description: " + sms.getErrorDesc());
47. System.out.println("Error Resolution: " + sms.getErrorResolution() + "\n");
48. }
49. }50.}

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on send sms programme Or get search suggestion and latest updates.


Tagged: