diff --git a/samples/WiFiDirectServiceDiscovery/Android.mk b/samples/WiFiDirectServiceDiscovery/Android.mk new file mode 100644 index 000000000..1682aa283 --- /dev/null +++ b/samples/WiFiDirectServiceDiscovery/Android.mk @@ -0,0 +1,16 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := samples + +# Only compile source java files in this apk. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := WiFiDirectServiceDiscovery + +LOCAL_SDK_VERSION := current + +include $(BUILD_PACKAGE) + +# Use the following include to make our test apk. +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/samples/WiFiDirectServiceDiscovery/AndroidManifest.xml b/samples/WiFiDirectServiceDiscovery/AndroidManifest.xml new file mode 100644 index 000000000..17e4fd555 --- /dev/null +++ b/samples/WiFiDirectServiceDiscovery/AndroidManifest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/WiFiDirectServiceDiscovery/_index.html b/samples/WiFiDirectServiceDiscovery/_index.html new file mode 100644 index 000000000..58f5962b9 --- /dev/null +++ b/samples/WiFiDirectServiceDiscovery/_index.html @@ -0,0 +1,52 @@ +

This is a demo application highlighting how to advertise and discover local services that are Wi-Fi peer to peer network capable with +the Wi-Fi Direct Service Discovery APIs. Service discovery on Wi-Fi direct allows applications to discover and enagage with peers that support a certain service. +As an example, a gaming application can find and associate with devices that support the game. This application allows you to chat with a peer after a succesful connection.

+ +

The source code for this demo app shows how to accomplish three key things +with Wi-Fi Direct Service Discovery APIs: Advertise services, discover services and connect to peers advertising such services

+ +

The application includes:

+

+
  • GroupOwnerSocketHandler + — a Thread that implements a client side Socket handler.
  • +

    If you are developing an application that uses the Wi-Fi Direct Service Discovery APIs, remember that the +feature is supported only on Android 4.1 (API level 16) and higher versions of +the platform. To ensure that your application can only +be installed on devices that are capable of supporting Wi-Fi Direct Service Discovery, remember to add the +following to the application's manifest before publishing to Google Play:

    +

    To control how Google Play filters your application +from devices that do not support Wi-Fi Direct mode, remember to add the following to the +application's manifest

    +

    For more information about using the Wi-Fi Direct Service Discovery APIs, see the android.net.wifi.p2p +documentation.

    + + diff --git a/samples/WiFiDirectServiceDiscovery/res/drawable-hdpi/ic_launcher.png b/samples/WiFiDirectServiceDiscovery/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 000000000..96a442e5b Binary files /dev/null and b/samples/WiFiDirectServiceDiscovery/res/drawable-hdpi/ic_launcher.png differ diff --git a/samples/WiFiDirectServiceDiscovery/res/drawable-ldpi/ic_launcher.png b/samples/WiFiDirectServiceDiscovery/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 000000000..99238729d Binary files /dev/null and b/samples/WiFiDirectServiceDiscovery/res/drawable-ldpi/ic_launcher.png differ diff --git a/samples/WiFiDirectServiceDiscovery/res/drawable-mdpi/ic_launcher.png b/samples/WiFiDirectServiceDiscovery/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 000000000..359047dfa Binary files /dev/null and b/samples/WiFiDirectServiceDiscovery/res/drawable-mdpi/ic_launcher.png differ diff --git a/samples/WiFiDirectServiceDiscovery/res/drawable-xhdpi/ic_launcher.png b/samples/WiFiDirectServiceDiscovery/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 000000000..71c6d760f Binary files /dev/null and b/samples/WiFiDirectServiceDiscovery/res/drawable-xhdpi/ic_launcher.png differ diff --git a/samples/WiFiDirectServiceDiscovery/res/layout/devices_list.xml b/samples/WiFiDirectServiceDiscovery/res/layout/devices_list.xml new file mode 100644 index 000000000..d7f0af9f6 --- /dev/null +++ b/samples/WiFiDirectServiceDiscovery/res/layout/devices_list.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/WiFiDirectServiceDiscovery/res/layout/fragment_chat.xml b/samples/WiFiDirectServiceDiscovery/res/layout/fragment_chat.xml new file mode 100644 index 000000000..7a6fba4e0 --- /dev/null +++ b/samples/WiFiDirectServiceDiscovery/res/layout/fragment_chat.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + +