I'm new to Android development, and I am trying to build an app that has a task list with items that recur at a user specified frequency. I would like the user to select the first due date for the task, and also specify the frequency for the recurrence, similar to how you can do this for events in Google Calendar (I am currently using a DatePickerDialog to allow the user to select a due date; I am just missing the recurrence piece). However, I do not want to put events in the calendar using the calendar API. I have searched StackOverflow and have come up empty; I see plenty on the calendar API but don't believe this is what I am looking for (since I don't want to put anything in the user's calendar); is this a correct assumption? Is there a class that I have missed that handles recurring dates? Or, is there a simpler way to go about this?
I was looking for pretty much the same thing and I ended up using BetterPickers library. There are various dialogs you can use and one of them is also a RecurrencePickerDialog which looks a lot like the one in Google Calendar app.
Related
I want to create a reminder in Google Calendar from my Android app.
Creating events is well-documented, there’s a Calendar content provider for that. However there seems to be no content provider contract for these standalone reminders (not to be confused with event reminders, aka event notifications).
In the app, "Reminders" is listed as a separate calendar along "Events", but when I query the CalendarContract.Calendars table, it’s not on the list. Querying the CalendarContract.Events also doesn’t list reminder events. So I guess they’re stored somehow differently, yet I cannot find any info on that.
Is there a way to create these reminders programmatically?
Okay, after some more looking, answering my own question.
There’s no way to do this. Despite those reminders being a cross-application feature, there's no API to access them.
There's a feature request for this.
My question basically duplicates questions: [1] [2], I didn't find them because they mentioned other apps, which share the same reminders with Calendar.
I would like to display a calendar in an android app. Based on some research, I found that we can use the CalendarView widget to display a calendar. We cannot create events, attendees or other features using the CalendarView, correct me if I am wrong. The other option is to use the native in built calendar using Intents.
Is there any other way to display a calendar easily in an Android app easily without the above 2 methods and still be able to create events, attendees or other features.
Can CalendarProvider be used create a calendar display. I know it can be used to create events, attendees, reminders etc...
Can CalenderProvider be used in conjunction with CalendarView?
If CalendarProvider cannot be used in conjunction with CalendarView or any other easy way, should we build a calendar from scratch?
Thank you in advance!!!
Based on some research, I found that we can use the CalendarView widget to display a calendar.
You can use CalendarView to allow the user to pick a date.
We cannot create events, attendees or other features using the CalendarView, correct me if I am wrong
CalendarView is a widget. Its job is not to "create events, attendees" — similarly, it is not the job of EditText to create Wikipedia pages. The job of CalendarView is to let the user pick a date using a calendar-style visual representation.
Is there any other way to display a calendar easily in an Android app easily without the above 2 methods and still be able to create events, attendees or other features
You are certainly welcome to see if there is an existing library that has your desired feature set.
Can CalendarProvider be used create a calendar display
Not directly. This is akin to asking "can I use an Excel spreadsheet to create a calendar display?" CalendarProvider is a data store. It is not a visual representation of an event calendar.
Can CalenderProvider be used in conjunction with CalendarView?
Not in the way that you are thinking. CalendarView is a way to allow the user to pick a date. It is not a way to show the user information about particular dates (e.g., appointments or other events).
should we build a calendar from scratch?
That is up to you.
I am new at android this, so this might sound a bit confusing..
i am making an app that requires to have calendars showing events in week, day and month views (like google calendar). I have implemented this is a testing version but i want to change the implementation to make it more flexible. currently the event are stored in database and are edited and used in various activities in the app. Can i have android manage the events in it's calendar? but i would still need to be able to manipulate it from the app and store extra info other than the time and date and description. These extra info will be used for calculations. We also need to have a calendar in the app. Can we retrieve the events specific to the app for doing all this?
This tutorial might be of help.
Hello I'm stuck on this past few days with searching a lot, now I'm confusing what to do.
Trying to do: Created my own calendar and show all events on Calendar. I had all events in XML file for now, everything works fine. Now I'm connecting my calendar app with my OWN google calendar account to fetch (read only) all events from my own Google Calendar account because I dont want to use the XML file anymore. It's not a good idea when I want to update events later on. I dont want users have to enter username/pass to connect with Google Calendar. I would like to HARDCODED it.
Problems: I'm done something like this for iphone by using G-Data Google Api, it works exactly what I want to. However, G-Data Google Api is not compatible with Android. Then I searched and found ppl recommend use Google_api_java_client instead.
This is link where it can connect with a google Calendar account by letting user enter username& password. However, this is not I want. I want to hard coded username and password inside my code, but they are using OAuth then I can't hard coded my username/pass. I also tried ClientLogin from this link, but it doesn't work too. It keeps throw me error "GoogleTransport cannot be resolved". I searched solution for this error, ppl recommend me back to OAuth. This is really make me confusing now.
I hope someone experienced this and have solution, please help me/ guide me how to implement this on android. I just want to read data from my own google calendar account only, PLEASE not from native calendar app.
Last information that I found is by sending an authenticated GET request to the allcalendars feed URL. However, I never done this, if you think it should work, please assist me with that.
I really appreciated any helps. Thank you very much.
You already got the Android calendar creation part right, you now only need to read events from your google calendar to add them to your newly created Android calendar.
It's easy.
Make your calendar public from the Google calendar web app. (anyway embedding your login/pwd in your app is a bad idea, anyone could steal it).
On the "agenda parameter" page, near the Public Calendar URL section, you will be able to copy the public AgendaId (in the form xxxYYYzzz#group.calendar.google.com).
From your app, do an http GET request to this url https://www.google.com/calendar/feeds/AgendaId%40group.calendar.google.com/public/full?alt=json&orderby=starttime&max-results=15&singleevents=true&sortorder=ascending&futureevents=true (replace AgendaId by the real value) and you will be able to read future events in json format.
To tweak the format (json/xml) or the number of returned entries, please read the documentation here: https://developers.google.com/gdata/docs/2.0/reference#Queries
Also, note this is the old API. The new API needs you to register an account to use it and is limited to 10 000 free requests per day.
I'm trying to make an application that manages the internal Android calendar, but I want to know if I can delete or create new calendars. (I know about the calendar's events but not about the calendars.) Can you help me with examples or documentation?
Some code on how to read calendars and their events here. You should also be able to write to the Calendar ContentProvider.
But remember there is no official Calendar API. Any code working today or on a certain device can break in the future or on other devices.
Have a look at this question