Skip to content

aexei/cordova-plugin-app-index

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cordova Hello World Plugin

Simple plugin that returns your string prefixed with hello.

Greeting a user with "Hello, world" is something that could be done in JavaScript. This plugin provides a simple example demonstrating how Cordova plugins work.

Using

Clone the plugin

$ git clone https://github.com/don/cordova-plugin-hello.git

Create a new Cordova Project

$ cordova create hello com.example.helloapp Hello

Install the plugin

$ cd hello
$ cordova plugin add ../cordova-plugin-hello

Edit www/js/index.js and add the following code inside onDeviceReady

    var success = function(message) {
        alert(message);
    }

    var failure = function() {
        alert("Error calling Hello Plugin");
    }

    hello.greet("World", success, failure);

Install iOS or Android platform

cordova platform add ios
cordova platform add android

Run the code

cordova run 

More Info

For more information on setting up Cordova see the documentation

For more info on plugins see the Plugin Development Guide

About

Sample Hello World Cordova Plugin

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 32.5%
  • Java 30.2%
  • C# 26.8%
  • JavaScript 10.5%