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
Contributor
xvart
Posts: 36
Registered: ‎05-30-2012
My Device: playbook developer
Accepted Solution

TCP in PlayBook

Hi,

 

Is it possible to create a TCP client with AIR for PlayBook (I would rather UDP but from what I read it is not available for AIR mobile)?

 

What I am trying to do is just send short string to a PC that are in the same WiFi.

 

I have seen and tried this app and it says it uses TCP connection but I do not know whether it was created with AIR or not.

 

http://appworld.blackberry.com/webstore/content/36065

 

Any information is really appreicated.

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: TCP in PlayBook

Look at the Socket class.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html

Yes, you can make a TCP socket connection to a remote computer.
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: TCP in PlayBook

Also, look at the DatagramSocket class (UDP)

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

I dont think it is support on mobile AIR, but there is a "isSupported" method that you can test.
Please use plain text.
Contributor
xvart
Posts: 36
Registered: ‎05-30-2012
My Device: playbook developer

Re: TCP in PlayBook

jtegen thanks for the quick replies.

 

From what I know UDP is not supported for mobile AIR but I should try the isSupported (which I was not aware) to make sure.

 

I had seen the Socket class but was not sure if it was supported for mobile AIR.

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: TCP in PlayBook

Socket is supported.
Please use plain text.
Developer
osus
Posts: 217
Registered: ‎04-26-2012
My Device: Z10

Re: TCP in PlayBook

You can also take a look at as3 peer to peer classes, they might help you and are supported on mobile version.

 

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetGroup.html

 

I use it on my app Remote Media Player and Remote Control for communications between Playbook, Bb10, Android and ios devices.

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: TCP in PlayBook

peer-to-peer only works on the same local network.
Please use plain text.
Developer
osus
Posts: 217
Registered: ‎04-26-2012
My Device: Z10

Re: TCP in PlayBook

Yes, and that's what he wants to do, connect to a pc on the same wifi :smileyhappy:

My apps for Playbook: PlayEpub Book Reader with epub and FB2 support, Google Reader, ReaditLater - Net Files Share Explorer Get access to your network shared files- FFSync Sync your Firefox bookmarks and passwords
Please use plain text.
Contributor
xvart
Posts: 36
Registered: ‎05-30-2012
My Device: playbook developer

Re: TCP in PlayBook

Hi all,

 

I got it working (see the solution) and I will publish the app when I have time (right now using it as a debug).

Please use plain text.
Developer
KermEd
Posts: 179
Registered: ‎05-18-2009
My Device: NA

Re: TCP in PlayBook

TCP works fine.

UDP (multicasting) and UPnP by extension don't work.

 

Which means you cant autodetect network devices (thus can never be a true DLNA client) and will have trouble with streaming video as you need to do it over TCP.

Please use plain text.