Traveling Man: Tools and Apps for Testing Cell Networks Across America, Part II

iPad Mini Screenshot

My Go-To Travel Apps

Early on we realized that some kind of tablet would be necessary to monitor the internal testing dashboard on the go. To be totally honest, I was hesitant about the usefulness of an iPad Mini. We just needed to monitor a web-based, mostly text, data dashboard, so really any smartphone would do an adequate job. After five weeks on the road though, I am sold. It became home base for everything I needed on the go, from booking hotels and cars to distracting myself with Angry Birds during a mildly terrifying descent in a CRJ-200 into the Detroit Airport. It is small and light, which is overwhelmingly a plus.

The Apps
OpenSignal: Obviously this is the most important. I’m using a modified version of the OpenSignal App for all the iPhones and Notes. I added the standard release to the iPad as well. There were a few times where AT&T service was spotty, which prevented me from seeing my web-based data dashboard as I was collecting it, in those cases I could fire up the OpenSignal App and try to get the iPad closer to a tower… so I could connect to the database… so I could see how much the phones were not connecting…

TripIt: I was skeptical about this at first. TripIt parses through your email account for flight, hotel, and car rental confirmation emails, then it adds all the details into one convenient place. With 20 cities, 11 flights, 12 car rentals, 23 hotel bookings it was nice to have them all organized according to check-in time, car return time, boarding time, etc. TripIt was invaluable. The only thing it could have done better at was managing multiple or overlapping trips, as it seemed to organize everything based on flights. For example, my trip to Ann Arbor was labeled “Trip to Detroit” because I flew into the Detroit Airport. I could have manually corrected this on the web interface, but the app is otherwise so comprehensive, I rarely logged in online.

FourSquare: This was just a fun way to keep track of my travels and put a name to all those anonymous lat / long coordinates I was gathering. I also set it up to post to my Facebook Page, so my non-FourSquare followers could keep track of where I was.

Diner in Omaha

Diner in Omaha

Yelp: When I am not working, I am eating. I am easily excited over local fare and sadly gluten-intolerent, so to be able to see that the Best BBQ in San Diego is literally across the street from my hotel or that gluten-free pizza and beer are available for dinner in Ann Arbor made this trip worthwhile for my stomach.

The Weather Channel: Instead of jetlag on this trip, I got weatherlag. I went from a sunburnt 89 degrees in Phoenix to a blizzard in Denver, to a torrential downpour in DC. This app helped me mentally prepare for what was next. If the iPhone version of WeatherSignal was out, I would probably have opted for that for more realtime information.

Snowy Denver

Testing in Snowy Denver

Trip Advisor: Pretty good for hotel reviews, and better than most for finding quirky places to stay, like the Carlton Inn outside of Chicago, where the otherwise standard quick-airport-layover rooms feature photo montages of the family poodle in a beret or Indian Hot Springs outside of Denver, where a dip in a mineral water swimming pool is part of the unique experience.

HotelTonight: This app is gorgeous and provides great photos all of the time, and great deals some of the time. I noticed that on the west coast, it was pretty easy to find a really great last minute deal. I booked my stay at Palms Place in Las Vegas through this app and loved every minute of it. On the east coast the deals seem to be less discounted and in my experience can usually be trumped on Priceline.

Priceline: I found the Priceline app to be only supplementarily useful, but the website’s Express Deals provided many an affordable night in a four star hotel – as long as you can remain calm about not knowing exactly which one you’re going to be staying in until after you pay.

Hotels.com & Booking.com: I used these mostly for cross referencing what i was seeing elsewhere. They offer pretty standard rates and the occasional good deal, but I found both of them difficult to navigate when looking for last minute or day-of rates.

SFGabe & the Chicken

Meeting up with old friends in Michigan. Chickens get terrible reception.

Facebook: Through the magic of Facebook I was able to connect with old friends in about ten of the twenty cities. Luckily, I have the type of friends that I can call after ten years and still get dinner with. It was great to see a friendly face and have an occasional home cooked, free range omelet.

ParkMobile: I was able to use this app to pay for parking in Chicago, Denver, Kansas City, and DC, but I wish this was nationwide. I found I actually didn’t mind paying $1-4 for parking when it was this easy. Each parking area has a number, you add it into the app and the rest is automatic once you’ve put your credit card and license plate information in. No fishing for quarters, no running back to the meter, no walking back to the car to put a sticker in the window. This is the future of municipal parking.

Apple Maps

Apple Maps: Round and Round We Go

Apple Maps: I used the default Apple Maps app most of the time, maybe because I like some spice in my life. It was totally acceptable for general directions and I liked hands-off Siri telling me what to do as I drove. However, the apps actual understanding about speed, traffic, and human spacial architecture is seriously lacking. It’s also not so good with finding imperfect addresses. For example, a search for “Avis Rental Car NY NY” returns zero results. It also prioritizes an address’ zip+4 codes for location over the street address, which seems like a really odd choice and leads to a Bermuda triangle-like “approximate location” with no basis in reality. It also does not seem to understand different types of roads. After a rest stop somewhere between Dallas and Houston, it decided that the best way for me to get back to the highway was to go twelve miles down a dirt road through a cemetery in the middle of the night. I got to the highway eventually, but I cursed Siri the whole way. I still don’t think she’s forgiven me.

You can follow my travels on Facebook (OpenSignal Gabe), FourSquare (OpenSignal) where I’ll be checking in periodically. I’ll also be blogging some more about my epic road trip here on the OpenSignal Blog.

Posted in Other, Reports, Team | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Traveling Man: Tools and Apps for Testing Cell Networks Across America, Part I

Car Show in Ypsilanti

Sadly, not available as a rental car.

When I set out on my journey traveling the country doing signal testing with OpenSignal & TechHive, my aim was to travel light. Hitting 20 cities in five weeks is no mean feat, and the less to cart around with me the better. I managed to get a weeks worth of clothes into a spinner carry on. Once I got to San Francisco to pick up the tester phones and equipment it became apparent that I would need to check luggage anyway. I packed the electronics and my clothes and personal items separately, mostly because I didn’t want to let so many gadgets out of my sight (I was carrying four iPhone 4‘s, four Samsung Note II‘s, a laptop, a tablet, and all of the associated bits and bobs). This proved to be the right choice, because my checked luggage went to the Bahamas while I was in Miami and didn’t find its way back until three days and one emergency shopping spree later.

Here are some other tools and tips that I’ve come across in my travels.

Basics
A Hardshell Spinner Bag: by far the most convenient for frequent travel, at least until they have adult sized ride alongs. When deciding on new luggage, remember that it will be only as good as it’s zipper and handle. By Kansas City I had lost two zippers already and had to MacGyver them back on with pliers.

Trunki Tiger

Come on Trunki, I’m waiting for the 5′ 5″ model…

Compression Bags: Its a small thing, but having this kind of order in my life helped me keep sane. I like the SpacePak set, because they are colorful for easy identification and have separate compartments for clean and dirty clothes. Though I did find them rather bulky and they do not have a valve that will prevent them from decompressing. But they do prevent your dirty underwear from spilling out when your zipper breaks (see #1) and keep things tidy when TSA rifles through your luggage.

A Good Shoulder Strap: People have different requirements for their laptop bags, but everyone ends up stuffing more than just their laptop in there. I went through three shoulder straps on this trip. The first one broke on the way to my first flight.

Charging Devices

This happened every night.

Electronics
Power Strip: You cannot imagine the thankful glow on the faces of the two-hour-plus delayed airport passengers in Atlanta when I pulled out two six-outlet power strips. Everyone was sitting around the only available outlet, politely masking their vulture-like desire to lunge at the wall as soon as an outlet was free. When I plugged in the power strips and gestured that they could also have a go, they gazed at me with the disbelief of an orphan who has just been given an extra bowl of porridge. It definitely lightened the mood. I never would have traveled with something like that if it were not necessary equipment for the rest of the trip, but now I may bring one everywhere I go.

PowerGen Dual Port USB: These little doodads were magnificent. I had eight of them. They have one USB slot for Apple devices (A) and one for non-Apple devices (NA), which means I could charge one iPhone and one Note II on each plug. I could also have my Android phone and iPad plugged in to that one outlet that’s at the base of the bedside lamp in a lot of hotel rooms to make absolutely sure that my alarms were going to wake me up.

Anker External Battery

Anker External Battery

Anker Battery Pack: I had five Anker Astro External Battery Packs, which were absolutely fantastic. Both the Note II’s and iPhone 4′s did much better than expected at keeping their charge through a whole day of testing and geolocating, but on the days when an external battery pack was necessary, these did the trick. They each come with an adapter with the necessary cable attachments, or can just take the USB cord from the standard device charger. They also have slots for Apple and non-Apple devices. I was expecting a trickle charge with two devices going at once, but even in that situation, the Anker chargers seemed to get the job done fairly quickly. Confusingly, they did not come with a means of charging themselves. I had to switch the included adapter to attach to a usb wall charger to recharge after using them.

iPad Mini: Early on we realized that some kind of tablet would be necessary to monitor our internal testing dashboard on the go. We were initially going to go with the Asus Nexus 7 but could not find one available in any brick and mortar store in all of San Francisco. It probably would have done a perfectly good job of it, but the travel timeline required something I could get my grubby little hands on quickly, so we went for the iPad Mini instead, with an AT&T data plan. We went with AT&T not out of any real preference, but because I could tack it onto my existing phone bill if necessary.

To be totally honest, I was hesitant about the usefulness of an iPad Mini. We just needed to monitor a web-based, mostly text, data dashboard, so really any smartphone would do an adequate job. After five weeks on the road though, I am sold. It became home base for everything I needed on the go, from booking hotels and cars to distracting myself with Angry Birds during a mildly terrifying descent in a CRJ-200 into the Detroit Airport. It is small and light, which is overwhelmingly a plus. On the down side, the market has been slow to offer protective cases and covers, which means my only option was the Apple Mini Smart Cover, which I found akin to placing a magnetic handkerchief over the screen – psychologically calming, but otherwise useless. I’m sure the market will catch up soon.

More on the Apps I’m using are coming in the next post. Meanwhile, you can follow my travels on Facebook (OpenSignal Gabe), FourSquare (OpenSignal) where I’ll be checking in periodically. I’ll also be blogging some more about my epic road trip here on the OpenSignal Blog.

Posted in Mobile Trends, Other, Reports, Team | Tagged , , , , , , , , , , , , , , | Leave a comment

One Week of WeatherSignal

It’s been just over a week since we launched WeatherSignal, we billed it as “the most ambitious Weather crowdsourcing project ever” – that’s a fine claim to make, let’s see if we’re managing to live up to it.

By the numbers:
9,908 users
37k app sessions
2.3 million data points

And some very kind articles on The Next Web, TechCrunch and New Scientist.

While that might sound fairly impressive, this is very early days. On a single good day OpenSignal is downloaded 8000 times, and on our best day ever it was over 15,000. We want WeatherSignal to be be that big, in fact we’d rather like it to be even bigger, as with OpenSignal: the more people using it the more useful it will become.

What’s the data like?

We’ve received
2,305,086 datapoints
contributed by
9,836 users

Numbers, boring numbers – show me some graphs
Here’s pressure from the weather station at Milan’s Malpensa Airport offering the ‘official’ view of pressure for the last week:

pressure_mxp

And here’s what we measured on phones with barometers surrounding that same airport:
presure_app_max
Note how similar the pattern is, but our data is offset – this is because Milan is 121m above sea level and the weather station data corrects for this, this is something we’ll need to start doing.

How the light gets in
Ever wondered what the daily pattern of light intensity incident on your phone looks like? Here’s a week’s worth of Milanese sunshine:
light_app_mean

Does your phone comply with Newtonian Physics
Here’s another fun thing to look at: at different latitudes your weight varies, it does, seriously. At the equator you are lighter. There are two reasons for this: at the equator you are further from the centre of the Earth so the gravitational force is weaker, the second reason is due to the spinning of the Earth which reduces the resultant acceleration. The acceleration should vary between about 9.78 metres per second squared at the equator and 9.83 at the poles.

Here’s what we’ve measured: the below graph shows the absolute latitude at a resolution of 1 degree – so each dot, except for the one at 0, represents all the readings from users in 2 latitude bands – one above and one below the equator. The size of the dot shows the number of readings. The acceleration is the average of all accelerations between 0 and 20 m/s2 in those latitude bands – we figured the phone gets moved in lots of directions and positive accelerations relative to gravity will cancel out negative ones and we’d end up with the “rest” acceleration – the pull the phone feels due to gravity and the Earth’s spinning. The blue line is the best fit, but because it’s late it’s not been properly weighted :)
gravity_by_lat
So it’s a little messy, not nearly as smooth as the lovely (theoretical) illustration you’ll find here (thanks Berthold for sending me that), but as more sensor data comes in we should get good empirical confirmation of the wonderfully named “international gravity formula” (as if gravity could fail to be international!)

We’ve got our work cut out. In particular on cleaning up temperature readings – which we primarily get from reading battery temperature sensors – this deserves a blog post on its own. In the meantime, keep using the app – it’s not just for weather, you can use it to quantify yourself, conduct physics experiments or just to see what Atmos will do next.


That's Atmos - the shoes mean he's walking (i.e. you're walking), the moon's in its first quarter & he's got a hat on because it's cold.

That’s Atmos – the shoes mean he’s walking (i.e. you’re walking), the moon’s in its first quarter & he’s got a hat on because it’s cold.



Get the app – to see what else Atmos can do.

Posted in WeatherSignal | Leave a comment

How to use WeatherSignal for Quantified Self tracking

While WeatherSignal is primarily designed to crowdsource Weather Readings you can also use it as a personal “tricorder” – for example to make highly localised maps of your surroundings, or even to monitor your own habits and interactions with the environment. That’s pretty abstract – let’s look at some examples of what you might want to do, then we’ll look at how you can use WeatherSignal to do it.

1. Activity tracking
Starting with WeatherSignal 1.8 we’ve incorporated “Activity Recognition” into the app. Using some very cool new APIs from Google – it is possibly the first third party app to incorporate them – WeatherSignal attempts to distinguish between when the phone is still, when the user is walking with it, on a bicycle, or in a vehicle. The app does not need to be open to collect this information, by default it will scan for it about once an hour, but you can increase the frequency. When you want to see what you’ve been up to, export the data to CSV and look for the act_type and act_con fields.

2. Migraine prediction
Gabe has just trekked round 20 of the largest cities in the US with a portfolio of very expensive phones. He’s had a lot of coffee. It’s enough to give anyone a headache. But Gabe also pointed out to me that the weather often triggers migraines – and there are many theories about it being linked to any one of pressure, humidity and even magnetic flux. All of which can be tracked with WeatherSignal (depending on your phone type).

Suppose you feel a migraine coming on and you want to try to work out what could be causing it, do the following to make a record of all the sensor data on your phone:
- open WeatherSignal
- go to the Report tab
- Write “migraine” or any other note in the Note box
- select the appropriate options for indoors/outdoors and the precipitation slider
- Hit Submit … and you’ve saved it
You’ll be able to find that row and others in your CSV when you export it.

3. Mood tracking
You don’t need to be a hipsterrific Quantified Self-er to track your mood, but it helps, and with WeatherSignal it’s very easy to look for links between mood and weather.
The process is similar to that described above: report mood in the same way you’d report a migraine (write it into the Note box). I suggest using a number scale – 1:10 for terrible to fantastic. Once you’ve built up some data you can look for patterns.

4. Detailed and off-beat environment mapping
How does the lighting at your office compare to the lighting at your house, and what about thw magnetic field strength in those two places? These might seem like boring questions, but given that we probably spend 80% of our lives in these two places, perhaps we should be more interested in these differences. You’ll likely be surprised by how uniquely moments in space and time are defined by the pattern of sensor readings on your phone. There’s more to the world than meets the eye, and a little bit of that hidden surplus is caught by your phone’s sensors.

***
Technical Guide:

When does WeatherSignal take readings?
To understand how to get the most out of WeatherSignal, you need to know when it takes readings:
Defaults:
- In the foreground (when the app is open) every second
- In the background (when the app is closed) approximately every hour, but it will attempt to not wake the device in order to take a scan, so it may wait up to two hours.
These can both be configured in the settings.
By default WeatherSignal caches 10,000 rows in its internal database (or 1000 if you first downloaded before v1.8) you can alter this in settings. If you’re really serious about QS tracking, you don’t need to manually export to the SDCard, just check “Auto-save data to CSV file when DB reaches limit” and the files will magically save themselves.
To get the data from CSV file you can use an SD Card Explorer or File Manager App, or just plug it into your computer and open as a flash drive. My preferred method is to open Dropbox and select the “upload file here” option and then “other files”. If people are keen we could add Dropbox integration, or simply an option to email the file.

2013-05-18 00.10.29

What’s the data structure of the CSV?
… See below:

Column Description Unit Default More
fg_bg whether reading was taken in foreground or background
row_tim time of reading (UTC)
tim_ofs timezone offset in milliseconds
not manually added note
not_age time before the reading that the not was taken (typically a couple of seconds)
prec “field to contain data from manual reports, to be configured”
prec_age age of the above
doo manual field for reporting whetehr device is indoors or outdoors
doo_age age of above
bat_tem battery temp in deci-degrees C (degrees*10) -998 here
bat_sts battery status “2:charging, 3:discharging, 4:not-charging, 5:full, 1:unknown” -998 here
bat_vol battery voltage milli Volts -998 here
bat_plg battery plugged status “4:plugged wireless, 1:plugged AC, 2:plugged USB” -998 here
bat_lvl battery level seems to be percentage -998 here
bat_hlt battery health “1:unknown, 2:good, 3:overheat, 4:dead, 5:over voltage, 6:unspecified-failure, 7:cold” -998 here
bat_tem_acc “accuracy field (as of 24/4/2013 no plans for anything here, but it may be added)”
bat_tem_age age of all the above battery fields
amb_tem ambient temperature from phones that have one
amb_tem_acc accuracy of above
amb_tem_age age of above
pre pressure -998
pre_acc accuracy of above
pre_age age of above
hum relative humidity -998
hum_acc accuracy of above
hum_age age of above
pro proximity “so far aobserved scale of 1:5 with only 1 and 5 being ever achieved, 1 is cllose, 5 is far” -998
pro_acc accuracy of above so far found to be empy
pro_age age of above
lig luminosity lux -998
lig_acc accuracy of above
lig_age age of above
mag_mag magnitude of the magentic vector micro Tesla -998
mag_x component of magentic vector along phone’s x-axis (will also dfepend on phone orientation) micro Tesla -998
mag_y ditto for y micro Tesla -998
mag_z ditto for z micro Tesla -998
mag_acc accuracy of above
mag_age age of above
acc_mag magnitude of the acceleration vector meters per second squared -998
acc_x component of acceleration vector along phone’s x-axis (will also dfepend on phone orientation) -998
acc_y ditto for y -998
acc_z ditto for z -998
acc_acc accuracy of above
acc_age age of above
rtv_mag magnitude of the rotational velocity vector -998
rtv_x check -998
rtv_y check -998
rtv_z check -998
rtv_acc accuracy of above
rtv_age age of above
rot_x check -998
rot_y check -998
rot_z check -998
rot_age age of above
lat latitude
lng longitude
loc_src location source “GPS, Network, Fused”
loc_acc location accuracy radius within which 67% of values lie (in metres)
loc_spe location speed
loc_alt location altitude
loc_bea bearing
loc_age age of location fix
loc_sat “nr of satellites used for fix, if available”
act_type “the current user activity – 0 in vehicle, 1 on bike, 2 on foot, 3 still, 4 unknown, 5 tilting “ 0-5 nbut may change if APIs are updated -998 here
act_con confidence in the above assessment of user activity (out of 100) 0-100
act_age age of the activity reading
api API level of device
apv app version code
Posted in Quantified Self, WeatherSignal | 2 Comments

The Funniest Wi-Fi Names this Week

We have previously looked at how Wi-Fi names have been used to express political allegiance. For the purposes of entertainment we thought we’d take a look at the Wi-Fi names of contemporary America to see whether the spectre of Communism still looms large.  The short answer? It appears that a global proletarian revolution is bubbling under the surface, waiting to erupt at a moment’s notice.  It appears inevitable that these Wi-Fi revolutionaries will soon overthrow the ideological constraints of American capitalism. Sadly, there is no help that I can give – except perhaps to pray to the memory of that great American hero, Senator Joe McCarthy, to deliver us from the coming red storm.

1) TheCommunistAfter-Party – Denver, Colorado

