title: Saving dates to sqlite database with Active Android
body: <p>I have a simple class Event that I am saving into a SQlite database wtih active android like so:</p>
  
  <p>Event.java</p>
  
  <pre><code>@Table(name = "events", id = "_id")
  public class Event extends Model {
  
      @Column (name = "EventLocation")
      private String mEventLocation;
  
      @Column (name = "EventDate")
      private String mEventDate;
  }
  </code></pre>
  
  <p>AddEventActivity.java:</p>
  
  <pre><code>mSubmitButton.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
         String eventLocation = mEventLocation.getText().toString();
         String eventDate = mEventDate.getText().toString();
         Event event = new Event(eventLocation,eventDate);
         event.save();
  </code></pre>
  
  <p>etc. At the moment, I am saving the date as well as Start/End times as strings. But I'm adding a new feature in my app where I would like to compare the current date/time with the dates of my ArrayList of  objects and then return the next Event that will happen later that day or whatever.</p>
  
  <p>What is the most efficient way to do this? I need to be able to sort my ArrayList of events by date with a Comparable or Comparator, then compare them to the current date, so I have tried parsing the strings to a Date object and with SimpleDateFormatter, but as they are Strings this doesn't really work. How can I save the dates to SQLite with Active Android? All examples  of saving I'm finding are Strings.</p>
  
  <p>I'm fairly new to Java/Android. Many thanks.</p>