I am getting products list into Azure Table Storage and that product list store in ArrayList and display in Tablelayout..My problem ArrayList get only 50 values.. how to solve this problem. please help me.
MobileServiceTable<ProductList> ProductBrand = mClient.getTable("ProductList", ProductList.class);
ProductBrand.where().field("enable").eq(val(true)).execute(new TableQueryCallback<ProductList>() {
public void onCompleted(List<ProductList> results, int count, Exception error, ServiceFilterResponse response) {
final ArrayList<ProductList> list3 = new ArrayList<ProductList>();
for (ProductList item : results) {
list3.add(item);
}
for(int c=0;c<list3.size();c++)
Toast.makeText(getBaseContext(),"Size:"+list3.size()+"Product "+list3.get(c).toString(), Toast.LENGTH_SHORT).show(); }
});
Azure Mobile Services returns 50 records by default you can get around this by firstly adding the EnableQueryAttribute to your public 'GET' method eg
[EnableQuery(MaxTop(1000)]
public IEnumerable<Product> Get()
{
...
}
Now you can use the Take method to request a certain number of products
MobileServiceTable<ProductList> ProductBrand =
mClient.getTable("ProductList", ProductList.class).Take(1000);
To avoid any paging on the server use the IncludeTotalCount method
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With