Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Thursday, October 17, 2013

Position of an item in Android Adapter is zero-based

Adapters are used in Android to "act as a bridge" between a list-like View, and its underlying dataset.
When working with Adapters, one often works with the position of an item. This is a number that indicates where in the list that item resides, and importantly, the numbering for position starts from zero.

Thursday, October 3, 2013

Download git projects from googlesource

Let's say you want to download this open source project by Roman Nurik. Here is how you can do it.


  • Look at the URL: 
  • https://android.googlesource.com/platform/developers/samples/android/+/master/ui/actionbar/DoneBar 
    
  • Only keep the part before the + sign: 
  • https://android.googlesource.com/platform/developers/samples/android/
    
  • Open this new URL, and note that at the top of the page there is a hint that says: 
  • git clone https://android.googlesource.com/platform/developers/samples/android
    
  • That is the git command you need to use to download the project (parent project, to be exact). Use it in the terminal on Mac OS to get a local copy of that folder.