Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
javame_black
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Problem in sending SMS through simulator.

Hi,

 

I have tried to run demo program for sending sms through simulator. But I am really not getting how to do that. I have read about it, but still I have no clue of how it should be done.

 

There are two SMS Demo applications one is server and devices. So which application to run. Can someone provide the detailed description of running and sending sms through simulator.

 

Moreover can someone let me know how to run Blackberry simulator or application through command line.

 

Thanks & Regards

Sunil

 

 

Regards
Sunil
Please use plain text.
Developer
javame_black
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Re: Problem in sending SMS through simulator.

Hi,

 

Is there anyone who can guide me about sending sms application. I have tried running both smsServer application but it just dont work. The destination address should be given which number and will this application run in blackberry phone without code signing. I just want to know will this application send message to others without code signing. And does sending messages ask for user permissions. I have prior knowledge of j2me.

 

Any sort of help would be appreciated.

 

Regards

Sunil

Regards
Sunil
Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Problem in sending SMS through simulator.

When using the BlackBerry Simulator, you must use both the client and server smsdemo applications.  The server side does not apply to a real world device.  It is there to demonstrate how an application can send/receive SMS messages to/from the BlackBerry Simulator.

 

If you are testing on a live device you could send the SMS messages to yourself or to/from another mobile device.  Here is an example of the two ways to listen for SMS messages on a BlackBerry handheld.

 

What is - Different ways to listen for SMS messages
Article Number: DB-00579

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
mjrothera200
Posts: 2
Registered: ‎02-18-2009
My Device: Not Specified

Re: Problem in sending SMS through simulator.

Mark -

 

I've been searching the forums for an answer to this question, but cannot find one- - perhaps you can help.  I am trying to create an external Java program that can simulate sending an SMS text message to the blackberry simulator.  I want to be able to send the SMS Text using an external java program, and have it show up in the Blackberry Device simulator.  I understand that this is not a "real-world" situation, but I want to be able to demonstrate it in this fashion.  I have started by trying to run the "smsdemo server" that comes with the samples.  This approach seems inconsistent for some reason -- I was able to get 1 or 2 responses back from the server, but it seems to not function properly all of the time.  I did some debugging and found out that it was reading the packets incorrectly -- the size of the address seemed to be different than what it was expecting.  A couple of questions:

 

1.  Does the SMS Demo Server need to run with a specific blackberry device?

2.  Does the blackberry device need to be set or configured in a certain way so I can get it to run with

3.  Does the SMS Demo Server work in all cases for you and consistently?  Any other advice?  I have turned off firewalls, etc..I ahve tried on JDE 4.2.1 and the very latest (4.7).

4.  Beyond the SMS Demo Server. Do you have a *very simple* external java program that can simulate sending an SMS Text message to the simulator?  I don't want to use a second simulator because I want to be able to do this programmatically with my own java program.

 

Thx for your help,

 

Matt

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Problem in sending SMS through simulator.

The server side smsdemo isn't tied to a particular version of BlackBerry Simulator.  No simulator configuration is required either.  You will need to install and run the smsdemo client side application using a supported version of BlackBerry JDE for the simulator you are testing on. 

 

What Is - Appropriate version of the BlackBerry JDE
Article Number: DB-00537

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800901/What_Is_-_Appr...

 

Can you elaborate on the problems you are seeing?  What stops working?  Is any exception thrown?  If so, what is it and is it from the client or server sample?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
mjrothera200
Posts: 2
Registered: ‎02-18-2009
My Device: Not Specified

Re: Problem in sending SMS through simulator.

Mark - Thx again for the reply.  I think I understand your note and what I was doing wrong.  It does work if you use the SMS Client Application in conjunction with the SMS Demo Server.  However, I was trying to send an SMS message outside of the SMS client application using just the phone.  When you use it this way, it is inconsistent -- for example, I received one message back, but then all others seemed not to be received.  The outbound message is indeed received by the smsdemo server, but the response from the smsdemo server is not always received by the simulator.  Can you comment on why this works this way?  Are the packets somehow different between the SMS client application and what is generated off of the phone?

 

