开发者

Air for Mobile - IP Address

I'm looking to score a LOCAL IP ADDRESS for a a mobile device (both Android and iOS). I know that you can get an IP via PHP but I need the local IP. And yes, I know that you can get it from a PHP call on a local machine running a server, but this isn't going to be the case for a regular user. I have accessed the "NetworkInfo" and tapped into the ".findInterfaces();" section of the class, however开发者_如何学JAVA, mobile devices that "isSupported" returns TRUE don't have access to the interfaces.

Any ideas?


Only a partial answer, I'm afraid. NetworkInfo should work on Android if you specify the correct permissions: ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE.

Unfortunately, the NetworkInfo class isn't implemented on iOS, so I don't have an answer for that part. (Another job for native extensions in AIR 3?)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