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

Adobe AIR Development

Reply
New Contributor
Posts: 3
Registered: ‎12-15-2010
My Device: Not Specified

Send/receive UDP for UPnP discovery (SSDP)

Hello,

 

I'm attempting to write an app that needs to discover certain type of UPnP devices on a LAN. This requires sending/receiving UDP packets. I was looking at flash.net.DatagramSocket, but then I realized that it was not supported on the Tablet OS simulator.

 

Any tips on how I can accomplish this?

 

Thanks.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Send/receive UDP for UPnP discovery (SSDP)

I assume you say it's not supported because you checked DatagramSocket.isSupported in a running app.  Is it possible that it could actually work even though that's set false?

 

I believe a new release of the SDK is due out any day now.  I'd first wait and see what's new in it, then possibly start considering whether you can wait for the native SDK which I would think will support UDP.  (For kicks, I tried sending a UDP packet using Python on the simulator and it worked fine.  It wouldn't take much to hook an AIR app up to a Python app via the QNX PPS service, but currently that's a wholly unsupported sequence of things to do.)


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
New Contributor
Posts: 3
Registered: ‎12-15-2010
My Device: Not Specified

Re: Send/receive UDP for UPnP discovery (SSDP)

Thanks. Yes, I checked DatagramSocket.isSupported (after it didn't appear to work). I'll give it another shot, but it doesn't seem very promising.

 

Good to know that you were able to get it to work with the Python work around. I might consider that in the meantime.

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Send/receive UDP for UPnP discovery (SSDP)

[ Edited ]

hey ether,

 

you most likely will not be able to use the DatagramSocket class until the next release of the an update for the AIR Mobile SDK by adobe. The class is not support in the mobile platforms yet and seems to only be available on desktops. Here's an insert from the ASDocs:

 

"AIR profile support: This feature is supported on all desktop operating systems, but is not supported on mobile devices or AIR for TV devices. You can test for support at run time using the DatagramSocket.isSupported property. See AIR Profile Support for more information regarding API support across multiple profiles."

 

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/DatagramSocket.html?all...

 

So for now you are going to have to use a workaround such as the one peter has provided. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Send/receive UDP for UPnP discovery (SSDP)

I created an issue flash.net.DatagramSocket not supported to cover this issue.

 

Also, unless there is a response there to the effect that it will be supported but not quite yet, I wouldn't bother attempting a workaround (and certainly not one using Python and other internal features), since that would very likely result in the app being rejected.  Also probably not working on the production tablet.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
New Contributor
Posts: 3
Registered: ‎12-15-2010
My Device: Not Specified

Re: Send/receive UDP for UPnP discovery (SSDP)

Thanks, Peter. Much appreciated.

Highlighted
New Developer
Posts: 13
Registered: ‎08-13-2008
My Device: Bold 9700
My Carrier: at&t

Re: Send/receive UDP for UPnP discovery (SSDP)

I can no longer see the issue in JIRA. I hope the PlayBook dev team is working on adding this feature, my application would be a lot more functional if the user didn't have to manually enter IP addresses. Can you see it @peter9477, since you created it or did they hide it from you too?
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Send/receive UDP for UPnP discovery (SSDP)

I can still see it, apparently.  It's listed as in Triage, but no other change in status yet.  I believe I got the email about two weeks ago indicating the change in status, not too long after they started looking into the tickets in earnest.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
New Contributor
Posts: 6
Registered: ‎01-11-2011
My Device: Not Specified

Re: Send/receive UDP for UPnP discovery (SSDP)

[ Edited ]

I can't seem to see the case either. Any change in it? I could really use some UDP support right about now. Smiley Happy

 

I just need to send one measly little udp packet and get a response. Can i get some info on the work around for this?

 

perhaps an example?

 

thank you very much.  

 

edit: @peter9477, i looked through your site and i think you avoided posting it because of "section 12". i think i may have to scrap my whole application until that UDP functionality becomes a possibility.

 

thanks

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Send/receive UDP for UPnP discovery (SSDP)

No update on that ticket yet... still in "triage".

 

As for the workaround, I wasn't the one who called it that, and I tried to imply it wasn't really an option.

 

You can't call external code from an AIR app or Web app, so there's simply no way to use Python in that fashion except in some really roundabout way that would work only on the simulator, and only for apps that are marked "devmode"... basically it's an entirely unavailable option for now.

 

Sorry, but you very likely do have to put the app on hold for now, at least until the native SDK is released or described better.  We may learn more on that in a couple of weeks.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!