android_learning:headfirst_android_development_notes:chapter_9
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
android_learning:headfirst_android_development_notes:chapter_9 [2016/03/03 02:03] – [Chapter 9] mithat | android_learning:headfirst_android_development_notes:chapter_9 [2016/03/16 03:34] (current) – [p. 370: Creating the project] mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <WRAP center round important | + | ====== Chapter 9 ====== |
+ | <WRAP center round important | ||
The changes to Android Studio 1.5.1 have put this chapter well out of sync with both the "Blank Activity" | The changes to Android Studio 1.5.1 have put this chapter well out of sync with both the "Blank Activity" | ||
</ | </ | ||
- | |||
- | ====== Chapter 9 ====== | ||
It might be a little ambiguous in the Chapter intro, so here's a summary of what you're going to do in the chapter. You will build an app that has an //action bar//. An action bar is space at the top of an app that holds the activity name or other info on the left (in LTR languages) as well as a menu on the right (in LTR languages). The menu will have a number of items; some of those items will be specified to be pulled out of the drop down list and placed on the action bar as //action buttons// alongside the menu. | It might be a little ambiguous in the Chapter intro, so here's a summary of what you're going to do in the chapter. You will build an app that has an //action bar//. An action bar is space at the top of an app that holds the activity name or other info on the left (in LTR languages) as well as a menu on the right (in LTR languages). The menu will have a number of items; some of those items will be specified to be pulled out of the drop down list and placed on the action bar as //action buttons// alongside the menu. | ||
- | The action bar is a bit of a cluster fudge at the moment. It wasn't to Android added until relatively recently, and if you want to build apps using action bars that target older versions of Android, you'll have to use compatibility libraries. The syntax when compatibility libraries is just different enough from current Android " | + | The action bar is a bit of a clustercuss |
Another issue is that the compatibility libraries seem to be buggier than the current Android " | Another issue is that the compatibility libraries seem to be buggier than the current Android " | ||
Line 12: | Line 11: | ||
===== p. 370: Creating the project ===== | ===== p. 370: Creating the project ===== | ||
- | When creating the project, set the minimum API level to **21** (not 17). Be sure you specify an Empty app template in the new app wizard. | + | <WRAP center round important 90%> |
+ | When creating the project, set the minimum API level to **21** (not 17). | ||
+ | </ | ||
+ | |||
+ | It will hurt if you don' | ||
+ | |||
+ | Be sure you specify an **Empty app template** in the new app wizard. | ||
==== menu_main.xml ==== | ==== menu_main.xml ==== | ||
Line 36: | Line 41: | ||
==== v7 appcompat libraries ==== | ==== v7 appcompat libraries ==== | ||
- | Way over on p. 385 there is an aside about action items not appearing when using some version | + | Way over on p. 385 there is an aside about action items not appearing when using some versions |
- | This will make '' | + | So, start by removing the project' |
+ | |||
+ | This will make '' | ||
+ | |||
+ | Isn't this fun? | ||
===== p. 372 ===== | ===== p. 372 ===== | ||
Open up '' | Open up '' | ||
+ | |||
+ | If a label isn't specified for an activity, Android will use the app's label instead. In this case we are setting the activity' | ||
===== p. 374 ===== | ===== p. 374 ===== | ||
- | Now lets take care of the problem caused by the " | + | Now let' |
Also get rid of the items for colorPrimary, | Also get rid of the items for colorPrimary, | ||
- | If you are seeing errors now, it might be because you forgot to specify a minimum API level of 21. You can fix that now by opening //File > Project Structure...// | + | If you are seeing errors now, it might be because you forgot to specify a minimum API level of 21 when you create the app. You can fix that now by opening //File > Project Structure...// |
Try running the app. It's smoother sailing from here out. | Try running the app. It's smoother sailing from here out. | ||
Line 62: | Line 73: | ||
</ | </ | ||
- | Be sure to use '' | + | Be sure to use '' |
+ | |||
+ | Isn't that nice? | ||
Add the " | Add the " | ||
==== The icons ==== | ==== The icons ==== | ||
- | The code above references " | + | The code above references " |
- | Instead the authors are now recommending you grab images from the '' | + | Whee. |
+ | |||
+ | Instead the authors are now recommending you grab images from the '' | ||
===== p. 380 ===== | ===== p. 380 ===== | ||
- | The author' | + | The author' |
+ | |||
+ | Yay. | ||
<code java> | <code java> | ||
@Override | @Override | ||
Line 107: | Line 124: | ||
===== p. 382 ===== | ===== p. 382 ===== | ||
- | Be sure to create a new Empty activity. It should automagically generate | + | Be sure to create a new Empty activity. It should automagically generate |
===== p. 383 ===== | ===== p. 383 ===== | ||
Line 193: | Line 210: | ||
===== p. 392 ===== | ===== p. 392 ===== | ||
- | Curiously, in the manifest if you don' | + | Since this app isn't supporting API 16 and lower, you don' |
===== p. 393 ===== | ===== p. 393 ===== | ||
Code it like you see it. | Code it like you see it. |
android_learning/headfirst_android_development_notes/chapter_9.1456970620.txt.gz · Last modified: 2016/03/03 02:03 by mithat