title: How to consume a rest web service in phonegap for android?
body: <p>I am a newbie in phone gap and trying to call a rest web service created in php with post parameters in <strong>application/x-www-form-urlencoded</strong> in my phone gap android app but not getting the response. Following is the code for calling the service:</p>
  
  <pre><code>     $.ajax({
                      type: "POST",
                      url: "URL.php",
                      contentType: "application/x-www-form-urlencoded",
                      data: dataString,
                      success: function(response) {
                      var resp = response.responseText;
                      var jsonObj = JSON.parse(resp);
                      console.log("Success: " + jsonObj);
                      },
                      error: function(request, status, error) {
                      console.log("Error status " + status);
                      console.log("Error request status text: " + request.statusText);
                      console.log("Error request status: " + request.status);
                      console.log("Error request response text: " + request.responseText);
                      console.log("Error response header: " + request.getAllResponseHeaders());
                      }
              });
  </code></pre>
  
  <p>I am getting [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token u", source: file:///android_asset/www/a.html (1).</p>
  
  <p>Please suggest me if there is any good tutorial/example available.</p>
  
  <p>Thanks!!! </p>