Search code examples
androidcalendar

How to create an own Calendar-structure?


Community,

Basically I'm working on my own Calendar App. Its a private Project to add specific functions and I wont use for example s-planner, Calendar and so on.
The Google Calendar is a great choice in my opinion but I want to learn the basics by myself.

I just started a few days ago and here we go:
The App needs 4.4 Kitkat and above versions. I started with a basic calendar view, looking like this:

enter image description here

So it should be possible to add Events and Reminders. It is possible to check which date is selected and working with a Date Tim Picker dialog? Or should I create an GridView and fill it. Maybe that way:

Just use the calendar api and create an Instance like this:

Calendar calendar = GregorianCalendar.getInstance();

But there is for example, no function which gives me the Dates of a Month in a Array . How its possible to fill it. I just looked for some examples :

https://www.toptal.com/android/android-customization-how-to-build-a-ui-component-that-does-what-you-want

Is this necessary? Maybe there is an easy way. I don't understand the Calendar Api.

The Logic behind the calendar could be organized with the CalendarContract. For example:

Intent calIntent = new Intent(Intent.ACTION_INSERT); 
calIntent.setData(CalendarContract.Events.CONTENT_URI);
startActivity(calIntent);

So that's not the case now.
I just want to know how I can create the calendar structure and display it. Maybe a hint which way is possible to display dates of another Month ( for example: the first November 2016 = Tuesday so i should display the 31.10 too)

I guess there are a lot of information that I miss at this time. Hope some of you can help me. I'm sorry for my English, it isn't the best but you should understand the point. Have a great Day.

Its also my first post here, so let me know which information is missing or what I should reformat.


Solution

  • Are you looking for something like this. This is a fully customised calendar where you can add events to dates , can listen to date change etc :

    https://github.com/khetanrajesh/CustomCalendar