Category Archives: Mobile

Mobile Wi-Fi Testing with Windows 7

In some recent mobile website testing (e.g., using Fiddler to capture Android web traffic), I’ve found it helpful to create a local Wi-Fi network on my Windows 7 laptop. This allows connecting mobile phones and tablets and ensuring the network traffic flows through the laptop, allowing a proxy configuration (like Fiddler), or passive monitoring (like tcpdump or Wireshark).

Mac Users: See my similar guide for Mobile Wi-Fi testing with Mac OS X.

The test setup I’m using has the laptop connected through a wired network cable, and using the laptop’s Wi-Fi as a local access point or hotspot:

Windows Wireless Test Setup

Windows Wireless Test Setup

Here are the steps to create a shared Wi-Fi connection:

First, connect the laptop to a wired ethernet connection. If the Wi-Fi adapter is connected to a network, disconnect it. Confirm that the internet connection is working in this wired configuration.

Next, open a command prompt in administrator mode (e.g. right click on a Cmd shortcut and choose “Run as Administrator…”).

Use these commands to create a local “virtual Wi-Fi” network, replacing MyNet and MyPassword with values of your choice:

netsh wlan set hostednetwork mode=allow ssid=MyNet key=MyPassword
netsh wlan start hostednetwork

Finally, share your wired internet connection with the virtual Wi-Fi adapter we just created. Now click Control Panel ⇒ Network and Internet ⇒ Network and Sharing Center ⇒ Change Adapter Settings. Right-click your wired internet connection and select Properties. On the Sharing tab, check “Allow other network users to connect…” and choose your Virtual Wi-Fi Adaptor. (For an example see this screenshot from my PC; the wired connection is “LAN”, and the virtual Wi-Fi is “Wireless Network Connection 2”.)

Now you should be able to connect to your local network using a mobile phone or tablet, using the network name you used above (e.g., MyNet).

Once everything is running and a mobile device is connected, you can show the current network status:

C:\>netsh wlan show hostednetwork
Hosted network settings
-----------------------
Mode                   : Allowed
SSID name              : "Variable"
Max number of clients  : 100
Authentication         : WPA2-Personal
Cipher                 : CCMP
Hosted network status
---------------------
Status                 : Started
BSSID                  : ac:81:12:2e:1a:da
Radio type             : 802.11n
Channel                : 11
Number of clients      : 1
bc:47:60:fb:1a:75        Authenticated

When you are done testing, make sure to turn off the shared Wi-Fi network:

netsh wlan stop hostednetwork

For more information, see these write-ups which helped me figure out the details of this technique:

Instead of the manual steps I list above, here are a couple of software solutions that can manage these settings for you. On my HP laptop, I could not get either to work correctly, but these may be worth trying:

Galaxy Tab 10.1 HTTP Proxy Settings

In a previous note about debugging HTTP traffic from Android tablets using Fiddler, I had recommended using the Android app HTTP Proxy Settings because my version of Android didn’t have direct support for setting the HTTP proxy manually. Now with my latest Android 3.1 updates, my Galaxy Tab 10.1 does support this directly, but it’s not quite obvious how to change it.

Here are the steps to manually set your own HTTP proxy for the Galaxy Tab:

First, tap on the Settings → Wireless & Network → Wi-Fi settings. Under the list of Wi-Fi networks, tap and hold on your currently connected network:

Tap and hold on your Wi-Fi connection

Find the Wi-Fi network you’re connected to, and tap & hold

When the choice pops up, select Modify Network:

Tap on Modify Network

Tap on Modify Network

Next, in the network settings dialog, scroll down to find the Proxy Settings entry. (You may want to drop the onscreen keyboard to make it easier to find.) Change the Proxy Settings choice to Manual, then enter the proxy hostname or IP address, and the port number:

Manual Proxy Settings

Change Proxy Settings to Manual, then enter hostname (or IP address) and port number

With these changes in place, all HTTP traffic from the Android browser should now connect through the proxy you specified. In my case I’m using Fiddler on a Windows PC, so I’m using the IP address of that PC, and the default Fiddler port of 8888.

Remember to change the Proxy Settings value back to None when you are done testing.

Also note that these changes only affect the Android browser, and don’t work for other Android applications.

Clean Up Android Downloaded Files

Today I randomly noticed on my HTC Evo a “Downloads” app which brings you directly to all of the downloaded files and attachments.

Android Downloads Icon

Look for the Downloads application

I didn’t realize there was a separate app for this, but had wondered if there was a way to return to browser downloaded files. Within Downloads, I found over 65MB of files, some of which I downloaded over a year ago. With a few taps I cleaned them all out. These are treated separately and outside of the browser cache, so if you download a lot you should periodically clean them up.

Android Downloads Screenshot

The Downloads app shows how much space is used by everything you’ve ever downloaded

Effective Android Screenshots

Taking screenshots from an Android device is similar to other platforms, although a bit more setup is needed. With a little bit of additional editing, your screenshots can look clean and professional.

To get your PC ready for taking Android screenshots, refer to addictive tips for a good set of instructions; setting up a Mac is a similar process.

In the instructions below, we’ll clean up the extra icons that appear in the notification area (the top left corner of the screen) when the device is connected via a USB cable. In this example screenshot, notice the extra icons that we want to clean up:

Android Screenshot 'Before' Example

Follow these instructions on your Mac to take better screenshots and clean those up:

  1. Prepare the Android device with the screen or application you’re taking a shot of
  2. Connect to your PC/Mac via USB cable
  3. Take the screenshot and save as a PNG file (refer to addictive tips for instructions)
  4. Open the PNG file in the Preview Mac app
  5. Zoom in once or twice and scroll to the upper left corner
  6. Select a rectangular area that is “clean” (showing just the header background)
  7. Copy
  8. Paste
  9. Use the arrow keys to move the pasted block to the left (using the keys keeps the copied rectangle in the proper vertical position)
  10. Repeat as needed to cover the undesired icons

This close-up screenshot show the copy area from the clean background:

Android Screenshot Select

And here we have the clean area being pasted over the icons we are hiding:

Android Screenshot Copy Paste

Finally, the end result:

Android Screenshot 'After' Example

Debug HTTP Traffic From Android Tablets Using Fiddler

Update 2013-11-06: See my newer guide for connecting Android 4.x devices with Fiddler: Capture Android Mobile Web Traffic With Fiddler

Having recently upgraded my Samsung Galaxy Tab 10.1 to the latest Android “Honeycomb” 3.1 release, I wanted to take a closer look at watching the HTTP web traffic from and to the device. Using the Fiddler web debugging tool on Windows, I was able to set this up rather quickly with these steps:

On the PC, Install Fiddler if needed. After install, configure Fiddler by opening the options panel (menu Tools | Fiddler Options). Select the Connections tab and enable the ‘Allow remote computers to connect’ option. Note the ‘Fiddler listens on port’ option (normally 8888), and close the dialog. Exit and restart Fiddler.

Fiddler Options

On the PC, determine it’s current IP address (open a command prompt, then type ipconfig).

On the Android tablet, install HTTP Proxy Settings app on the tablet. This app simply brings up the “HTTP Proxy” setting panel so you can make changes. Start the HTTP Proxy Settings app and enter your PC’s IP address as the host, and port number 8888.

Update 2012-02-20: With the latest updates on my Galaxy Tab 10.1, there is no longer a need for the 3rd-party Proxy Settings app. See this updated note for details: Galaxy Tab 10.1 HTTP Proxy Settings.

HTTP Proxy Settings

Now run the Android Browser and you should see HTTP traffic routed through Fiddler on the PC. Below see an example of visiting Yahoo’s “tablet” home page:

Fiddler Log Results

When you’re done, don’t forget to run the HTTP Proxy Settings app again to clear out the host and port fields. (Otherwise your tablet browser will become unusable when Fiddler is no longer running.)