Now this is what I’m talking about. They’re not only plotting to overthrow world capitalism but they’ve got some kind of awesome after party going on. I imagine the party itself was probably a nightmare to plan, nothing worse than calling up Karl Marx for advice and having him say: ‘The doctrine of Hegel, taken as a whole, left plenty of room for giving shelter to the most diverse practical party views.’ Great. Thanks Karl. Let’s just hope everyone brings a bottle – that’s a practical party view I’m sure we all share.

2) Foxtrotsky – Brooklyn, New York.

What dance do they do at the Communist party? The Foxtrotsky. I’m not sure how familiar I am with the steps but I imagine they lead gloriously forward to world revolution. I’m glad I’ve now got the Wi-Fi memo, it would have been pretty embarrassing to turn up unprepared and be forced to dance the Che Che by myself. (Side note: It turns out it really hard to come up with Marxist/Dance puns – anonymous Brooklynite, I raise my fist to you in salutation).

Hegel - Not a great party planner

Hegel – Not a great party planner

3) Sexy Communist Network – Albuquerque, New Mexico

Not for nothing did Friedrich Engels describe Albuquerque as a place where ‘the shackles of oppression are thrown off as liberally as the clothes’*. I seriously hope these guys are coming to the after-party, they’ll add some much-needed glamour. Also, if they do manage to make it, talk to Sharon – apparently she’s bringing some opiate for the masses, just don’t say I told you.

 *(F. Engels, A guide to the party towns of the Midwest, 1846, page. 62)

