Coder Social home page Coder Social logo

eboukamza / phonegap-calendar-plugin-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trevoriancox/phonegap-calendar-plugin-android

1.0 2.0 0.0 84 KB

Phonegap plugin to add events to the android calendar

License: MIT License

Java 45.06% JavaScript 54.94%

phonegap-calendar-plugin-android's Introduction

Calendar Plugin for Phonegap

(c) 2013 Ten Forward Consulting, Inc. released under the MIT License

Authored by Brian Samson (@samsonasu) and Ryan Behnke

This plugin is compatible with PhoneGap 2.0, and the api was based on the corresponding iOS plugin

Adding the Plugin to your project

  1. To install the plugin, add calendar.js to your index.html and to your www folder:

<script type="text/javascript" src="calendar.js"></script>

  1. Add CalendarPlugin.java to your Android project in src/com/tenforwardconsulting/phonegap/plugins

  2. Map the plugin in res/xml/config.xml:

    <plugin name="CalendarPlugin" value="com.tenforwardconsulting.phonegap.plugins.CalendarPlugin"/>

Usage

Create an object to be used to call the defined plugin methods.

var startDate = new Date("August 20, 2013 10:00:00");
var endDate = new Date("August 20, 2013 11:00:00");
var title = "Hack on Phonegap";
var location = "The Basement";
var notes = "Hacking on open source projects late at night is the best!";
var success = function() { alert("woo hoo!"); };
var error = function(message) { alert("Doh!"); };
window.plugins.calendarPlugin.createEvent(title,location,notes,startDate,endDate, success, error);

That's it!

Caveats

  • The only API that is implemented is createEvent. If you have a need for the other apis, feel free to implement them and send a pull request :)

  • This uses an undocumented API (that was finally documented in Jelly Bean). As such it may not work on pre 4.0 devices, but I've had very good luck so keep your fingers crossed.

phonegap-calendar-plugin-android's People

Contributors

samsonasu avatar sidneys avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.