Why is ArrayList only getting 50 values ββin Azure Table Storage?
I get a list of products in Azure Table Storage
and this list of products is stored in ArrayList
and displayed in Tablelayout
. My problem ArrayList
only gets 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(); }
});
source to share
Azure Mobile Services
returns 50 entries by default, you can get around this by first adding the EnableQueryAttribute to your public GET method like
[EnableQuery(MaxTop(1000)]
public IEnumerable<Product> Get()
{
...
}
Now you can use the method Take
to request a specific number of products
MobileServiceTable<ProductList> ProductBrand =
mClient.getTable("ProductList", ProductList.class).Take(1000);
To avoid paging on the server, use the method IncludeTotalCount
source to share