im trying to set up a button in my android program that when pushed gets some information from a web api and displays the result on my screen.
this is the code that does all the work, but i need to put it in my android page:
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<script type="text/javascript">
<!--
function get_temp(){
var url = "http://api.wunderground.com/api/00000000003/conditions/q/';
url+=$('#lat').val()+','+$('#lon').val()+' .json?callback=?';
$('#log').html($('#log').html()+url);
$.getJSON(url, function(data) {
var temp = data['current_observation']['temp_c'];
$('#out').html($('#shoedata').html()+temp+'<br>');
});
}
//-->
</script>
Latitude <input type="text" name="name" id="lat" />
Longitude <input type="text" name="name" id="lon" />
<input value="Get temperatura" type="button" onclick="get_temp()"/>
<div id='out'>Current temperature: </div>
<div id="log">Log: </div>
</body>
</html>
How can i do this? what are the steps i should follow to write js code in android? is it any different also for jquery and jsonp? Thanks!