Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
01-12-2011 06:04 PM
I have been using the USBPortListener to try and get an indication as to when the USB cable has been plugged into the phone, and also when it gets diconnected. The problem is that only one function ever gets fired, and that is "getChannel", whenever I transmit data over the connection.
Obviously I must have a misunderstanding on how to use this listener, but I woud assume "connected" fires every time the cable is plugged in, same with "disconnected".
Solved! Go to Solution.
01-13-2011 11:24 AM
Thank you, jonberry! That was just what I needed.
After implementing that, I got to thinking about the port listener again. Is there a nicer way to be able to tell when data has come in over the cable instead of reading the input stream over and over? I tried to use the USBPortListener's dataSent, dataReceived, and patternReceived and neither of these do anything...
01-13-2011 12:08 PM
Take a look at the USB sample in the demos.
I haven't tried this in a long while but I think the dataReceived method should work.
Make sure you've added a listener to your app.
01-13-2011 12:59 PM
Again, thank you. You pointed me in the right direction. I see the problem now; you have to register the channel first before you can get the callbacks.
I wish the documentation would tell you this little detail first...