Right off, we've had a reader point out one issue:
In Chapter 1, when adding the code to play an audio file from a remote URL, Android 4 (Ice Cream Sandwich) now requires and enforces the Internet permission. We've tested on previous SDK versions and, indeed, this permission was not enforced on any prior platform versions. In this case, we completely agree that it should have been -- the sample application has been using Internet data without needing to request a permission since Android 1.0-but now it needs this permission.
Luckily, the LogCat output makes this crystal clear:
12-04 15:08:15.674: D/MediaPlayer(605): Couldn't open file on client side, trying server side
12-04 15:08:15.684: W/ServiceManager(36): Permission failure: android.permission.INTERNET from uid=10044 pid=605
12-04 15:08:15.684: E/MediaPlayerService(36): Request requires android.permission.INTERNET
12-04 15:08:15.684: E/MediaPlayer(605): Unable to to create media player
The Android documentation has been updated to state, at the class level, that MediaPlayer requires the INTERNET permission when used with network based content. As it should. What isn't stated is if older SDKs will eventually be updated to enforce this permission or not. Right now, we only see this permission being enforced when running the application on API Level 14, which, right now, is less than 1% of all devices in the field.
We apologize for any inconvenience or confusion this issue has caused. The update will also be applied to the full book, Android Wireless Application Development: Volume 1: Android Essentials: Third Edition (or, as we like to call it, AWAD3EV1). We will also update the code available on this website to reflect the permission policy change.