First conver the end json result your will get in to c# method.
Like :
[{ "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false }]
Go to the http://json2csharp.com/ and paste it , you will then get the method of it.
Then make Products.cs
using System; using System.Collections.Generic; using System.Text; namespace App5 { class Products { public int userId { get; set; } public int id { get; set; } public string title { get; set; } public bool completed { get; set; } } }
MainPage.xaml
<ListView x:Name="ProductsListView"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StackLayout Orientation="Horizontal"> <Label Text="{Binding title}" TextColor="Black"></Label> <Label Text="{Binding completed}" TextColor="Black"></Label> </StackLayout> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView>
MainPage.xaml.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; using System.Net.Http; using Newtonsoft.Json; namespace App5 { public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); GetProducts(); } private async void GetProducts() { HttpClient client = new HttpClient(); var response = await client.GetStringAsync("https://jsonplaceholder.typicode.com/todos/"); var products=JsonConvert.DeserializeObject<List<Products>>(response); ProductsListView.ItemsSource = products; } } }