0

i m new to sms lib api i never used api's before please would you give me some help how to use it from strart to end for sending and receiving sms using Gsm modem in eclipse. please it is an emergency my final year project is based upon it. please it will be a great favour..thanks in advance

Shishir Kumar
  • 7,981
  • 3
  • 29
  • 45
Sanaullah
  • 11
  • 1
  • 1
  • 3
  • 1
    Have you tried looking for some tutorials on this topic? – PakkuDon Mar 23 '14 at 05:51
  • 1
    yes i looked upon them but can't find any usefull help regarding this. – Sanaullah Mar 23 '14 at 06:16
  • Could you post what you tried? – bjb568 Mar 23 '14 at 06:16
  • 2
    i read the complete documention of SMSLIB API but can't find any solution i have the code of SMSLIB API for sending and receiving SMS using GSM modem but don't have any idea how to use it..... – Sanaullah Mar 23 '14 at 06:18
  • If you have tried something, edit your original post and published what you've tried and what errors/issue came up. Otherwise, you show no research effort. This is not a 'write my code for me' site. – Noich Mar 23 '14 at 07:23
  • 1
    @Howard, hardly comparable. The one you linked to asks a specific question, not (unlike here) how to write a HW task from scratch. (BTW, I usually do not vote down or for closing but rather ask the user to show a minimal research effort.) – Noich Mar 23 '14 at 08:51

1 Answers1

6

Assumption:

  • You have java1.5 or higher installed on your Computer
  • You are on Windows OS
  • Your java installtion directory JAVA_HOME = c:\java\jdk1.5
  • You have no separate jre installed on your pc ( you are using jre that is loacated at JAVA_HOME\jre)
  • You have any java supported mobile phone,

Here we will connect PC with any java supported mobile via "Standard Serial Over blue tooth link".

STEP 1. Download SMSLib src from here

STEP 2. Download RXTX from here.

STEP 3. Download CommonsNet from here.

STEP 4. Download javacomm20-win32 from here.

STEP 5. Download slf4j-1.5.6 from here.

STEP 6. Download log4j-1.2.8.jar from here.

STEP 7. Unzip all the files in suitable location

STEP 8. Copy following files to JAVA_HOME\jre\lib\ext

  1. commons-net-2.0.jar from CommonsNet\commons-net-2.0.jar
  2. comm.jar from javacomm20-win32\commapi\comm.jar
  3. javax.comm.properties from javacomm20-win32\commapi\javax.comm.properties
  4. RXTXcomm.jar from rxtx-2.1-7-bins-r2\RXTXcomm.jar
  5. All the jar from slf4j-1.5.6\*.jar
  6. smslib-3.4.1.jar from smslib-v3.4.1-bin\dist\lib\smslib-3.4.1.jar

STEP 9. Copy following files to JAVA_HOME\jre\bin

  1. win32com.dll from javacomm20-win32\commapi\win32com.dll
  2. rxtxSerial.dll from rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial.dll
  3. rxtxParallel.dll from rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxParallel.dll

STEP 10. Copy following files to C:\Program Files\WINDOWS\system32

  1. win32com.dll from javacomm20-win32\commapi\win32com.dll
  2. rxtxSerial.dll from rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxSerial.dll
  3. rxtxParallel.dll from rxtx-2.1-7-bins-r2\Windows\i368-mingw32\rxtxParallel.dll

STEP 11. If you are using any java IDE (i.e netbeans) then create new project, add source packages smslib-v3.4.1-src\src\java. You need to have all the file of STEP 8 in your class path.(to compile the project) and build project. Set misc.CommTest as main class of the project.

STEP 12. Connect Bluetooth device to your computer's USB port. If PC prompts you for driver installation then install the driver. If your PC can not find any suitable driver the get the driver from some where for Standard Serial Link Over Bluetooth

STEP 13. Once the driver is installed start Bluetooth of mobile phone.

STEP 14. Open control panel --> BueTooth Device

  • click add
  • check 'select passkey for me'
  • click next
  • system will display pass key
  • accept connection from mobile phone using that pass key(allow connections without prompt)

STEP 15. Open control panel/Phone and modem You should see one modem attached to port like 'COM5' in modem list.

STEP 16. Run misc.CommTest and wait for program to complete. When program completes, Note-down for which values of baud rate and comm port. The program will print text like below:

Getting Info :
(some text)(model name of us phone) i.e (Some text)Nokia7210 Suppernova.
You have to note values for the com port attached to your modem in modem list ( comtrol panel /phone and modem)

STEP 17. Open examples.modem.SendMessage.java file in your IDE and modefy following line according to your environment.

SerialModemGateway gateway = new SerialModemGateway("modem.com1", "COM1", 57600, "Nokia", "6310i");
  1. First arg = here first argument of the SerialModemGateway() constructor can be any String
  2. 2nd Arg = com port (port attached to your modem in modem list (control panel /phone and modem))
  3. 3rd arg = baud rate for which commtest got info(refer to step 16)
  4. 4rth arg = manufacturer of your mobile phone i.e Nokia , SAMSUNG
  5. 5th arg = Model name of your mobile phone (refer to step 16)

Modify following line

msg = new OutboundMessage("+00123456567889", "Hello from SMSLib!");
here replace +00123456567889 with +<your number with ISD code>

add following line some where after instantiation of SerialModemGateway

gateway.setSMSCNumber("+919825068000")

This smsc number can be found from you mobile's 'Message'/'Message Settings' depending on your mobile phone software

STEP 18. Run examples.modem.SendMessage.

Source: http://sendsmsusingsmslib.blogspot.in/

Shishir Kumar
  • 7,981
  • 3
  • 29
  • 45
  • thanks shishir sir for your help i m doing this if i found any kind of problems i will contact with you agin. – Sanaullah Mar 23 '14 at 11:13
  • sir i actually tried your code when i execute the step no 16 instead of showing the correct result the error i m facing is the following i m using netbeans 8.0 error is run: C:\Users\SanaUllah Amin Malik\AppData\Local\NetBeans\Cache\8.0\executor-snippets\run.xml:48: Cancelled by user. BUILD FAILED (total time: 1 second) – Sanaullah Mar 23 '14 at 15:34
  • @Sanaullah did you solve your problem? were you able to send sms? – Usman Riaz Sep 04 '14 at 05:12