The Five Steps to Future Hardware Happiness

[This post is by Reto Meier AKA @retomeier, who wrote the book on Android App development. —Tim Bray]

Two questions I regularly get asked are “Why isn’t my app visible on the Market on the (insert device name here)?” and “How can I prepare for GoogleTV and Android tablets?” If you care about how broadly your app is available, pay attention now. Seriously. I don’t want to hear anyone telling me they weren’t told. [Seems a little combative? -Ed. Take it up a notch! -RM]

By now you’ve probably heard of Google TV, the Samsung Galaxy Tab, and the Dell Streak. These are only the vanguard — Android is quickly moving to hardware that is increasingly different from the smartphone devices we’re used to. The variations in hardware — including lack of features like GPS, accelerometers, and video cameras — means it’s time for you to think about what hardware your app needs, and what it can function without.

To make life easier every API includes a FEATURE_* constant. To control your app’s availability on the Android Market, you specify the features required for your app to work. I’d like to encourage you to add manifest Feature nodes for every API you use, specifying them as optional, or not, as appropriate using a manifest uses-feature nodes as shown below:

<uses-feature android:name="android.hardware.microphone"
              android:required="true"/>

Market won’t be inferring any future API features

My earlier post on future proofing your apps describes a process of feature inferring that used your app’s permissions to help us ensure apps were only visible on the appropriate hardware.

This process has evolved over time. From now on Market won’t be inferring future API features and we have no way to infer some previously available APIs (eg. sensors). As a result you’ll need to specify your mandatory and optional feature requirements — or risk your app either breaking or not being available for some users.

The 5 steps to future hardware happiness

  1. Specify a uses-feature node for every API feature used by your app. This forces you to think about what your app uses, allowing you to:
  2. Decide which features are necessary for your app to be useful and mark those featured with the attribute required=true. This lets Market hide your app from any device that doesn’t support the hardware features your app requires.

    <uses-feature android:name="android.hardware.telephony"
                  android:required="true"/>

  3. For features that aren’t strictly required, set required=false.

    <uses-feature android:name="android.hardware.bluetooth"
                  android:required="false"/>

  4. Then go in to your code and find where you have used the optional features. Use the hasSystemFeature method from the PackageManager to determine if the hardware is available and provide alternative paths for your code as appropriate.

    PackageManager pm = getPackageManager();
    boolean hasCompass = pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS);

  5. Now you can sleep soundly in the knowledge that no matter what variation in Android compatible hardware comes to market, your app will always (and only) be available on those it supports.

You can find more details on how the Android Market uses filters to determine whether to show your application to a user who is browsing or searching for applications on a given device at the Market Filters page on the Android Developer Site.

Kite Aerial Photos of Manihi Now in Google Earth

Some of you may know about my five year trip around the world by sailboat which we are calling the Tahina Expedition. As part of a partnership with Google, I’m taking photos of the Earth in some places along the way just like what you see in Google Earth. Only, some of the photos are even better than what you normally see because we are flying a camera only a few hundred feet above the ground with a kite!

Kids watching kite aerial photos being taken in ManihiBack in May, we visited a beautiful Tuamotus atoll in French Polynesia called Manihi. We had a wonderful time visiting there, and one day we had perfect conditions to fly the kite. My goal was to capture parts of the village near the pass into the lagoon. We had time to walk down the main street on the north side. There were electric poles and wire and trees, so we couldn’t quite capture the entire street. It was a really unique experience because the local kids and some of the adults all came out to find out what we were doing. We asked the kids to help us when we had to bring down the kite.

Google just recently published our photos of Manihi in the latest imagery update. You can see the results below in Google Maps, or in Google Earth Make sure you zoom in close to see all the amazing detail. It’s way better than the surrounding satellite imagery for the rest of Manihi.

View Larger Map

You can read about the day we did the shooting or just watch the slideshow below for more photos showing the entire Manihi village from the air, and pictures of the kids who helped us.
View full-sized slideshow

Watch the slideshow in the post about BBQ Island for pictures of how we do the aerial photos. And, you can see another island we did in Google Earth called Petite Tabac. Special thanks to Stewart Long of Gonzo Earth who did all the processing of the photos and stitched them together so they could be delivered to Google for their database.

Sea Ice Extent Animation updated for 2010

We’ve told you a few times about the excellent Sea Ice Extent data that the National Snow and Ice Data Center (NSIDC) has been producing. They’ve recently updated their files to show data from 2010, and the results are quite stunning:
sea-ice-2010.jpg

According to their site, the 2010 low (reached on September 19) was the third lowest on satellite record:

Average ice extent for September 2010 was 4.90 million square kilometers (1.89 million square miles), 2.14 million square kilometers (830,000 square miles) below the 1979 to 2000 average, but 600,000 square kilometers (230,00 square miles) above the average for September 2007, the lowest monthly extent in the satellite record. Ice extent was below the 1979 to 2000 average everywhere except in the East Greenland Sea near Svalbard.

The U.S. National Ice Center declared both the Northwest Passage and the Northern Sea Route open for a period during September. Stephen Howell of Environment Canada reported a record early melt-out and low extent in the western Parry Channel region of the Northwest Passage, based on analyses of the Canadian Ice Service. Two sailing expeditions, one Norwegian and one Russian, successfully navigated both passages and are nearing their goal of circumnavigating the Arctic.

You can check it out for yourself using this KMZ file. Or, if you’d prefer, you can simply watch the video below that shows all of the data in the KMZ.