<p>Hi.<br>
I have never used phonegap, but one of the 2010 google summer of code projects did, so you may be able to pick up something from that (search the wiki for gsoc). Another looked at a javascript editor, and that used oauth authentication, so it would be worth a loom too.</p>
<p>Graham</p>
<p>from my phone</p>
<p><blockquote type="cite">On 16 Apr 2012 13:48, "David Serenity" <<a href="mailto:debukali@gmail.com">debukali@gmail.com</a>> wrote:<br><br>Hi all,<div><br></div><div>I am new to osm and phonegap development. I have not found much documentation on making calls to OSM api from an android phonegap app. I am especially interested in creating changesets and uploading map data (form entries and coordinates) to OSM. i tried ajax calls to the api and have run into same origin policy restrictions and the url (<span style="line-height:19px;font-size:13px;font-family:sans-serif"> </span><b style="line-height:19px;font-size:13px;font-family:sans-serif"><a href="http://api06.dev.openstreetmap.org/api/0.6/changeset/create" rel="nofollow" style="color:rgb(51,102,187);background-image:url('');background-color:initial;padding-right:13px;background-repeat:no-repeat no-repeat" target="_blank">http://api06.dev.openstreetmap.org/api/0.6/changeset/create</a></b>) is not found. i have used the code below:</div>
<div><br></div><div><div>function loadIt()</div><div><span style="white-space:pre-wrap"> </span>{</div><div><br></div><div><span style="white-space:pre-wrap"> </span>var xmlData = '<osm><changeset><tag k="created_by" v="EasyMappr" /><tag k="comment" v="Ah please do it" /></changeset></osm>';</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>var url = "<a href="http://api06.dev.openstreetmap.org/api/0.6/changeset/create" target="_blank">http://api06.dev.openstreetmap.org/api/0.6/changeset/create</a>";</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>$.ajax({</div><div><span style="white-space:pre-wrap"> </span> type:"PUT",</div><div><span style="white-space:pre-wrap"> </span> username: "<a href="mailto:debukali@gmail.com" target="_blank">debukali@gmail.com</a>",</div>
<div><span style="white-space:pre-wrap"> </span> password: "lettersforme",</div><div><span style="white-space:pre-wrap"> </span> url: url,</div><div><span style="white-space:pre-wrap"> </span> data: xmlData,</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span></div><div><span style="white-space:pre-wrap"> </span> error: function(xhr, textStatus, errorThrown)<span style="white-space:pre-wrap"> </span>{</div>
<div><span style="white-space:pre-wrap"> </span> if (xhr.status === 0) {</div><div> alert('Not connect.\n Verify Network.' + textStatus);</div><div> } else if (xhr.status == 404) {</div>
<div> alert('Requested page not found. [404]');</div><div> } else if (xhr.status == 500) {</div><div> alert('Internal Server Error [500].');</div><div> } else if (textStatus === 'parsererror') {</div>
<div> alert('Requested JSON parse failed.');</div><div> } else if (textStatus === 'timeout') {</div><div> alert('Time out error.');</div><div> } else if (textStatus === 'abort') {</div>
<div> alert('Ajax request aborted.');</div><div> } else {</div><div> alert('Uncaught Error.\n' + xhr.responseText);</div><div> }</div><div><span style="white-space:pre-wrap"> </span> },</div>
<div> success : function(result) {</div><div><span style="white-space:pre-wrap"> </span> alert("Its done" + result);</div><div><br></div><div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> </span>});</div><div><span style="white-space:pre-wrap"> </span></div><div><br></div><div><br></div><div> <span style="white-space:pre-wrap"> </span>}</div>
</div><div><br></div><div><br></div><div><br></div><div>If anyone can provide any ideas or code, please share?</div><div><br></div><div>Regards,</div><div>David</div>
<br>_______________________________________________<br>
talk mailing list<br>
<a href="mailto:talk@openstreetmap.org">talk@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/listinfo/talk" target="_blank">http://lists.openstreetmap.org/listinfo/talk</a><br>
<br></blockquote></p>