User Tools

Site Tools


android_learning:headfirst_android_development_notes:chapter_3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
android_learning:headfirst_android_development_notes:chapter_3 [2016/01/07 04:58] mithatandroid_learning:headfirst_android_development_notes:chapter_3 [2016/01/09 01:09] (current) – [Keyboard shortcuts for emulators] mithat
Line 1: Line 1:
-<WRAP center round info 60%> 
-Under development. 
-</WRAP> 
- 
- 
 ====== Chapter 3 notes ====== ====== Chapter 3 notes ======
  
-===== Keyboard shortcuts for "official" AVDs ===== +===== Keyboard shortcuts for emulators ===== 
-There's no obvious way to do things like push the power button on an AVD. There are keyboard shortcuts for doing these kinds of things. The [[http://developer.android.com/tools/help/emulator.html#KeyMapping|official Android documentation]] misses some of the available shortcuts; the list at [[http://www.shortcutworld.com/en/win/Android-Emulator.html|shortcutworld.com]] is more comprehensive.+There's no obvious way to do things like push power and volume buttons on an AVD. You can use keyboard shortcuts to do these kinds of things. The [[http://developer.android.com/tools/help/emulator.html#KeyMapping|official Android documentation]] misses some of the available shortcuts; the list at [[http://www.shortcutworld.com/en/win/Android-Emulator.html|shortcutworld.com]] is more complete.
  
 +Genymotion shortcuts are listed in the [[https://www.genymotion.com/#!/developers/user-guide|user guide]] under "Keyboard Shortcuts". I wasn't able to find documentation for Visual Studio Emulator for Android's keyboard shortcuts.
 ===== p. 75: Project properties ===== ===== p. 75: Project properties =====
   * App Name: ''Messenger''((As though there weren't enough apps named "Messenger" already. :-/))   * App Name: ''Messenger''((As though there weren't enough apps named "Messenger" already. :-/))
Line 70: Line 66:
 ===== A note about these code blocks!! ===== ===== A note about these code blocks!! =====
 <WRAP center round important 60%> <WRAP center round important 60%>
-Heads up!+Heads up!!!
 </WRAP> </WRAP>
  
Line 177: Line 173:
 </file> </file>
  
-If you look over this version of ''CreateMessageActivity.java'', you can probably figure out which lines of code are introducing the interface features. I will continue to use this version of throughout this chapter and approach future projects in a similar way.+If you look over this version of ''CreateMessageActivity.java'', you can probably figure out which lines of code are introducing the interface features. I will continue to use this version of the file throughout this chapter and approach future projects in a similar way.
  
 ===== p. 78: Create a second activity ===== ===== p. 78: Create a second activity =====
Line 190: Line 186:
  
 <WRAP center round tip 90%> <WRAP center round tip 90%>
-Edit ''content_{whatever}.xml'' files. Leave ''activity_{whatever}.xml'' files alone.+Remember: edit ''content_{whatever}.xml'' files. Leave ''activity_{whatever}.xml'' files alone.
 </WRAP> </WRAP>
  
 ===== pp. 85-87 Codecheck 1 ===== ===== pp. 85-87 Codecheck 1 =====
-The app through p. 85+The app through p. 87
-{{youtube>TODO?600x360&rel=0}}+{{youtube>QFJ7TkLZ1C4?600x360&rel=0}}
 \\ \\
-/* trim emulator start times03A Codecheck "Codecheck*/+ 
 +===== p. 89 ===== 
 + 
 +The Pool Puzzle is challenging, but try to do it without looking at the solution on p. 90. Start by thinking about the logic that needs to happen, then write the code.  
 + 
 +===== p. 91 ===== 
 + 
 +The code on p. 91 refers to a constant ''ReceiveMessageActivity.EXTRA_MESSAGE''. When you add this to the editor, Android Studio will get angry and tell you it doesn't exist. You will create the constant later when you edit ''ReceiveMessageActivity.java''
 + 
 +===== p. 92 ===== 
 +Do //**not**// replace the contents of ''ReceiveMessageActivity.java'' with the code from the book. Insteadfigure out where in the code generated by Android Studio to place the following code snippets: 
 +<code java> 
 +public static final String EXTRA_MESSAGE = "message"; 
 +</code> 
 + 
 +<code java> 
 +Intent intent = getIntent(); 
 +String messageText = intent.getStringExtra(EXTRA_MESSAGE); 
 +TextView messageView = (TextView)findViewById(R.id.message); 
 +messageView.setText(messageText); 
 +</code> 
 + 
 +Make sure to add the needed ''import'' statements as well. 
 + 
 +===== p. 94: Codecheck 2 ===== 
 +The app through p. 94. 
 +{{youtube>EuVQxeIiMJw?600x360&rel=0}} 
 +\\ 
 + 
 +===== p. 97 ===== 
 +You can find a list of common intents (what the book calls standard actions) in the official [[http://developer.android.com/guide/components/intents-common.html 
 +|Developer documentumentation]]. The documentation also shows you what ''Intent.EXTRA_{whatever}''s you can set for each common intent using the ''putExtra'' method. 
 + 
 +===== p. 98: Codecheck 3 ===== 
 +The app through p. 98. 
 +{{youtube>rml-Ptbn2J8?600x360&rel=0}} 
 +\\ 
 + 
 +===== p. 105 ===== 
 + 
 +Windows users, before you try to run your app on a real device, make sure you have the [[|necessary driver]] installed. If you are using a Nexus device, you should be able to use the Google USB Driver available in //Tools > Android > SDK Manager// on the //SDK Tools// tab.\\ 
 +{{:android_learning:headfirst_android_development_notes:google-usb-driver.png?direct&640|}} 
 + 
 +Mac and Linux users won't need additional drivers. 
 + 
 +===== p. 111: Finished ===== 
 +{{youtube>W-v1ZbDfPJc?600x360&rel=0}} 
 +\\ 
 + 
 +===== p. 114 ===== 
 + 
 +Add this to the bullet points: 
 +  An Android app is a collection of **Activities**. 
 +  * You move from Activity to Activity, whether within your app or in another app, via **Intent**s. 
 +  * Intents can be //explicit// or //implicit//
 +  * Actions are used to specify standard operations with implicit Intents.
android_learning/headfirst_android_development_notes/chapter_3.1452142708.txt.gz · Last modified: 2016/01/07 04:58 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki