blob: ae3cf6c341cf794ec501fd21be7fd6043ca6f223 [file] [log] [blame]
<HTML>
<BODY>
<p>Provides classes which allow applications to use Wi-Fi NAN to discover peers and create
connections to them.</p>
<p>Using the Wi-Fi NAN APIs, applications can advertise services, discover peers which are
advertising services, and connect to them.
Wi-Fi NAN is independent of Wi-Fi infrastructure (i.e. a device may or may
not be associated with an AP concurrent to using Wi-Fi NAN). </p>
<p>The primary entry point to Wi-Fi NAN capabilities is the
{@link android.net.wifi.nan.WifiNanManager} class, which is acquired by calling
{@link android.content.Context#getSystemService(String)
Context.getSystemService(Context.WIFI_NAN_SERVICE)}</p>
<p>Some APIs may require the following user permissions:</p>
<ul>
<li>{@link android.Manifest.permission#ACCESS_WIFI_STATE}</li>
<li>{@link android.Manifest.permission#CHANGE_WIFI_STATE}</li>
<li>{@link android.Manifest.permission#ACCESS_COARSE_LOCATION}</li>
</ul>
<p class="note"><strong>Note:</strong> Not all Android-powered devices support Wi-Fi NAN
functionality.
If your application only works with Wi-Fi NAN (i.e. it should only be installed on devices which
support Wi-Fi NAN), declare so with a <a
href="{@docRoot}guide/topics/manifest/uses-feature-element.html">
{@code &lt;uses-feature&gt;}</a>
element in the manifest file:</p>
<pre>
&lt;manifest ...>
&lt;uses-feature android:name="android.hardware.wifi.nan" />
...
&lt;/manifest>
</pre>
<p>Alternatively, if you application does not require Wi-Fi NAN but can take advantage of it if
available, you can perform
the check at run-time in your code using {@link
android.content.pm.PackageManager#hasSystemFeature(String)} with {@link
android.content.pm.PackageManager#FEATURE_WIFI_NAN}:</p>
<pre>
getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI_NAN)
</pre>
</BODY>
</HTML>