4) The Proletariat Chariot – Seattle, Washington.

A chariot? I hear you ask. But surely the chariot is a symbol of oppression, a mark of elitist distinction? Think of chariots and you think of chains – Egyptians, Romans, Greeks, great civilizations founded on slavery. Why not the common car?  As usual, I’ll let Karl answer that one: ‘Machines were, it may be said, the weapon employed by the capitalist to quell the revolt of specialized labour.’ Got that? No machines, chariots for everyone. Still, I can’t help but hope that the Proletariat Chariot is an itinerant VW camper van, Hammer and Sickle on one side, Peace symbol on the other, traversing the land distributing hand-printed copies of the Communist Manifesto. Possibly dallying inappropriately long in Albuquerque.

5) boredmarxist – London, England

Come, come comrade. Boredom? Remember what Marx urged, remember what is promised in the socialist paradise – a chance ‘to hunt in the morning, fish in the afternoon, rear cattle in the evening, criticise after dinner’. If none of that appeals to you, then the Communist After-Party is probably still going on. I’ll call the chariot.

Posted in Wi-FI Names | Tagged , , , , , , , , | Leave a comment

What Google Activity Recognition means for apps

There is no shortage of sensors on smart-phones – most devices have a lightmeter, magnetometer, three-axis-accelerometer and sensors for location (GPS, cellular/wifi radio). While it’s relatively easy for developers to access, for example, raw accelerometer data, it can be difficult to transform that data into useful information e.g. “the user is walking”. Most apps don’t bother. This is about to change.

Google IO is a glorious field day for geeks. Last year saw the announcement of Google Glass and this year ActivityRecognition has emerged as the standout from a sea of other headlines. ActivityRecognition is a new set of APIs that has been made immediately available to developers, allowing them to listen to what the device user is doing without having to run complex pattern analysis on raw sensor data. In fact developers don’t need to deal with sensors at all, they just call the API, Google does some thinking and returns a notification that says something like “I think the device’s user is on foot, and I’m 80% confident about that”, except in code form. So far the activities recognised are “tilted”, “on foot”, “on bicycle” and “in vehicle”, but we can expect more to be added.

This is not just for joggers.

The ActivityRecognition APIs lower the barrier for anyone who wants to build a quantified self app, but the implications go far beyond life tracking. App behaviour can now vary depending on user activity. Suppose you have an app that recommends nearby restaurants which works by making a database call to bring back top rated places nearby when the app is opened. If the app knows the user is in a vehicle it could make the queried area larger than if they’re on foot. If your app has widgets you may want to change the update frequency based on user activity, if you run a navigation app you might want to alter the screen that is launched depending on user’s activity.

For anyone operating a sensor network – like WeatherSignal or OpenSignal - then this is a huge windfall. We’ll be able to compare the performance of signal in vehicles, to when the phone is still (most likely at home/work), and we’ll be able to filter our weather readings more precisely.

How can Google roll this out so quickly?

These new APIs are distributed through Google Play Services, an intriguing piece of software downloaded and (automatically) updated from Google Play. While it’s similar to an app, it’s not an app – it’s the thing the drives the latest versions of the Youtube app and the 3D maps in OpenSignal and WeatherSignal. Because of the way it’s distributed, and because it’s independent of the Android version, updates can happen quickly – unlike system updates. Also many Google Play Services, ActivityRecognition included, seem to work by sending data to Google’s servers, which means improvements to the ActivityReocgnition algorithms could happen in near real-time without being too heavy on your phone’s CPU. Update after some testing it seems that ActvityRecognition does work without a network connection.

Just to prove how quickly developers can move with this: we’ll be adding ActivityRecognition to the next version of WeatherSignal (which will be released tomorrow) and we’ll endeavour to get it logging data that you can output to CSV.

What doesn’t it do?

ActivityRecognition is not instantaneous, sensor data needs to be collected and analysed over a small time duration – typically I’m seeing a delay of 3s on my Galaxy Nexus before events are recognised. The number of activities recognised is rather small, I’m hoping another layer will be added to recognise whether the user is indoors or outdoors, I’d also like “on foot” to be broken down into walking/jogging/running/hopping/hobbling/skipping … but it’s a start.

How well does it work?

I’ve found it occasionally thinks I am in a vehicle when I’m walking (and I don’t walk that fast!), the 3s delay is a little annoying and I’m hoping that will be improved. Other than that, I’m impressed. Get WeatherSignal v1.8 to test it out for yourself (to be released 17th may).