Now to the real question:  I would really like a method to be able to send an SMS text message from an external java program to the Blackberry Device simulator, and have it show up in the messages section of the device simulator.  In other words, I don't want to have to initially send an SMS text message from the device simulator, and I don't want to have to write a specialized Blackberry application to do it.  From the results above, it would appear that the smsdemo server is very specific and tied to what is being initially generated out of the SMS client.  Also, I don't quite understand the packet format and am hesitant to try and "reverse engineer" the packet format.

 

So:  Do you have a simple java program that can illustrate sending of a an SMS text message, without first having to receive a message from the simulator?  I would imagine there would be some simple API's I could use to construct the packet for me.  I've seen a lot of examples of constructing packets, but those programs seem to run within the Blackberry Device itself....I need something that runs external.  The flow of my application will be:

 

1.  Blackberry Device receives an SMS text -- shows up in messages section of blackberry

2.  User can choose to reply or not -- the reply would be routed again back to my java program.

 

It seems for requirement #2 I coudl modify the "smsdemo server", but where I am struggling is with #1 = how to construct an SMS packet and send it to the blackberry simulator.

 

Thx again for your help, any advice appreciated.


Matt

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Problem in sending SMS through simulator.

The server side of the smsdemo is designed to communicate with the client side smsdemo sample (it expects a certain message format and send and receives on a specific port).  So you may see odd results if you are sending SMS messages to it from the Messages application. 

 

You could use 2 BlackBerry Simulators to simulate sending an SMS message between 2 devices.

 

Here is how you can simulate incoming SMS messages in the BlackBerry Simulator:

 

1.  Launch the BlackBerry simulator, noting the values specified on the command-line for /sms-source-port and /sms-destination-port


2.  While that simulator is still running, launch another one from the command line but switching the SMS source and destination ports


3.  The 2nd simulator will report port conflicts; continue but note that you will not be able to connect the debugger, MDS Simulator or Email Server Simulator to the second simulator instance.


4.  Send SMS messages from the 2nd simulator.  They should show up in the inbox of the 1st simulator.  Note that these received SMS messages may be incorrectly marked as “read” or “important”.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
rvowles
Posts: 2
Registered: ‎05-29-2009
My Device: Not Specified

Re: Problem in sending SMS through simulator.

I understand what you are trying to do, and I am doing the same. I was just looking around for the internal format of the SMS message and it clearly isn't documented. Poking about seems to have given me a partial solution - just have to figure out how to change the text and I will have an external application that can push arbitrary text messages at the simulator.
Please use plain text.
New Developer
Tredekka
Posts: 5
Registered: ‎06-10-2009
My Device: Storm 9530

Re: Problem in sending SMS through simulator.

Good Evening MSohm, et all.,

 

If you would be so kind as to point me in the right direction, I'd greatly appreciate it....

 

  • Regarding your post below...  (specifically in the:   "Launch the BlackBerry simulator"   section)

 

Here is what my shortcut states:

@echo off
fledge.exe /app=Jvm.dll /handheld=9530 /session=9530 /app-param=DisableRegistration /app-param=JvmAlxConfigFile:9530.xml /data-port=0x4d44 /data-port=0x4d4e /pin=0x2100000A

So I'm not sure where the "/sms-source-port and /sms-destination-port" part applies.?.

 

  • Secondly, elsewhere you allude to:
SMS Client Application in conjunction with the SMS Demo Server

Where do I find both of these items?

 

  • Finally, though not directly related to the above... What is the store/folder/object/collection where the existing SMS & MMS messages are stored?

 

Currently, I'm exploring      Folder[] foldersArr = store.list();   but I'm not so sure I'm on the correct track.

 

Thank you in advance,

 

G

 

 

Please use plain text.
New Developer
Tredekka
Posts: 5
Registered: ‎06-10-2009
My Device: Storm 9530

Re: Problem in sending SMS through simulator.

Ok, did some more digging (plus an excuse to try M$ Bing... not bad...) and found one of my own answers...  In -->

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=280#M280

&

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=4

Mark Sohm states:  "You are not able to access SMS messages that are stored on a BlackBerry."

 

Well, that's pretty clear, thanks Mark (sincerly...) but does not answer a very big "why"???  So any chance a BlackBerry Support person would care to answer why not? ... it appears you can go through the normal message inbox (though I've not tried that as of yet, because my focus is on SMS.)  So please answer why...

 

Thank you,

 

G

Please use plain text.