Add StateManager and example

- The StateManager that saves values automatically
  when the android system call onSaveInstanceState