Alarm notification android system -
i building android system take records of user schedule local database, data consist date , time. alarm notification pushed user when time , date due.
my question:
i want check time , date in database every second , know if due , push notification user.
is right thing do, if not please best do. thanks
maybe can using calendar of android.
intent intent = new intent(intent.action_insert_or_edit); intent.settype("vnd.android.cursor.item/event"); startactivity(intent);
the above snippet invoke calendar application empty fields , allow user enter event details before adding. however, can pre-fill event details passing details in form of intent extras. extras values describes event details, such event start time, event end time, event title, event description, etc.
the following 2 class important understand adding events.
calendarcontract : defines data model of calendar , event related information. data stored in number of tables, listed below. calendarcontract.events: table holds event-specific information. each row in table has information single event—for example, event title, location, start time, end time, , on. event can occur one-time or can recur multiple times. attendees, reminders, , extended properties stored in separate tables. each have event_id references _id in events table. following code bundle can used pass information calendar intent.
intent.putextra(calendarcontract.extra_event_begin_time, starttime); intent.putextra(calendarcontract.extra_event_end_time,endtime); intent.putextra(calendarcontract.extra_event_all_day, true); intent.putextra(events.title, "neel birthday"); intent.putextra(events.description, "this sample description"); intent.putextra(events.event_location, "my guest house"); intent.putextra(events.rrule, "freq=yearly");
hope help...
Comments
Post a Comment