Tips to Test Network Performance of Wearables
AT&T’s Application Resource Optimizer has helped thousands of developers improve the performance of their iOS and Android native applications. By looking into the traffic patterns and finding ways to reduce the data/radio usage, we have collectively saved thousands of hours of battery life and petabytes of network data.
One question that has been increasingly asked of our team is what affect wearables have on network connectivity and battery life. How can we measure the effects of these devices so that we might optimize? I hope to spell out some options in this post.
How do wearables connect to the Internet? As I see it, there are three options:
1. Bluetooth-to-a-phone (often to a specific application on a phone)
Samsung Gear & Gear Fit
2. Wi-Fi connection
3. Cellular connection to the network
Several rumoured smartwatches (Tizen & Android) that are powered with a SIM card for direct cellular access
For each of these types, there is a different testing technique available. Let’s start in reverse order.
Wearables with a cellular connection
Android: Root your device and install ARO. Assuming your device is unlocked, a process like this (https://f-droid.org/wiki/page/Root may work. I have built a special version of ARO that places all of the controls at the top of the screen, so there are no scrolling issues (due to constrained screen real estate).
Non-Android device: This will be tougher, because of the limitations of the device, you may not have Wi-Fi, or VPN services available to grab packets.
Wearables with Wi-Fi Connection
Root an Android device, and install ARO. Set-up this device as a Wi-Fi Hotspot and start an ARO trace. Then connect your wearable to the hotspot and run your tests. All of the data to/from the device will be collected.
I have done this with Google Glass. All of the traffic from the Glass to the Internet is HTTPS (and probably SPDY), so I was unable to see WHAT files were sent, but I could see all of the packets.
Wearables with Bluetooth Connection
In my experience so far, all of these devices connect to an application on an Android device (Android Wear for the LG Wear, Samsung Gear for the Gear2, Samsung Gear Fit for the wearable of the same name and MyGlass for Google Glass). The ARO data collector will track the data usage of the Android app on the device with the cellular network, giving you an idea of the Internet traffic that is incurred with a paired wearable device.
If you are more interested in seeing the packet data on the Bluetooth Layer between the device and the wearable, you are in luck. Android KitKat (and newer) devices have a new developer option that can help, called “Enable Bluetooth HCI snoop log.”
If you check this, your android device takes a logfile of every transaction on the Bluetooth interface. These logfiles are saved at /sdcard/btsnoop_hci.log. (Note, My Samsung S 5 does not appear to save these files, but I was able to capture these logs on a HTC M8.)
Once you copy this log over to your computer, you can open and analyze in Wireshark. In the image above, you can see all of the packets that were transferred between my Glass and my HTC phone.
Most of this traffic was encrypted, but there were some packets where you could read the content. In the example below, I performed a search on Glass about the Australian Shepherd (“ok Glass, Google Austrailian Shepherd”). Also, note that %20 is url encoding for a space:
This is neat and all, but what else can this logfile tell you? If you choose Statistics-> IO Graph, you can graph the data. In this case, I am looking at the packet count per minute:
If you’re interested in the KB transferred, you can observe that, too:
Note how some of the peaks get much larger here (2nd peak at 430s, for example) indicating that these packets sent more data relative to the others.
The Wireshark summary tells you high-level details (packets/bytes/throughput):
In conclusion, there are a number of ways to get detailed network analysis of your wearable device capturing data either over cellular, Wi-Fi, or Bluetooth (and sometimes a combination!)
How are you testing your wearable apps and devices for network performance? We are actively looking to add features like this to the ARO toolset and we would love to get your feedback.