I want to store in my Android database a calendar entry.
It is no problem to store simple types like int and String in the database. But I cannot figure out how to store calendar type.
My table looks as follows:
reate table wishes(_id integer primary key autoincrement, ”
+ “name text not null, ”
+ “date text, picurl text, …..)
Everything is declared as “text”.
In my activity I have this code:
Calendar cal = Calendar.getInstance();
cal should be stored in my table. Can someone give a hint?
Save the milliseconds from epoch representation of the calendar:
Then store this long in the db. You can recover the calendar by reading the long value from the db and using
setTimeInMillis(long millis)in the calendar.