package fishrungames.bashgid.core;

import android.content.Context;
import android.location.Location;
import android.location.LocationManager;

public class LocationHolder
{
	public static Location location;
	
	public static double CONST_UFA_LATITUDE = 54.726274;
	public static double CONST_UFA_LONGITUDE = 55.947622;
	public static int CONST_UFA_ZOOM = 10;
	
	public static void RefreshLocation(Context context)
	{
		LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
	
		boolean isGPSEnabled = locationManager
                .isProviderEnabled(LocationManager.GPS_PROVIDER);

        // getting network status
		boolean isNetworkEnabled = locationManager
                .isProviderEnabled(LocationManager.NETWORK_PROVIDER);

		if (isGPSEnabled)
		{
			location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
        }
		else if (isNetworkEnabled) 
		{
			location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
		}
		else
		{
			location = null;
		}
	}
	
	
}
