Skip to main content
Participating Frequently
October 13, 2011
Question

How to get the host list in the wifi on mobile devices?

  • October 13, 2011
  • 1 reply
  • 534 views

Hi

My AIR app need work on both Android and iOS.

ServerSocket and DatagramSocket are neither supported on mobile device. So how can I get the IP of other hosts in my wifi?

I tried to get the ip range and use socket to connect them one by one to check if they are available. But it's too slow. Is there another quick way?

Thanks

This topic has been closed for replies.

1 reply

October 14, 2011

You can achieve this functionality with the help of native functions if the underlying platforms supports this functionality. You can google for native extensions in AIR for know-hows. Also you may want to google iOS and Android references to see if and how this functionalities are available/used through native code.

Participating Frequently
October 17, 2011

Thank you Saumitra Bhave. I download some samples and read some articles for how to use native functions.

But many things are sitll not clear to me, so I failed. Let me describe my flow:

1. compile all Java code to a .jar file, and put it into Android-ARM folder in my project.

2. create some functions to call the .jar with flash.external.ExtensionContext.

3. create a extension.xml to describe the path.

4. use command to compile .jar and AS functions into .ane with ADT.

then I can use this .ane file in any my AS project, right?

BTW, I'm using Flash Profassional, no Flash Builder 4.6.