@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
Android
Lesson 2 by Callum Taylor
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
Introduction
• All code and presentation s...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
Introduction
https://github.com/scruffyfox...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
What we’re going to make
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
What we’re going to make
• ListView
• Arra...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
IDE Tips
+
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
IDE Tips
+
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
IDE Tips
+
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
IDE Tips
+
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How R.java works
R.layout.list_item
R.id.n...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How R.java works
R.string.hello_world
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getCount()
• getItem(i...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getCount()
Exactly wha...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getItem(int position)
...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getItemId(int position...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How Adapters work
• getView(int position, ...
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How List Views work
@scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
How List Views work
• getView(int position...
Upcoming SlideShare
Loading in …5
×

Android Course - Lesson2

516 views

Published on

Lesson 2 of the Android Course by Callum Taylor

Slide notes here: https://github.com/scruffyfox/AndroidCourse/blob/Lesson-2/pdf/Lesson2-notes.pdf

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
516
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • This is what we’re going to make today
  • This is what we’re going to make today
  • Control + space will be the most popular shortcut you use, pressing it will bring up the codesense suggestion dialog when you type to allow you to find the method/variable you’re looking for. It will also bring up the documentation for the highlighted method. Press enter to auto complete
  • Pressing alt and enter will open up the quick fix menu which will give you some useful functions such as refracting a string or reversing an if statement
  • Pressing control and enter will bring up the generate menu which is useful when overriding methods from the super class you don’t know the name of
  • Pressing control and p will bring up the parameters for a method as you’re typing.
  • Android Course - Lesson2

    1. 1. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 Android Lesson 2 by Callum Taylor
    2. 2. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 Introduction • All code and presentation slides can be found over at https://github.com/scruffyfox/AndroidCours e • Twitter/app.net/github: @scruffyfox • http://(blog.)callumtaylor.net
    3. 3. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 Introduction https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2
    4. 4. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 What we’re going to make
    5. 5. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 What we’re going to make • ListView • ArrayAdapter/BaseAdapter • findViewById • View Holder paradigm
    6. 6. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 IDE Tips +
    7. 7. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 IDE Tips +
    8. 8. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 IDE Tips +
    9. 9. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 IDE Tips +
    10. 10. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How R.java works R.layout.list_item R.id.name R.drawable.ic_launcher
    11. 11. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How R.java works R.string.hello_world
    12. 12. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getCount() • getItem(int position) • getItemId(int position) • getView(int position, View convertView, ViewGroup parent)
    13. 13. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getCount() Exactly what it says – returns the number of items in the current data set
    14. 14. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getItem(int position) Returns the item from the data set at the specific position
    15. 15. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getItemId(int position) Returns the item’s id at the position. Can just return 0, but return a reliable int ID/representation of the item to increase performance of the list view
    16. 16. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How Adapters work • getView(int position, View convertView, ViewGroup parent) Returns the view in the list. This is where we do all of our data inflating into the screen which the user sees. Position is the position of the item in the dataset ConvertView is the view that will be shown Parent is the parent view of the view being shown (usually the list view)
    17. 17. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How List Views work
    18. 18. @scruffyfoxLesson 2 – https://github.com/scruffyfox/AndroidCourse/tree/Lesson-2 How List Views work • getView(int position, View convertView, ViewGroup parent)

    ×