Skip to content

Instantly share code, notes, and snippets.

@fdansv
fdansv / gist:6579158
Last active December 23, 2015 04:19
Method that calculates the area of the polygon formed by the given list of Location objects
public double areaPoly(ArrayList<Location> places){
int[] x = new int[places.size()];
int[] y = new int[places.size()];
for (int i = 0; i<places.size(); i++){
x[i] = LocationToEN(places.get(i))[0];
y[i] = LocationToEN(places.get(i))[1];
}
double area = 0.0;
int j = x.length-1;
public class MapActivity extends SherlockActivity {
private LocationManager locationManager;
Location location;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
}
public class CurrentLocationListener implements LocationListener{
public static double latitude;
public static double longitude;
@SuppressWarnings("static-access")
@Override
public void onLocationChanged(Location location) {
this.latitude=location.getLatitude();
this.longitude=location.getLongitude();
}
@fdansv
fdansv / Megaphone_.idea_.name
Created July 17, 2013 22:11
A real time web stats mobile n;tification thingy
Megaphone