O'Reilly logo

PhoneGap 4 Mobile Application Development Cookbook by Zainul Setyo Pamungkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extending your Cordova Android application with a native plugin

Android devices have been proven to be developer friendly insofar as they easily allow us to test and deploy unsigned applications throughout the development process.

How to do it...

In this recipe, we will create a native Android plugin for our Cordova application, using command-line tools as suggested by Cordova:

  1. Create a new directory named helloplugin. Then, create two blank directories, www and src, from the root. Next, create an empty file called plugin.xml. Now, we have a Cordova plugin project to get started, as shown here:
    How to do it...
  2. We open plugin.xml and paste the following code for basic ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required