sync event with google calendar from android - Java for Android App Development

Goal
I'm trying to add event to Android calendar which will sync these events automatically to Google Calendar.
Problem
Events appear on my local Google Calendar on my Android, but the events don't get synced to Google. If I add an event manually in the preinstalled calendar app the event gets synced to Google.
This is my add event code:
Code:
private void createEvent(long calendarId, SomeEvent event){
ContentValues values = new ContentValues();
values.put(Events.DTSTART, event.getStart());
values.put(Events.DTEND, event.getStart() + event.getDuration());
values.put(Events.TITLE, event.getName());
values.put(Events.EVENT_LOCATION, "US");
values.put(Events.CALENDAR_ID, calendarId);
values.put(Events.EVENT_TIMEZONE, "New York");
values.put(Events.ACCESS_LEVEL, Events.ACCESS_PRIVATE);
values.put(Events.SELF_ATTENDEE_STATUS,Events.STATUS_CONFIRMED);
Uri uri = contentResolver.insert(CalendarContract.Events.CONTENT_URI, values);
}
Any suggestions to get this sync workig?

bump

Related

Sending an email....

Hi,
I went through the SendEmail sample as reference for implementing similar functionality within my app. However, the example creates a new message in each of the messaging accounts setup on the ppc (Outlook Email, Text Messages & any other pop3 accounts you have created). So the result is, i have each of my accounts having a mail created in its outbox.
There is a while loop created, which parses through all the rows in the table -
Code:
// Get the message stores table
hr = pSession->GetMsgStoresTable(MAPI_UNICODE, &pTable);
EXIT_ON_FAILED(hr);
while (SUCCEEDED(pTable->QueryRows(1, 0, &psrs)))
{
.....
.....
.....
}
This is where each of the accounts are being fed with a new message in the outbox. Now coming to the point, i dont find any attribute which contains the ACCOUNT NAME, so, how do i figure out which account i'm sending an email from? Basically, my intention is to parse through all accounts that exist, and give the user an option to select the pop3/outlook email account to send his mail from.
Any help appreciated, as its beginning to really drive me up a wall
Thanks,
San

Sync Calendar Problem

I have wrote a new event to my HTC Magic, but I can't sync the new event to Google Calendar. I have pressed in Setting > Data Sync > Calendar which the device display the latest update time and date.
Why I can't sync the new event to Google Calendar with my device?
I've had a similar issue. Try adding the data with your calendar online (google) and sync the other way. Works for me.
by default, new event is added to "My Calendar" (i.e. your Magic)
you can change it when you creating new event under "Calendar"
please note that only new event can choose the "Calendar"
So when I add a new event on my Magic, there is no way for it to show up on Google Calendar online (ie. my PC)? I know if I added the event on Google Calendar online it will sync up with my Magic and add the event to my Magic's calendar, but it doesn't work vise versa for some odd reasona and I find it annoying. Is there a way to do that?

edit Calendar type in Android calendar

Hi all
coming from WM I used to put all my calendar items in my exchange calendar on the PC - i would tick the private box for private, i.e. not work-related items. then I would get access to all those on my WM device.
Now I switched to Android and I have realised that Android could sync with various calendars, then it would consolidate all these items on the device in a single "calendar" app. Great. What I'd like to do is transfer all my private apps from exchange to my google calendar. I thought I could edit each item individually on the device and change the "calendar" type, i.e. exchange, google, outlook etc. But apparently I'm not able to change the calendar type while editing an existing item.
Is there a way of doing it without re-creating each private item in my google calendar and deleting them one by one in exchange?
thanks ;-)

Calendar entries not appearing through google calendar web interface

Can anyone explain why the calendar app, synced to a google calendar, displays calendar entries on the phone but doesn't display any entries when i log in to the same account on google calendar through my laptop?
Am i missing something in the way it is set up?

[Q] Old calendar entries non present on SGS

I set the synchronization between my Galaxy S Calendar and my Google Calendar account, but I found that events older than 1 months are not present in my device calendar; all the entries are correctly present on Google calendar account. The synchronization is fully working for present and future event. I installed also Jorte and Business Calendar (perfectly working...!)
Is there any function that automatically deletes old calendar events? How can I disable it? How can I sync old events?
Thank you
nnullius said:
I set the synchronization between my Galaxy S Calendar and my Google Calendar account, but I found that events older than 1 months are not present in my device calendar; all the entries are correctly present on Google calendar account. The synchronization is fully working for present and future event. I installed also Jorte and Business Calendar (perfectly working...!)
Is there any function that automatically deletes old calendar events? How can I disable it? How can I sync old events?
Thank you
Click to expand...
Click to collapse
Set the phone date to earlier than the oldest missing calendar entry and then re-sync. If the oldest entry missing is prior to 2000 (froyo) then you have to do the Google import game in the calendar.

Categories

Resources