title: How to store class object in android sharedPreference?
body: <p>I would like to store class object in android sharedpreference. I did some basic search on that and I got some answers like make it serializable object and store it but my need is so simple. I would like to store some user info like name, address, age and boolean value is active. I made one user class for that.</p>
  
  <pre><code>public class User {
      private String  name;
      private String address;
      private int     age;
      private boolean isActive;
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getAddress() {
          return address;
      }
  
      public void setAddress(String address) {
          this.address = address;
      }
  
      public int getAge() {
          return age;
      }
  
      public void setAge(int age) {
          this.age = age;
      }
  
      public boolean isActive() {
          return isActive;
      }
  
      public void setActive(boolean isActive) {
          this.isActive = isActive;
      }
  }
  </code></pre>
  
  <p>Thanks.</p>