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 8031745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:12:11+00:00 2026-06-05T01:12:11+00:00

I’m building an Android app using PhoneGap (aka Cordova), and am having trouble getting

  • 0

I’m building an Android app using PhoneGap (aka Cordova), and am having trouble getting a calendar integration to work. Disclaimer: I’m a noob to both Android and PhoneGap, please bear with me.

All I’m trying to do is add an event to the user’s calendar. Following this tutorial, I’ve created a Plugin that attempts to launch a Calendar Intent. The code looks like this:

public class CalendarPlugin extends Plugin {
public static final String NATIVE_ACTION_STRING="addToCalendar"; 
public static final String SUCCESS_PARAMETER="success"; 

@Override
public PluginResult execute(String action, JSONArray data, String callbackId) {
    if (NATIVE_ACTION_STRING.equals(action)) { 
        Calendar beginTime = Calendar.getInstance();
        beginTime.set(2012, 6, 19, 7, 30);
        Calendar endTime = Calendar.getInstance();
        endTime.set(2012, 6, 19, 8, 30);

        Intent calIntent = new Intent((Context) this.ctx, CalendarPlugin.class)
            .setAction(Intent.ACTION_INSERT)
            .putExtra(Events.TITLE, "A new event")
            .putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, true)
            .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, beginTime.getTimeInMillis())
            .putExtra(CalendarContract.EXTRA_EVENT_END_TIME, endTime.getTimeInMillis());

        this.ctx.startActivity(calIntent);
        return new PluginResult(PluginResult.Status.OK, "Smashing success");
    }

return new PluginResult(PluginResult.Status.ERROR, "Didn't work bro");
}
}

The Javascript code to invoke this plugin is standard:

var CalendarPlugin = { 
    callNativeFunction: function (success, fail, resultType) { 
        if (cordova) {
            return cordova.exec( success, fail, 
                "org.myorg.appname.CalendarPlugin", 
                "addToCalendar", [resultType]);
        }
        else {
            alert("Calendar function is not available here.");
        }
    } 
};

The Android code is getting invoked (confirmed using a breakpoint). But the result sent back to the Javascript code is an error:

Unable to find explicit activity class {org.myorg.appname/org.myorg.appname.CalendarPlugin}; have you declared this activity in your AndroidManifest.xml?

There’s no mention of adding to AndroidManifest.xml in the tutorial, which leads me to believe I’m missing something (also, the CalendarPlugin code is being invoked successfully, so how could there be an error saying the CalendarPlugin class could not be found?). If indeed I need to add CalendarPlugin to the manifest, how would I go about doing that?

  • 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-06-05T01:12:12+00:00Added an answer on June 5, 2026 at 1:12 am

    The tutorial cited didn’t cover intents. The intent you are sending your data to is your own CalendarPlugIn class which isn’t what you want as it doesn’t handle the intent.

    See http://developer.android.com/guide/topics/intents/intents-filters.html regarding intents.

    Also if you search around SO you’ll find that until ICS there wasn’t even a way to add things to the Google Calendar officially without using a web service. There are ways to do it unofficially, but are subject to the whims of Google or the ODMs themselves.

    Updated:

    You should be able to use intents with Phonegap (via a plugin). I only added the comment to note that if you intend to have calendar integration in your app, you’ll probably have to do a bit of research if you want to support the majority of Android devices. If you are interested in adding calendar events in ICS look at: http://developer.android.com/reference/android/provider/CalendarContract.html

    Op’s Edit

    I just needed to fix the Intent constructor, and this worked as expected:

    Uri uri = Uri.parse("content://com.android.calendar/events");
    Intent calIntent = new Intent("android.intent.action.INSERT", uri)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.