Class WeatherLocationManager


  • public class WeatherLocationManager
    extends java.lang.Object
    • Constructor Detail

      • WeatherLocationManager

        public WeatherLocationManager​(Context context)
    • Method Detail

      • setView

        public void setView​(RelativeLayout relativeLayout)
      • registerCancelButton

        public void registerCancelButton​(Button cancelButton)
      • onActivityCreated

        public void onActivityCreated​(Activity activity,
                                      Bundle bundle)
      • onActivityStarted

        public void onActivityStarted​(Activity activity)
      • onActivityResumed

        public void onActivityResumed​(Activity activity)
      • onActivityPaused

        public void onActivityPaused​(Activity activity)
      • onActivityStopped

        public void onActivityStopped​(Activity activity)
      • onActivitySaveInstanceState

        public void onActivitySaveInstanceState​(Activity activity,
                                                Bundle bundle)
      • onActivityDestroyed

        public void onActivityDestroyed​(Activity activity)
      • hasLocationPermission

        public static boolean hasLocationPermission​(Context context)
      • hasBackgroundLocationPermission

        public static boolean hasBackgroundLocationPermission​(Context context)
      • getLastKnownLocation

        public static Location getLastKnownLocation​(Context context)
      • checkForBackgroundLocation

        public static boolean checkForBackgroundLocation​(Context context)
        checks for a new location using known locations, meaning that no active location search is triggered. Requires the location background permission.
        Parameters:
        context -
        Returns:
        true if a new station was set, otherwise false (including not granted permission)
      • findClosestStation

        public static Weather.WeatherLocation findClosestStation​(Context context,
                                                                 Location location)
      • getDescriptionGeo

        public static java.lang.String getDescriptionGeo​(Weather.WeatherLocation weatherLocation)
      • getDescriptionAlternate

        public static java.lang.String getDescriptionAlternate​(Context context,
                                                               Weather.WeatherLocation weatherLocation)
      • startGPSLocationSearch

        public void startGPSLocationSearch()
      • stopGPSLocationSearch

        public void stopGPSLocationSearch()
      • checkLocation

        public void checkLocation()
      • newLocation

        public void newLocation​(Location location)