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
BlackBerry Development Advisor
Posts: 15,126
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Unread SMS / Catch SMS

From the previous forums:


Pete Barkley

Posts: 5
From: Toronto, Ontario
Registered: Jul, 2008

Unread SMS / Catch SMS
Posted: Jul 10, 2008 4:29 PM
Reply
1)I am wondering how to get the number of un read sms messages

right now im usuing:

Store s = Session.getDefaultInstance().getStore();
int num = s.getUnreadMessageCount();

but that seems to only get the number of unread emails.

2)Also i am using the SMSDemo app that came with the JDE but it doesnt seem to catch any incomming SMS messages. whenever i get a text it doesnt do anything.

3)What would the "Destination:" be when sending via SMSDemo. right now i am using 1905484#### but it doesnt seem to send, dont know if its the program or the number im using or what.

Thanks,
-Pete

 


msohm

Posts: 2,217
Registered: Jul, 2005

Re: Unread SMS / Catch SMS
Posted: Jul 11, 2008 10:47 AM
Reply
You are not able to access SMS messages that are stored on a BlackBerry. They can only be captured as they arrive.

The smsemo includes a server side component that you can run that allows you to send and receive SMS messages in the BlackBerry Simulator when using the smsdemo.

Mark Sohm
BlackBerry Developer Journal
www.blackberrydeveloperjournal.com

 

Pete Barkley

Posts: 5
From: Toronto, Ontario
Registered: Jul, 2008

Re: Unread SMS / Catch SMS
Posted: Jul 11, 2008 11:32 AM
Reply
Thanks Mark,

But i was reffering to when i add SMSDemo onto my blackberry, it still does not catch or send text messages.

 

msohm

Posts: 2,217
Registered: Jul, 2005

Re: Unread SMS / Catch SMS
Posted: Jul 11, 2008 12:25 PM
Reply
The smsdemo only captures incoming SMS messages sent to port 3590, meaning it'll ignore messages sent to any other port.

Mark Sohm
BlackBerry Developer Journal
www.blackberrydeveloperjournal.com

 

Pete Barkley

Posts: 5
From: Toronto, Ontario
Registered: Jul, 2008

Re: Unread SMS / Catch SMS
Posted: Jul 11, 2008 12:58 PM
Reply
What port are texts normally sent on, i changed it to 0 and still no dice. is there a way to capture every incoming sms message?

If you don't sepcify a port you are able to capture all SMS messages that arrive to the BlackBerry.
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
New Developer
Posts: 19
Registered: ‎07-14-2008
My Device: Not Specified

Re: Unread SMS / Catch SMS

Woah new forums, fancy.

 

Thanks Mark, will give it a try.

New Developer
Posts: 13
Registered: ‎07-17-2008
My Device: Not Specified

Re: Unread SMS / Catch SMS

Hi  ,

                Can you please tell me is there any way to access the inbox,sent folders in blackberry programmatically ,actually i am working on a  syncing application in which I need to sync the messages in these folders using SyncML.

BlackBerry Development Advisor
Posts: 15,126
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Unread SMS / Catch SMS

For information on working with email messages, please see Chapter 11 of the BlackBerry Java Development Environment - Development Guide found here:  http://na.blackberry.com/eng/support/docs/subcategories/?userType=21&category=BlackBerry+Java+Applic...

 

It is not possible to access SMS messages after they have arrived on a BlackBerry.  They can only be captured as they reach the BlackBerry.

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
New Developer
Posts: 5
Registered: ‎08-07-2008
My Device: Not Specified

Re: Unread SMS / Catch SMS

Hi,

 

where can i find the smsdemo server side component. i'm unable to read sms in my application on port 3590. is there any API permission issue ? as i've tried it on blackberry as well but its not working. i've installed on two different phones and send the message at port 3590 but didn't receive any sms msg in the application

 

please let me know how to resolve this issue. there are lots of blackberry experts are there please help me out.

 

i would highly appriciate you prompt response !

 

 

Thanks

Sarfraz Malik

New Developer
Posts: 14
Registered: ‎08-08-2008
My Device: Not Specified

Re: Unread SMS / Catch SMS

Hello Mark,

 

    I'm trying to capture the SMS Messages by creating a Connection with no port as you've specified and I'm always gettings this error on device (is simulator works fine): "operation not permitted on a client connection". If I specify any port I don't get this error on device. Any idea what might cause this? Also I am able to send, retrieve SMS messages on my device.

    The error occures when trying to add a listener with no port specified, or when trying to retrieve an SMS messages like in the SMSDemo app in the JDE.

 

Any help is welcome.

Thanks. 

New Developer
Posts: 5
Registered: ‎08-07-2008
My Device: Not Specified

Re: Unread SMS / Catch SMS

Hi,

 

You can't read SMS without giving a port as per documentation says i also get the same error. but i'm also unable to read sms on port as well.. do you know how can i read sms on port. i've tried on phone and emulator as well with port 3590 but their is no success.

 

in above conversation mark said their is a server side component of sms demo. but i can't find any server side component of sms demo to test it on simulator.

 

please help me with this regard. i would highly appriciate you prompt response. 

New Developer
Posts: 14
Registered: ‎08-08-2008
My Device: Not Specified

Re: Unread SMS / Catch SMS

Hi, 

 

Server side component of SMS demo seems to be here: c:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\samples\com\rim\samples\server\smsdemo\ but I never really used it. However for device testing you'll probably need an SMS Center that will send you messages on a specific port like NowSMS or Clickatell.

 

Also the documentation says (note the example to open a standard SMS Connection):


sms
This protocol opens an SMS connection across the wireless network. The open request should be formatted as follows:

  (DatagramConnection) Connector.open("sms://[<peer_address>]:[<port>]");

where:

  • <peer_address> is the MSISDN of the sender or recipient.
  • <port> is the port number part of the application port number address as specified in the GSM 3.40 SMS specification [1] (sections 9.2.3.24.3 and 9.2.3.24.4). The same mechanism is used, for example, for the WAP WDP messages.

For example, to open a standard SMS connection use

 
Connector.open("sms://");

 


sarfrzmalik wrote:

Hi,

 

You can't read SMS without giving a port as per documentation says i also get the same error. but i'm also unable to read sms on port as well.. do you know how can i read sms on port. i've tried on phone and emulator as well with port 3590 but their is no success.

 

in above conversation mark said their is a server side component of sms demo. but i can't find any server side component of sms demo to test it on simulator.

 

please help me with this regard. i would highly appriciate you prompt response.


 

I still need to know how to capture incoming standard SMS messages - by using no port I get the error mentioned before.

 

Thanks.

New Developer
Posts: 5
Registered: ‎08-07-2008
My Device: Not Specified

Re: Unread SMS / Catch SMS

hey i tried this, it receives in my messages not in my application. why is that ? I want to receive that message in my application
New Developer
Posts: 14
Registered: ‎08-08-2008
My Device: Not Specified

Re: Unread SMS / Catch SMS

You have to make sure the listening port on device is the same as the one the server sends to. As mentioned above I didn't play around with this app, but it sounds for me that this might be the issue.