ActivityRecognition in its current incarnation is interesting, but it’s indicative of something much bigger: Google is looking to help developers by using its processing power and data to provide them with better contextual information. Don’t be surprised if your phone soon recognises not just that your on foot, but that you’re out shopping or in the park.

Posted in Android Development, Mobile Trends | Tagged , , , , , , | 1 Comment

Getting Started WIth Activity Recognition: Android Developer Guide

This one’s for the Android devs!

Google’s Activity Recognition is so new it’s hard to find any documentation on it, although there are abundant news stories announcing it. I’ve put together a very quick guide on adding it into your app. You can find the official API docs here. It’s worth a read, it contains lines such as: “The device is on a bicycle”, which I find unreasonably funny.

You will need:
Make sure you have the latest versions of Google Play Services library – download/update using Android SDK Manager and also ADT (use Help>Check for updates). If you already have the Google Play Service library in your workspace I recommend running a Clean (Project>Clean…) after updating it, if you don’t have it import it as a library project, as described here.

Add the manifest permission:
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"\>

Note, that in contrast to Android GoogleMaps no API key is needed, suggesting this service is unlikely to be rate limited, at least not for a while.

ActivityRecognitionScan
Create a new class that can kick off a scan for ActivityRecognition, I’ve called mine ActivityRecognitionScan.class. Here it is in full:


public class ActivityRecognitionScan implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener{
private Context context;
private static final String TAG = "ActivityRecognition";
private static ActivityRecognitionClient mActivityRecognitionClient;
private static PendingIntent callbackIntent;

public ActivityRecognitionScan(Context context) {
this.context=context;
}

/**
* Call this to start a scan - don't forget to stop the scan once it's done.
* Note the scan will not start immediately, because it needs to establish a connection with Google's servers - you'll be notified of this at onConnected
*/
public void startActivityRecognitionScan(){
mActivityRecognitionClient = new ActivityRecognitionClient(context, this, this);
mActivityRecognitionClient.connect();
if(Config.TESTER_VERSION){Log.d(TAG,"startActivityRecognitionScan");}
}

public void stopActivityRecognitionScan(){
try{
mActivityRecognitionClient.removeActivityUpdates(callbackIntent);
if(Config.TESTER_VERSION){Log.d(TAG,"stopActivityRecognitionScan");}
} catch (IllegalStateException e){
// probably the scan was not set up, we'll ignore
}
}

@Override
public void onConnectionFailed(ConnectionResult result) {
if(Config.TESTER_VERSION){Log.d(TAG,"onConnectionFailed");}
}

/**
* Connection established - start listening now
*/
@Override
public void onConnected(Bundle connectionHint) {
Intent intent = new Intent(context, ActivityRecognitionService.class);
callbackIntent = PendingIntent.getService(context, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
mActivityRecognitionClient.requestActivityUpdates(0, callbackIntent); // 0 sets it to update as fast as possible, just use this for testing!
}

@Override
public void onDisconnected() {
}

}

Not Confi.TESTER_VERSION is a global constant boolean (public static final boolean) which I’m using to control whether logs appear.
Now we need to set up the service that is called in the above class:

Create the service to receive updates from Google Play Services

package com.opensignal.weathersignal.datacollection;

import com.google.android.gms.location.ActivityRecognitionResult;
import com.google.android.gms.location.DetectedActivity;

import android.app.IntentService;
import android.content.Intent;
import android.util.Log;

public class ActivityRecognitionService extends IntentService{

private static final String TAG ="ActivityRecognition";

public ActivityRecognitionService() {
super("ActivityRecognitionService");
}

/**
* Google Play Services calls this once it has analysed the sensor data
*/
@Override
protected void onHandleIntent(Intent intent) {
if (ActivityRecognitionResult.hasResult(intent)) {
ActivityRecognitionResult result = ActivityRecognitionResult.extractResult(intent);
if(Config.TESTER_VERSION){
Log.d(TAG, "ActivityRecognitionResult: "+getFriendlyName(result.getMostProbableActivity().getType()));
Log.d(TAG, result.toString());
}

// YOUR FUNKY CODE GOES HERE!
}
}

/**
* When supplied with the integer representation of the activity returns the activity as friendly string
* @param type the DetectedActivity.getType()
* @return a friendly string of the
*/
private static String getFriendlyName(int detected_activity_type){
switch (detected_activity_type ) {
case DetectedActivity.IN_VEHICLE:
return "in vehicle";
case DetectedActivity.ON_BICYCLE:
return "on bike";
case DetectedActivity.ON_FOOT:
return "on foot";
case DetectedActivity.TILTING:
return "tilting";
case DetectedActivity.STILL:
return "still";
default:
return "unknown";
}
}
}

Declare the service in the manifest
Don’t forget to declare this service in the Manifest – doing so won’t throw any errors, but your code won’t work.

Now all you need to do is call new ActivityRecognitionScan(this).startActivityRecognitionScan() from an activity and you should start getting udpates if you have a network connection – though it may take a couple of seconds.

Make sure you don’t break compatibility
Note, you’ll likely want to check:

GooglePlayServicesUtil.isGooglePlayServicesAvailable(context)==ConnectionResult.SUCCESS

Before calling any services that depend on Google Play Services.

Have fun!

Posted in Android Development | Leave a comment

Hide Yo Phones, Hide Yo Wives

On a sweltering spring day in southwest Dallas I was standing outside my car, parked on a flat and near-empty stretch of urban road. The sun was quickly drying the cars coming out of the car wash across the street and I was playing with the OpenSignal app on my tester phones. Seemingly out of nowhere an old man was standing behind me. He looked like Morgan Freeman in The Shawshank Redemption, except in the as-yet-unmade sequel where Morgan’s character Red gets bored with living on the beach in Zihuatanejo and moves to Texas to sleep on the couch in a disreputable auto body shop and develop a significant cough syrup habit.

morgan freeman in shawshank redemption

That’s me on the left.

He said “Selling some phones, eh?” I’ve come to expect this. As I’ve mentioned before, many people ask if I’m selling phones. I suppose it isn’t too far away of a concept when a strange looking man (my mother may disagree) pulls up in a sedan and opens a case featuring an assortment of very nice mobile devices that are neatly labeled “AT&T, Verizon, Sprint, T-Mobile.” However, a few things have crossed my mind about this phenomenon, some personal, some more wide reaching.

1. Do I look like a guy who sells stolen phones? I did forget to bring beard trimmers on this trip and I haven’t gotten a haircut since I left New York in late March, but I was hoping there was a “type” of person who fences stolen electronics.

Pat Healy in There's Something About Mary

This guy looks like he sells phones from the trunk of his car. But I don’t look like this guy… do I?

2. I thought you needed to “know people.” I’ll admit this is a vague concept in my head, but I was under the impression that if one wanted to acquire an “off-market” electronic device, someone in your social circle would pull you aside, maybe in a bar or at some secret-password dice game under a highway overpass and say something like “Look, don’t let this get around, but I know a guy…” Having literally flown in to town for the first time less than 24 hours ago, I most assuredly do not “know people.”

3. Should I request an armed escort for next years mobile carrier tests? I’m pretty sure that’s not in the budget. I do sometimes get the feeling that I was chosen for this job partially for my abilities, and partially for looking like someone who might not get mugged. I assure you that is an incorrect assumption based solely on general size and tattoo prevalence.

4. Just as not all “trunk based electronics resellers” look like Pat Healey, I’ve noticed that the people who are considering their options in buying phones are not a specific type. I’ve been asked about selling phones in nearly every city I’ve been in and I can tell you there is no type. They have truly been everywhere on the age, color and creed spectrum. I will say that I have not been asked by any little old ladies. In fact, women are underrepresented in the are-you-selling-phones phenomenon, but that could just be a statistical anomaly that means they have other venues available to them.

Back to Morgan Freeman. He shook my hand and went on to tell me about how he was just released from jail after 11 years. “Welcome to the outside,” I said. I was rather proud of myself for that. Who knew watching television cop dramas would be so linguistically useful? But then he went into detail. He told me that he was in there for murdering his sister in-law with a Louisville Slugger. He seemed proud that he was man enough to not resort to gun or knife violence and described the situation in detail. He was clearly gauging my reaction. I went on pressing buttons on the phones and pretended to be interested in the megabytes and kilobytes and downloads and uploads and not wanting to hide under the nearest available rock. From the corner of my eye, I saw him fish around in his pocket for something and then possibly decide I wasn’t worth the effort. He asked me for some change. I pretended to check my pockets and told him I didn’t have any. “I’m just out here on a job, I don’t even have my wallet with me, man,” I said. I went back to staring at the phones. I realized that I was a terrible lier and that he could easily see the outline of my wallet in my back pocket.

When I looked up again he was gone. My wallet was still there, all the equipment was still there and there was no Morgan Freeman coming at me from behind the car with a baseball bat. I finished up as quickly as possible and got the hell out of there. It was my last stop of the day and I was driving to Houston. I would be lying if I told you I did not check the back seat at least twelve times during that four hour drive because I was totally spooked.

I’m not sure why he decided I wasn’t worth messing with, but it probably was just a matter of chance. Thefts and assaults involving mobile phones are rising. This map of mobile phone thefts in San Francisco should give you an idea of what we are talking about (put together by the folks at InfoWorld and powered by Leaflet and OpenStreetMap using data from SFPDyay open data!).

“In Washington, D.C., cellphone thefts account for 40 percent of robberies, while in New York City, they make up more than half of all street crime. There are no hard numbers on which phones are most popular, but those most in demand  by thieves appear to be those most in demand by users: iPhones.” -InfoWorld: A violent cellphone crime wave sweeps the US

Anecdotally I’ve also noticed more brand recognition for iPhones, over the Samsung Note II‘s that I’m carrying. For a while I had an apple sticker on the front of my carrying case, but took it off when I realized it might be making me a target. At the Stonestown Galleria in San Francisco, I saw a teenage boy sprint past a table in the foodcourt, swipe an older man’s iPhone off the table as he watched a movie, and run swiftly toward the exit. It happened in an instant. The kid was tackled by mall security before he reached the outer exit, the food court erupted in cheers and hopefully the mall cop got a raise.

Cell Phone Thefts in San Francisco

Welcome to San Francisco, give me your iPhone!

There are a lot of ways to prevent theft, but none are perfect. Phones are made to be used, and be conveniently mobile, which are exactly the attributes that make them easy to steal. For my personal devices, I’m a big fan of Prey but there’s also Apple’s preinstalled version, “Find My iPhone.” Ben Boychuk (@benboychuk) at MacWorld has some tips for keeping phones and other devices safe.

And if you are considering buying a smartphone, please don’t ask me to sell you one. Also, it’s not a good idea to buy one in a parking lot, because it’s probably a block of wood.

You can follow my travels on Facebook (OpenSignal Gabe), FourSquare (OpenSignal) where I’ll be checking in periodically. I’ll also be blogging some more about my epic road trip here on the OpenSignal Blog.

Posted in Comparing Coverage, Team, WiFi Map Update | Tagged , , , , , , , , , , , | 1 Comment

Is escaping to the wilderness the answer?

We recently came across the news that Pinterest co-founder Evan Sharp uses our coverage maps in a rather interesting way. Rather than using them purely as they were intended, he and his wife use our maps to deliberately drive to places with no signal, as a way of getting some respite from the constantly connected world.

We always think it’s cool when people use our services in unexpected ways and the thought of using the map to deliberately find places without signal had already occurred to us – although hearing about someone actually doing it was definitely a surprise. It does, however, cause us to ask ourselves one pretty serious question: has it really come to this?

In between the concluding question mark of that previous paragraph and the introductory preposition of this self-referential sentence, my concentration was momentarily broken. I flipped over my facedown phone to reveal its obverse and, as expected, the screen was completely devoid of new information. Nothing had changed but the time display, and that was probably to be expected, the effective digital record of time’s passage isn’t dependent on my constant clock-watching. The odds of someone having texted me without my having noticed the vibrations were slim to none and yet I did it anyway – breaking the flow of my words, fragmenting my thoughts.

Of course the seemingly obvious answer is to switch off, or at least airplane-mode off. The problem with this, of course, is that it requires willpower and concentration. The same willpower and concentration required for me not to flip my phone over and allow my paragraphs to be curtailed by that distraction. When I choose to switch off I’m always aware of that choice, aware of the possibility of its reversal – and that awareness can be almost as distracting as actually checking my phone. In short, switching it off is really only a more complicated way of turning the phone face down.

almost certainly signal-free

almost certainly signal-free


So is driving into the wilderness the answer, if even only temporarily? It certainly seems the best way to separate non-availability and the continued exertion of willpower. Perhaps for London they should make it so some of the parks are cell-phone signal free (except for calls to emergency services of course). This would help ease the difficulties associated with simply making the ‘choice’ to turn your phone off. One of the things that people don’t seem to grasp when they advocate making that choice is to do with its deceptive singularity – a choice is described as one event when really it is a string of dependent events. Each time you choose to turn your phone off you have to keep remaking that choice until you turn it back on. By creating a circumstance where the choice really is one event (going to a signal free area) then turning off your phone could become as relaxing as it already should be.

Posted in Mobile Trends | Tagged , , , , , , | Leave a comment

A few ways to use WeatherSignal

A few days ago we launched WeatherSignal – a new project to crowdsource weather data using native sensors in Android phones. We think this is a really exciting idea, and hope that our network of users will help us to improve localised weather recording. One of the big things the app does, however, is to help people make use of the sensors they have in their phones – both for collecting weather data and for whatever reasons they can think of! It just seemed a bit silly to have phones that can record pressure (for GPS positioning purposes) but not actually display it to interested users. The exciting thing about releasing this app is that we’re looking forward to seeing how people have made use of the sensor data, all of which is exportable as a CSV file so you can do your own analysis at home. Please let us know the ways you’re using the app, we’re always interested to hear! But in case you need some inspiration, we present a few fun things you can do with the WeatherSignal sensor readings.

