Hi i need to cal an event at onchangelocation(), by comparing current latitude and longitude with some saved latitude and longitude but i m getting an error. eclipse is not
All the 4 input parameters are in float. Distance is a relative one not real distance. You need to convert this distance to a real distance by searching some formula online :( I used this in my app to get nearest metro station from my current location. Hope this snippet helps someone :)
float distance(float lat,float lon,float clat,float clon)
{
float distance;
float temp1;
float temp2;
temp1=(float)((lat-clat)*(lat-clat));
temp2=(float)((lon-clon)*(lon-clon));
distance=temp1+temp2;
return distance;
}