How to add calendar events in Android?

Hii developer in this Article I am sharing how to add Event in google calendar throws your App just Click on Button. Add your App event to google calendar App.  using Android Intent you can pass your app data to google calendar App. like Event title, event start time, event end time,  Event Description, more. there is an easy android solution to add calendar events in Android. Read More Android tutorial

Let’s Start How to add calendar events in Android?

follow this method to implement Android add calender event in android

 @SuppressLint({"NewApi", "LocalSuppress"})
    public void AddEvent(String Start, String EndDate){
        String Title = Event_DetTitle.getText().toString().trim();
        String Des = Event_DetDescription.getText().toString().trim();
        String Locations = Event_DetLocation.getText().toString().trim();

        Intent intent = new Intent(Intent.ACTION_INSERT)
                .setData(CalendarContract.Events.CONTENT_URI)
                .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, Instant.parse(Start).toEpochMilli())
                .putExtra(CalendarContract.EXTRA_EVENT_END_TIME, Instant.parse(EndDate).toEpochMilli())
                .putExtra(CalendarContract.Events.TITLE, Title)
                .putExtra(CalendarContract.Events.DESCRIPTION, Des)
                .putExtra(CalendarContract.Events.EVENT_LOCATION,Locations )
                .putExtra(CalendarContract.Events.AVAILABILITY, CalendarContract.Events.AVAILABILITY_BUSY);
               .putExtra(Intent.EXTRA_EMAIL, "abc@example.com,codeplayon@example.com");

        startActivity(intent);
    }

 

 

Facebooktwitterredditpinterestlinkedinmail
Recommended
Hi, developer in this Android example I am sharing how…