[Android] Sams Teach Yourself Android in 24 Hours

Each chapter contains Quizzes, Q&A and Exercises to help readers assess their skills. This book is the first step to getting started as a professional Android application developer.

  • Quizze

What is the recommended way to get a Context instance, required by many Android calls?

  • Context context = (Context) this;
  • Context context = getAndroidObject(CONTEXT);
  • Context context = getApplicationContext();

新しいAndroidSDK解説本です。ラフカットということで、まだ出版前の本ですが、だいたい大筋は出来上がっているようです。まだ、SDK1.5の内容なので、きっと、これから1.6に変更するんだろうなぁという感じです。
内容的には、特に目新しいこともなく、普通の入門本のようです。章の最後にクイズがついているのですが、今のところ、ちょっと物足りない感じでがします。今後の拡張に期待したいところです。
で、上の問題がちょっと気になったので、本文の記述を読んでみたら、「You might be tempted to just use your Activity Context in all cases. Doing so can lead to memory leaks, though. The subtleties of why this happens are beyond the scope of this book, but there is a great official Android blog post on this topic, which can be found here...」ということで、この本のスコープ外だから、以下のブログへのリンクになっていました...
>