Hope all of you have gone through my fist post i.e Hello World! with PhoneGap, Android and Eclipse. Now in this tutorial I'm going to show you how to use PhoneGap to find your current Location using Android and Eclipse. This app will show you your current latitude, longitude and location.
In the previous application I have not used the cordova.js, Now i'll use that to find the current location and also I will use Google Maps API to draw the current location on Google Maps.
Create a new android project in Eclipse or you can modify the index.html file of your Hello World! android project. To use Google Map you need to embed the following external style sheet and javascript file in index.html file.
Now add the following script.
In the previous application I have not used the cordova.js, Now i'll use that to find the current location and also I will use Google Maps API to draw the current location on Google Maps.
Create a new android project in Eclipse or you can modify the index.html file of your Hello World! android project. To use Google Map you need to embed the following external style sheet and javascript file in index.html file.
And also you need to embed the jQuery plugin.
Next I have used the following internal style sheet.
body {
background:#000000;
font-family:Helvetica;
font-size:75%;
margin:0;
padding:0;
}
.btn{
border: 2px solid #222222;
-webkit-border-radius: 9px;
border-radius: 9px;
text-align:center;
display:block;
background:#eeeeee;
width:280px;
color:#222;
text-decoration:none;
padding:10px;
margin:12px;
}
Now add the following script.
No comments:
Post a Comment