create new contact using phonegap

Create New Contact using Phonegap / Apache Cordova – Part 1

Want create site? Find Free WordPress Themes and plugins.
create new contact using phonegap

Apache Cordova / Phonegap contact api

This tutorial will explains you how to create new contact in your mobile using phonegap / apache cordova’s Contact plugin. Contact Plugin ( allows you to work with device contact database such as creating new contact, clone existing contact, display / get all contacts, delete existing contact.


How to create new contact using phonegap ?

First Create New Phonegap / Apache Cordova Project & add your platform, then add cordova contact plugin using the command lines

For Cordova  5.0+

cordova plugin add cordova-plugin-contacts

For Older Version

cordova plugin add org.apache.cordova.contacts


In this example, I’m going to create new contact with static contacts details

<!DOCTYPE html>
<html lang="en">
 <meta charset="UTF-8">
 <title>Create Contact</title>
 <script type="text/javascript" src="cordova.js"></script>
 <script type="text/javascript" src="js/jquery.js"></script>
 <script type="text/javascript">
 $(document).ready(function() {
 var myContact = navigator.contacts.create(
 "formatted":"Sundaravel MSM",
 "streetAddress":" ",
 "region":"Chennai, Tamilnadu",
 "name":"Lucin Inc",
 "department":"Software Development"
 "note":"My Notes",
 alert("The contact, " + + ", has been created");
 <button id="createContact">Create New Contact (static)</button>

Here myContact=navigator.contacts.create() is used for creating a new contact object. After creating a new contact object, we’ve to save contact details to phone contact database using;. If you want to create new contact dynamically

Did you find apk for android? You can find new Free Android Games and apps.
  • Pedro Blanco

    Thanks for the post! I used this with a qr code reader + parse function to get the vcard data. But i find a little issue, the contact is added to my google account and not to my memory. How do i fix that?

MyMail WordPress Plugin free
Save $50 USD on Ionic Firebase Chat Source CodeEXPLORE