Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7504813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:41:53+00:00 2026-05-29T21:41:53+00:00

I’m writing an app that needs to write events to a calendar in the

  • 0

I’m writing an app that needs to write events to a calendar in the background, without input from the user once the app has been setup. This means that the methods where the event is created using Intents is not what I am after.

I found this code on a website, but it doesn’t work:

    long start = 1297512000; // 2011-02-12 12h00
    long end = 1297515600;   // 2011-02-12 13h00

    String title = "TEST ENTRY - DELETE ME!!"; 

    ContentValues cvEvent = new ContentValues();
    cvEvent.put("calendar_id", 1);
    cvEvent.put("title", title);
    cvEvent.put("dtstart", start );
    //cvEvent.put("hasAlarm", 1);
    cvEvent.put("dtend", end);

    getContentResolver().insert(Uri.parse("content://com.android.calendar/events"), cvEvent);

Now, before anybody wades in with the “Google HIGHLY recommend you don’t use this method” or such like, I already know this.

Has anyone got this working? I’m running Gingerbread on my device, so that may cause an issue!

The only alternative I’ve found is to use the GData APIs, but then I need to authenticate which is why the above is better…. there are apps out there that need no authentication so they must be using this too! 🙂

If anyone can help, please do!

Thanks
Neil

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:41:54+00:00Added an answer on May 29, 2026 at 9:41 pm

    There was a problem with the dates when converted. I was ending up with a date in 1970s but expected a Feb 2011 date.

    Using a different epoch converter showed I had 3 missing 0’s.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I am writing an app with both english and french support. The app requests
I need to clean up various Word 'smart' characters in user input, including but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a small JavaScript validation script that validates inputs based on Regex. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.