언어 설정

Menu
Sites
Language
How to consume restful web service in Tizen .Net

Hi Folks,

     I'm new to Tizen development, My requiremnet is how to consume a sample restful web service and display it in a list.

 

Kindly help me out form this.

 

Thanks in advance,

Vamsi

Responses

3 댓글
Vamsi Konanki

Hi Folks,

     Finally consumed restful webservice with the following code.

System.Net.Http.HttpClient client;
async System.Threading.Tasks.Task serviceCallAsync()
        {
            String RestUrl = "http://api.androidhive.info/json/glide.json";
            var uri = new Uri(string.Format(RestUrl, string.Empty));

            client = new System.Net.Http.HttpClient();

            var response = await client.GetAsync(uri);

            if (response.IsSuccessStatusCode)
            {
                var responseContent = await response.Content.ReadAsStringAsync();
                await MainPage.DisplayAlert("Service Response", responseContent, "OK");
            }
        }

 

Cheers!

--------

Vamsi K

Armaan-Ul- Islam

Thanks for Sharing !!!

And you were looking for "display it in a list" also.

Xamarin.Forms.ListView would be a good candidate for that.

Guide: Xamarin.Forms.ListView

API References: Xamarin.Forms.ListView

Vamsi Konanki

Thanks Armaan,

           Implemeted listview.