Exemplo n.º 1
0
        public string GetJson()
        {
            string       Test     = null;
            Localisation location = ServiceGeolocalisation.GetLocation();

            if (location != null)
            {
                string latitude  = Convert.ToInt32(location.Longitude).ToString();
                string longitude = Convert.ToInt32(location.Latitude).ToString();
                string url       = "http://api.openweathermap.org/data/2.5/forecast?lat=" + longitude + "&lon=" + latitude + "&units=metric&APPID=b15c4f9c4f1e0ac3f382a9f3f31f814f";
                try
                {
                    Test = GET(url);
                }
                catch (Exception e)
                {
                    Log.Info("Request", e.ToString());
                }
            }

            return(Test);
        }
 public void OnStatusChanged(string provider, [GeneratedEnum] Availability status, Bundle extras)
 {
     Log.Info("WEATHER APP", ServiceGeolocalisation.GetLocation().ToString());
 }
 public LocalisationListener(ServiceGeolocalisation p_ServiceLocation)
 {
     this.serviceGeolocalisation = p_ServiceLocation;
 }