Пример #1
0
        public ResponseCurrent.RootObject ExecuteCurrentRequest()
        {
            var client = new RestClient(url);

            response = client.Execute(request);

            ResponseCurrent.RootObject objRoot = new ResponseCurrent.RootObject();
            objRoot = JsonConvert.DeserializeObject <ResponseCurrent.RootObject>(response.Content);

            return(objRoot);
        }
Пример #2
0
        public async Task <ResponseCurrent.RootObject> ExecuteCurrentRequestAsync()
        {
            var client  = new RestClient(url);
            var request = new RestRequest();

            response = await client.ExecuteTaskAsync(request);

            ResponseCurrent.RootObject objRoot = new ResponseCurrent.RootObject();
            objRoot = JsonConvert.DeserializeObject <ResponseCurrent.RootObject>(response.Content);

            return(objRoot);
        }
Пример #3
0
        public void LVCity_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            myCity = myCities[e.Position];
            string theCity             = myCity.name;
            string theTemp             = myCity.main.temp.ToString();
            string theWeatherCondition = myCity.weather[0].description.ToString();
            string theWeatherIconUrl   = "http://openweathermap.org/img/w/" + myCity.weather[0].icon + ".png";

            Intent myIntent = new Intent(this, typeof(IndividualCityActivity));

            myIntent.PutExtra("City", theCity);
            myIntent.PutExtra("Temp", theTemp);
            myIntent.PutExtra("Desc", theWeatherCondition);
            myIntent.PutExtra("WeatherIcon", theWeatherIconUrl);

            StartActivity(myIntent);
        }