Note: By clicking the download link for any source examples on this page, you acknowledge that you have read and agree to the Adobe AIR SDK License Agreement. These files are considered Sample Code.
Note: Adobe recommends using the next version of Flash Builder for developing native extensions for Adobe AIR. Sign up now to get access to the prerelease of Flash Builder 4.6.
The NetworkInfo class is a native extension for Adobe AIR. It allows AIR application developers, from ActionScript, to get information for each network interface.
ActionScript already provides a NetworkInfo class that works on desktop and AIR for TV devices. This native extension provides a similar class so that AIR applications for iOS can also get information for each network interface.
The attached ZIP files contain:
The ActionScript library contains the NetworkInfo class. The NetworkInfo class provides the AIR application this public method and property:
The NetworkInfo object is a singleton. The AIR application gets the single NetworkInfo object using the static networkInfoproperty.
The findInterfaces() method returns a Vector of NetworkInterface objects. The NetworkInterface class is also defined in the ActionScript library. The NetworkInterface class provides these public properties:
The addresses() property returns a Vector of InterfaceAddress objects. The InterfaceAddress class is also defined in the ActionScript library. It contains these public properties:
Note: The public functions and properties of the classes in the NetworkInfo extension—NetworkInfo, NetworkInterface, and InterfaceAddress—correspond with the public functions and properties in the existing ActionScript classes by the same name. See NetworkInfo, NetworkInterface, and InterfaceAddress in the ActionScript 3 Reference for the Adobe Flash Platform.
To use the NetworkInfo extension, an AIR application does the following:
For example:
NetworkInfo is an Air native extension that allows AIR application developers, from ActionScript, to get information for each network interface.
ActionScript already provides a NetworkInfo class that works on desktop and AIR for TV devices. This native extension provides a similar class so that AIR applications for iOS can also get information for each network interface
This extension enables checking for the existence of an app to handle any specified URL within an Air project. The extension has a single command that checks for a URL handler.
Note: This is an enhanced version of Adobe NetworkInfo implementaion to support running on iOS Simulator along with that it also has a ant build script to easily build in future
Binary filesThe bin folder contains the compiled extension and the default swc, which can be used for local testing if required by your development environment (Flash Builder shouldn’t need it, but other IDEs may).
BuildingRequirements – Adobe Air SDK 3.1 or later, XCode IDE, Java SDK, Apache Ant
Mac_Terminal>cd build
Mac_Terminal>ant all
Modified: GnanaPrakash
Owner: Knobay Technologies
http://www.knobay.com
Copyright © 2015, Knobay Technologies Pvt Ltd.
All rights reserved.
Original:
ADOBE SYSTEMS INCORPORATED
Copyright 2011 Adobe Systems Incorporated
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the
terms of the Adobe license agreement accompanying it. If you have received this file from a
source other than Adobe, then your use, modification, or distribution of it requires the prior
written permission of Adobe.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[attach]1002[/attach]
相关链接:
| 欢迎光临 守望者--AIR技术交流 (http://www.airmyth.com/) |