WARNING: Application does not specify an API level requirement !

書籍のサイトからサンプルをダウンロードして実行させているんだけど、

WARNING: Application does not specify an API level requirement !

という警告が出る。
「アプリケーションがAPIレベル要求を指定していない」と言ってるよう。

Android SDK 1.5のバージョンノーツによると、マニフェストファイルで妥当なプラットフォームバージョンのAPIレベルを指定する必要があるとのこと。

Android 1.5 Version Notes

When you migrate your application to the new SDK, you will need to choose the platform version against which you will compile your application. In general, you should compile your application against the lowest possible version of the platform that your application can support. After you determine the lowest version, you should ensure that your application's manifest file defines the API Level of the lowest compatible platform version in the android:minSdkVersion attribute.

After compiling your application, you should make sure to test it on the platform specified in the application's android:minSdkVersion attribute. To ensure forward-compatibility, you should also run the application on platforms using a higher API Level than that used by your application. To run your application against different platform versions in the emulator, you create an AVD for each platform version that you want to test. For more information about AVDs, see Android Virtual Devices. If you are using a physical device for testing, ensure that you know the API Level of the Android platform it runs.

If you build an application using the Android 1.5 library and your application makes use of any APIs introduced in API Level 3, you must set the android:minSdkVersion attribute in the application's manifest to "3".

以下のように書くらしい。


...

...

とりあえずコレを書くと、ワーニングは出なくなった。