title: PhoneGap- Contacts are not showing
body: <p>I am trying to show the contacts lists from the device using PhoneGap development. But its not displaying the contacts. </p>
  
  <p>Neither its showing any kind of errors. </p>
  
  <p>Please any one help me to find out what is wrong in the below code as i am begginer in phonegap.</p>
  
  <pre><code>  &lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt; Contacts Demo &lt;/title&gt;
  &lt;script type="text/javascript" src="phonegap-1.1.0.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
      function init()
      {
          document.addEventListener("deviceready",onDeviceReady,false);
      }
  
      function onDeviceReady()
      {
          var options=new ContactFindOptions();
          options.filter="";
          var fields=["name","phoneNumbers"];
          navigator.service.contacts.find(fields,onSuccess,onError,options);
      }
  
      function onSuccess(contacts)
      {
          var ulr=document.getElementById("list");
          for(var i=0;i&lt;contacts.length;i++)
          {
              var name=contacts[i].name.formatted;
              var phoneNumber=contacts[i].phoneNumbers[0].value;
              var li=document.createElement('li');
              li.innerHTML = "&lt;a href=\"tel://"+phoneNumber+"\"&gt;"+name+"&lt;/a&gt;";
              ulr=appendChild(li);
          }
      };
  
      function onError()
      {
          alert('onError!');
      };
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Contacts List&lt;/h1&gt;
  &lt;ul id="list"&gt;&lt;/ul&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Logcat:</strong></p>
  
  <pre><code>04-02 16:05:37.167: I/PhoneGapLog(7141): phonegap.xml missing. Ignoring...
  04-02 16:05:37.167: I/System.out(7141): loadUrl(file:///android_asset/www/contactindex.html)
  04-02 16:05:37.167: I/System.out(7141): url=file:///android_asset/www/contactindex.html baseUrl=file:///android_asset/www/
  04-02 16:05:37.377: D/SoftKeyboardDetect(7141): We are in our onMeasure method
  04-02 16:05:37.377: D/SoftKeyboardDetect(7141): Old Height = 0
  04-02 16:05:37.377: D/SoftKeyboardDetect(7141): Height = 762
  04-02 16:05:37.377: D/SoftKeyboardDetect(7141): Old Width = 0
  04-02 16:05:37.377: D/SoftKeyboardDetect(7141): Width = 480
  04-02 16:05:37.377: D/SoftKeyboardDetect(7141): Ignore this event
  04-02 16:05:37.477: D/gralloc_goldfish(7141): Emulator without GPU emulation detected.
  04-02 16:05:37.657: D/SoftKeyboardDetect(7141): We are in our onMeasure method
  04-02 16:05:37.657: D/SoftKeyboardDetect(7141): Old Height = 762
  04-02 16:05:37.657: D/SoftKeyboardDetect(7141): Height = 762
  04-02 16:05:37.667: D/SoftKeyboardDetect(7141): Old Width = 480
  04-02 16:05:37.667: D/SoftKeyboardDetect(7141): Width = 480
  04-02 16:05:37.667: D/SoftKeyboardDetect(7141): Ignore this event
  04-02 16:05:38.698: E/SQLiteLog(7141): (14) cannot open file at line 30174 of [00bb9c9ce4]
  04-02 16:05:38.698: E/SQLiteLog(7141): (14) os_unix.c:30174: (2) open(/CachedGeoposition.db) - 
  04-02 16:05:38.707: D/WebKit(7141): ERROR: 
  04-02 16:05:38.707: D/WebKit(7141): SQLite database failed to load from /CachedGeoposition.db
  04-02 16:05:38.707: D/WebKit(7141): Cause - unable to open database file
  04-02 16:05:38.707: D/WebKit(7141): external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&amp;, bool)
  04-02 16:05:38.907: D/PhoneGapLog(7141): null: Line 1 : XMLHttpRequest cannot load http://127.0.0.1:36419/01c9cf14-1235-4458-9b68-33a094aad126. Origin null is not allowed by Access-Control-Allow-Origin.
  04-02 16:05:38.917: E/Web Console(7141): XMLHttpRequest cannot load http://127.0.0.1:36419/01c9cf14-1235-4458-9b68-33a094aad126. Origin null is not allowed by Access-Control-Allow-Origin. at null:1
  04-02 16:05:38.987: D/PhoneGapLog(7141): file:///android_asset/www/phonegap-1.1.0.js: Line 930 : JSCallback Error: Request failed.
  04-02 16:05:38.997: I/Web Console(7141): JSCallback Error: Request failed. at file:///android_asset/www/phonegap-1.1.0.js:930
  04-02 16:05:39.218: D/PhoneGapLog(7141): file:///android_asset/www/phonegap-1.1.0.js: Line 769 : Error in success callback: Network Status1 = TypeError: Cannot read property 'contacts' of undefined
  04-02 16:05:39.218: I/Web Console(7141): Error in success callback: Network Status1 = TypeError: Cannot read property 'contacts' of undefined at file:///android_asset/www/phonegap-1.1.0.js:769
  04-02 16:05:39.347: D/dalvikvm(7141): GC_CONCURRENT freed 210K, 4% free 8192K/8455K, paused 18ms+5ms, total 58ms
  </code></pre>
  
  <p>Any help will be appreciated.</p>
  
  <p>Thanks.</p>