Version Control


Two Android Studio Projects, Library & Application – How to link them.

Prepare two projects as follows

1. Library

+ LibraryModule

2. Application

+ ApplicationModule

Set the dependency relations as follows

1. In LibraryProject

in “build.gradle” inside your LibraryModule folder,
make sure to set it as library using plugin and disable proguard

apply plugin: ''
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'

2. In ApplicationProject

in “settings.gradle”

include ':ApplicationModule', '..:LibraryProject:yourLibraryModule'

in “build.gradle” inside your ApplicationModule folder

apply plugin: ''
compile project(':..:LibraryProject:yourLibraryModule')


Fragment lifecycle

Though a Fragment’s lifecycle is tied to its owning activity, it has its own wrinkle on the standard activity lifecycle. It includes basic activity lifecycle methods such as onResume(), but also important are methods related to interactions with the activity and UI generation.
The core series of lifecycle methods that are called to bring a fragment up to resumed state (interacting with the user) are:

  1. onAttach(Activity) called once the fragment is associated with its activity.
  2. onCreate(Bundle) called to do initial creation of the fragment.
  3. onCreateView(LayoutInflater, ViewGroup, Bundle) creates and returns the view hierarchy associated with the fragment.
  4. onActivityCreated(Bundle) tells the fragment that its activity has completed its own Activity.onCreate().
  5. onViewStateRestored(Bundle) tells the fragment that all of the saved state of its view hierarchy has been restored.
  6. onStart() makes the fragment visible to the user (based on its containing activity being started).
  7. onResume() makes the fragment interacting with the user (based on its containing activity being resumed).

As a fragment is no longer being used, it goes through a reverse series of callbacks:

  1. onPause() fragment is no longer interacting with the user either because its activity is being paused or a fragment operation is modifying it in the activity.
  2. onStop() fragment is no longer visible to the user either because its activity is being stopped or a fragment operation is modifying it in the activity.
  3. onDestroyView() allows the fragment to clean up resources associated with its View.
  4. onDestroy() called to do final cleanup of the fragment’s state.
  5. onDetach() called immediately prior to the fragment no longer being associated with its activity.

* Source

How to implement Navigation Drawer with toolbar in Material Design

1. Simpe Github project using ActionBarActivity and v7 support library

2. Excellent explanation about using Material Design in pre-Lollipop

3. Official documentation about How to use Navigation Drawer

Search screens

Collection of Search screens in Google Apps

(as of 2014-11-30, Lollipop)

Search screen: Google Calendar
Google Calendar
Search screen: Google Contact
Google Contact
Search screen: Google Drive
Google Drive
Search screen: Google Gmail
Google Gmail
Search screen: Google Inbox
Google Inbox
Search screen: Google Keep
Google Keep
Search screen: Google Map
Google Map
Search screen: Google My Maps
Google My Maps
Search screen: Newsstand
Search screen: Youtube
Search screen: Zagat
Search screen: Google Play
Google Play