Answer the question
In order to leave comments, you need to log in
How to implement adding news to an Android application?
Good afternoon!
There is some application in which it is necessary to implement the addition of news.
News is stored on the server. I am using Retrofit to communicate with the server api.
The screen layout is Fragment full screen. Each news is displayed in CardView. In the xml of the fragment, I 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 a CardView.
But how to make the CardView auto-add?
Tell me what will be the disadvantage of this approach, or if this is an acceptable option, then indicate where to dig further in order to implement a news feed similar to that in VK or other social networks.
Answer the question
In order to leave comments, you need to log in
You need a RecyclerView to build a dynamic list from a CardView + SwipeRefreshLayout (optional) to implement the "swipe to refresh" pattern + pagination (loading data from the server page by page) - google for "recyclerview endless scrolling". Retrofit in the background, I hope we ship? In general, the most standard functionality. Tutorialov - the sea.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question