 1) Look at the acceleration pattern of your movement

Most smartphones these days have an accelerometer and so we included acceleration readings in the app. Because these readings aren’t strictly to do with the weather, you have to turn them on in settings to be able to see them. One cool thing you can do is hold the phone while walking, and see the way you accelerate while walking. It’s surprisingly addictive, I quickly found myself sprinting up and down the office while staring at my smartphone – needless to say I got some pretty weird looks. Also check out the resting acceleration which should be around 9.81m/s2. This is because the Earth’s gravitational pull means that the accelerometer is constantly recording acceleration. If you’re interested in how much that acceleration is affected by where you are in in relation to the equator it changes based on latitude because of the shape of the earth) then take a look here.

 2) Measure the Magnetic field

Ok. To be perfectly honest we’re not 100% sure what the best thing to do with the Magnetometer is. We’re using it to try and map the Earth’s magnetic field, but it’s also pretty cool to hold it near electrical devices and watch the magnetic field go up. Also, it can be used to steer robots – although getting magnetic positioning is probably the easy part of robot building. If you find a cool use for the Magnetometer then let us know!

The Earth's Magnetic Field

The Earth’s Magnetic Field

 3) Maximise your sunlight

We’re constantly reading about how the glare of fluorescent office lighting is detrimental to our health, especially as the English weather doesn’t give much of an opportunity for sun-exposure at the best of times. If you want to help maximise your body’s serotonin production then maybe the WeatherSignal app can help, especially if you’re in a position to choose where you sit in the office. Simply use the WeatherSignal app’s Lux Meter to see where in the office gets the most sunlight and then immediately shotgun it before anyone else can. The app might not help win you many friends, but who needs friends when you’re bathing in the weak glow of the English sun all day?

Posted in WeatherSignal | Tagged , , , , , , , , | Leave a comment