Implemented in the following way:
From server get json of the form:
{
"data_array_1": [
{
"id":4,
"count":2
},
{
"id":5,
"count":5
},
{
"id":6,
"count":3
}
],
"data_array_1":[
{
"id":54,
"count":3
},
{
"id":55,
"count":5
},
{
"id":56,
"count":3
}
],
Record this data in SQLite.
After you record get the data to display calling getSupportLoaderManager().getLoader(0).forceLoad()
I update the data every 2 hours and provided that there will come a 200 response code.
Longer I turn on a specific list. For example data_array_1.
Each element of this list contains the id, which I find the number from the database, and deduce the number in a list item, if quantity != 0. At the same time as updating the amount of new data in the side menu.
If you need someone, explain in detail.