Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.
- 1 Introduction
- 2 Prerequisites
- 3 Building and installing the WiFiDirectDemo application
- 4 Using the WiFiDirectDemo application
- 5 References
This Application Note demonstrates the Wi-Fi Direct feature of TI-Android-JB-4.2.2-DevKit-4.1.1 using the WiFiDirectDemo application provided with the Android SDK.
The WiFiDirectDemo application is verified on AM335x EVM and AM335x Starter Kit running the TI-Android-JB-4.2.2-DevKit-4.1.1 prebuilt images. Please refer to TI-Android-JB-4.2.2-DevKit-4.1.1 UserGuide for more information on setting up the device.
For this demo, you need:
- two AM335x EVMs (preferred) or Starter Kit devices
- micro-USB cable to connect to host for adb
You can obtain the sources for WiFiDirectDemo application either by downloading the TI-Android-JB-4.2.2-DevKit-4.1.1 sources (described in TI-Android-JB-4.2.2-DevKit-4.1.1 DeveloperGuide or by installing the Android SDK on your Host.
Building and installing the WiFiDirectDemo application
Building from DevKit sources
The WiFiDirectDemo sources is at development/samples/WiFiDirectDemo/ in the TI-Android-JB-4.2.2-DevKit-4.1.1 sources.
Ensure that the build host is correctly setup for compiling the TI-Android-JB-4.2.2-DevKit-4.1.1 sources. Refer to the TI-Android-JB-4.2.2-DevKit-4.1.1 DeveloperGuide for details.
To build the application execute the following steps:
$ cd <android source path> $ make TARGET_PRODUCT=<product-name> WiFiDirectDemo
- Where <product-name> can be am335xevm or am335xevm_sk depending on the device you are using.
The compiled app is available at out/target/product/<product-name>/system/app/WiFiDirectDemo.apk
Building from Android SDK
Please refer to the Android SDK documentation for details. http://developer.android.com/tools/samples/index.html
Deploying the application
- Boot both the AM335x boards running TI-Android-JB-4.2.2-DevKit-4.1.1 prebuilt images.
- Verify that the two boards use different Wi-Fi MAC addresses. If both have the same MAC, please change the MAC for one of the boards. Refer User Guide for details.
- Connect the micro-USB cable to the EVM and the host and install the WiFiDirectDemo application using the following command:
$ adb install WiFiDirectDemo.apk
- Install the same application on both the boards.
Using the WiFiDirectDemo application
These steps need to be performed on both the AM335x devices.
- Go to Settings->Wi-Fi. Click on Menu icon and select Wi-Fi Direct
See User Guide for detailed instructions
- The other device is listed as an Available device under the Peer Devices list
- On any ONE of the device, tap on the device name to establish connection.
- On the other device, a pop-up dialog appears to confirm the pairing connection
- Click Accept to establish pairing. Now you see a new entry under Remembered Groups for this connecction.
One of the devices is set up as server and the other as client.
The server app screen is shown below:
The client app screen is as below:
Data transfer using Wi-Fi Direct
- Tap on Launch Gallery button on the client instance of the application. Select Gallery in the popup and tap Always to open the Gallery.
- Choose any picture to transfer by tapping on the thumbnail.
- The server instance of the app will show the status as downloading file and then subsequently launch the Gallery to show the transferred picture.