Wrox Home  
Search

Topic: Mobile

Professional Android 4 Application Development (1118102274) cover image

Professional Android 4 Application Development

Reto Meier
ISBN: 978-1-118-10227-5
Paperback
864 pages
May 2012
View Most Recent Edition of This Title
Other Available Formats: Wiley E-Text
If you are an instructor, you may request an evaluation copy for this title.
Paperback Version: US $44.99 Add to Cart

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
256 Error in Code
In example code it shows:

db.execSQL("DROP TABLE IF IT EXISTS " + DATABASE_TABLE);

Should read:

db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
08/27/2012
292 Error in Code
Listing 8-24:

Currently reads:
<activity android:name=?.DatabaseSkeletonSearchResultsActivity?

Should read:
<activity android:name=?.DatabaseSkeletonSearchActivity?
04/16/2012
292 Error in Code
Currently reads:
android:value=".DatabaseSkeletonSearchResultsActivity"

Should read:
android:value=".DatabaseSkeletonSearchActivity"
04/16/2012
295 Error in Code
Listing 8-27:

Currently reads:
String query = args.getString(QUERY_EXTRA_KEY);

Should read:
query = args.getString(QUERY_EXTRA_KEY);
04/16/2012
301 Error in Code
Listing 8-34:

Currently reads:
code snippet PA4AD_ Ch08_DatabaseSkeleton/src/MySearchSuggestionsContentProvider.java

Should read:
code snippet PA4AD_ Ch08_DatabaseSkeleton/res/xml/searchablewithsuggestions.xml
04/16/2012
309 Error in Code
In the section titled "Using the Earthquake Provider," insert a new line as the first line of code for Step 6:
Handler handler = new Handler();
04/16/2012
317 Error in Code
Listing 8-35

Currently reads:
String contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;

Should read:
Uri contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
04/16/2012
349 Error in Code
Listing 9-14:

