Good day! There is a certain application in which it is necessary to implement the addition of news. News is stored on the server. I use Retrofit to bind to the api server. Fragment is used as a screen layout for the whole screen. Each news is displayed in CardView. In the xml of the fragment inserted a pair of CardView. At the moment, it turns out to get an array of News objects, pull out the data and display it in CardView. But how to make the automatic addition of CardView? Tell me what will be the disadvantage of this approach, or if this is an acceptable option, then point out where to dig further to implement the news feed on the similarity as in VK or other social networks.

  • What is meant by automatic addition. Do you have a list through Recyclerview / ListView implemented? Download new news and add it to the adapter. - temq
  • My list is not yet implemented. That's just thought for RecyclerView. But I have a few more questions matured. 1. When I make a request for the @GET news list ("/ api / news") Call <NewsRootAllNews> getAllNews (); While on the server all pair of news for the test is added. I get them on the list. But what will happen when there is a lot of news? How can I organize all this without brakes? 2. News where it is necessary to store (database etc.)? In general, the task is quite standard, many applications implement this. Do not know where you can read something about the architecture of the implementation of this task? - Serhei Ivanov
  • Why put the cart before the horse? Read about the lists and I think the first question will disappear by itself. The remaining issues have been discussed here repeatedly. In addition, much depends on the specific situation. There is no one right way to do something. - temq
  • ok thanks - Serhei Ivanov

0