Currently reads:
private void listing916() {

Should read:
private void backgroundExecution() {
04/16/2012
350 Error in Code
Listing 9-15:

Currently reads:
private void listing916() {

Should read:
private void backgroundExecution() {
04/16/2012
404 Error in Code
Listing 10-32:

Currently reads:
Handler hander = new Handler();

Should read:
Handler handler = new Handler();
04/16/2012
510-511 Error in Code
In the section titled "Creating a Weather Station", Step 7 should be:
private void updateGUI() { 
  runOnUiThread(new Runnable() { 
    public void run() { 
      if (!Float.isNaN(currentPressure) { 
        pressureTextView.setText(currentPressure + "hPa"); 
        pressureTextView.invalidate(); 
      } 
      if (!Float.isNaN(currentLight) { 
        String lightStr = "Sunny"; 
        if (currentLight <= SensorManager.LIGHT_CLOUDY) 
          lightStr = "Night"; 
        else if (currentLight <= SensorManager.LIGHT_OVERCAST) 
          lightStr = "Cloudy"; 
        else if (currentLight <= SensorManager.LIGHT_SUNLIGHT) 
          lightStr = "Overcast"; 
        lightTextView.setText(lightStr); 
        lightTextView.invalidate(); 
      } 
      if (!Float.isNaN(currentTemperature) { 
        temperatureTextView.setText(currentTemperature + "C"); 
        temperatureTextView.invalidate(); 
      } 
    } 
  }); 
};
04/16/2012
539 Error in Code
Listing 13-12:

The source location for the code snippet is incorrect. It should be:

code snippet PA4AD_Ch13_Mapping/src/MyMapActivity.java
04/16/2012
540 Error in Code
Listing 13-13:

The source location for the code snippet is incorrect. It should be:

code snippet PA4AD_Ch13_Mapping/res/layout/map_layout.xml
04/16/2012
555 Error in Code
Listing 13-18:

The source location for the code snippet is incorrect. It should be:

code snippet PA4AD_Ch13_Mapping/MyItemizedOverlay.java
04/16/2012
577 Error in Code
Listing 14-12:

The source location for the code snippet is incorrect. It should be:

code snippet PA4AD_Ch14_MyWidget/res/xml/widget_provider_info.xml
04/16/2012
577 Error in Code
Listing 14-12:

Should be:
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider
  xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/my_widget_layout"
  android:minWidth="110dp"
  android:minHeight="110dp"
  android:label="@string/widget_label"
  android:resizeMode="horizontal|vertical"
  android:previewImage="@drawable/widget_preview"
  android:updatePeriodMillis="3600000"
/>
04/16/2012
578 Error in Code
Listing 14-13:

The source location for the code snippet is incorrect. It should be:

code snippet PA4AD_Ch14_MyWidget/AndroidManifest.xml
04/16/2012
586 Error in Code
In the section titled "Creating an Earthquake Widget", Step 7.1 should be:

public static String QUAKES_REFRESHED =  
  "com.paad.earthquake.QUAKES_REFRESHED"; 

 @Override 
protected void onHandleIntent(Intent intent) { 
  refreshEarthquakes(); 
  sendBroadcast(new Intent(QUAKES_REFRESHED)); 
}
04/16/2012
601 Error in Code
In the section titled "Creating an Earthquake Collection View Widget", Step 7 should be:

private Cursor c; 

 private Cursor executeQuery() { 
  String[] projection = new String[] { 
      EarthquakeProvider.KEY_ID, 
      EarthquakeProvider.KEY_MAGNITUDE, 
      EarthquakeProvider.KEY_DETAILS 
    }; 

  Context appContext = getApplicationContext(); 
  SharedPreferences prefs =  
    PreferenceManager.getDefaultSharedPreferences(appContext); 

  int minimumMagnitude =  
    Integer.parseInt(prefs.getString(PreferencesActivity.PREF_MIN_MAG, "3")); 

  String where = EarthquakeProvider.KEY_MAGNITUDE + " > " + minimumMagnitude; 

  return context.getContentResolver().query(EarthquakeProvider.CONTENT_URI, 
      projection, where, null, null);  
} 

public void onCreate() { 
  c = executeQuery(); 
} 
04/16/2012
604 Error in Code
Also in the section titled "Creating an Earthquake Collection View Widget", Step 12 should be:

@Override
protected void onHandleIntent(Intent intent) {
  refreshEarthquakes();
  sendBroadcast(new Intent(QUAKES_REFRESHED));

  Context context = getApplicationContext();
  AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
  ComponentName earthquakeWidget = 
    new ComponentName(context, EarthquakeListWidget.class);
  int[] appWidgetIds = appWidgetManager.getAppWidgetIds(earthquakeWidget);

  appWidgetManager.notifyAppWidgetViewDataChanged(appWidgetIds,
    R.id.widget_list_view);
}
04/16/2012
607 Error in Code
Listing 14-28:

The source location for the code snippet is incorrect. It should be:

code snippet PA4AD_Ch14_MyLiveFolder/src/MyContentProvider.java
04/16/2012
609 Error in Code
Listing 14-30:

The source location for the code snippet is incorrect. It should be:

code snippet PA4AD_Ch14_MyLiveFolder/src/MyLiveFolder.java
04/16/2012
610 Error in Code
Listing 14-31:

The source location for the code snippet is incorrect. It should be:

code snippet PA4AD_Ch14_MyLiveFolder/src/MyLiveFolder.java
04/16/2012
610 Error in Code
Listing 14-32:

Currently reads:
<activity android:name=".MyLiveFolder "

Should read:
<activity android:name=".MyLiveFolder"
04/16/2012
627 Error in Code
Listing 15-3:

Currently reads:
android:id=?@+id/buttonStop? 
android:layout_width=?wrap_content? 
android:layout_height=?wrap_content? 
android:text=?Stop?

Should read:
android:id=?@+id/buttonPause? 
android:layout_width=?wrap_content? 
android:layout_height=?wrap_content? 
android:text=?Pause?
04/16/2012
629 Error in Code
Listing 15-4:

Currently reads:
stopButton.setOnClickListener(new OnClickListener() {

Should read:
pauseButton.setOnClickListener(new OnClickListener() {
04/16/2012
671 Error in Code
Listing 16-4:

Currently reads:
RESULT_CANCELLED

Should read:
RESULT_CANCELED
04/16/2012
672 Error in Code
Listing 16-5:

Currently reads:
blueTooth

Should read:
bluetooth
04/16/2012
678 Error in Code
Listing 16-8 should be:

private void listenForMessages(BluetoothSocket socket, 
                                   StringBuilder incoming) {
      listening = true;


      int bufferSize = 1024;
      byte[] buffer = new byte[bufferSize];
      try {
        InputStream instream = socket.getInputStream();
        int bytesRead = -1;


        while (listening) {
          bytesRead = instream.read(buffer);
          if (bytesRead != -1) {
            String result = "";
            while ((bytesRead == bufferSize) &&
                   (buffer[bufferSize-1] != 0)){
              result = result + new String(buffer, 0, bytesRead - 1);
              bytesRead = instream.read(buffer);
            }
            result = result + new String(buffer, 0, bytesRead - 1);
            incoming.append(result);
          }
          socket.close();
        }
      } catch (IOException e) {
        Log.e(TAG, "Message received failed.", e);
      }
      finally {
      }
    }

04/16/2012
737 Error in Code
In the section titled "Automating the Emergency Responder," in Step 12:

Currently reads:
defaultResponseText);

Should read:
AutoResponder.defaultResponseText);
04/16/2012
747 Error in Code
Listing 18-5 currently reads:
    }
}
Should read:
    }
  }
}
04/16/2012
Printer-Ready Version   Share This
With you wherever you go: pdf + ePub + kindle -- DRM-free