Skip to main content

Featured

Create a chat application using openfire server and smack library

Targeted audience for this blog are developers having knowledge of core java, android, XMPP Protocol, socket programming and FTP protocol. Following are the steps to build the chat application using openfire server and smack library : 1.) Install openfire server and configure on pc  :- You can follow :    https://docs.bmc.com/docs/itsm1805/installing-and-configuring-the-openfire-chat-server-804709699.html   to refer how to install the server on your PC.   The typical openfire server admin console looks like below :  You can download and install lots of available plugins and extend the functionality of the server.      Below is the source from where you can get the openfire plugins.       https://www.igniterealtime.org/projects/openfire/plugins.jsp 2.) Add the smack library into your android project, below are the source for integrating the latest smack library for android : https://github.com/igniterealtime/S...

Listview vs Recyclerview


RecyclerView was released by android in Android 5.0 (LOLIPOP) update. RecyclerView is a major enhanced version of Listview. It contains many new features like ViewHolder, ItemDecorator, LayoutManager, and SmoothScroller. The Major advantage of RecyclerView over listview is its ability to have animations while adding or removing an item.

Feature ListView RecyclerView
View Holders Its not compulsory to have view holders in listview.But it is suggested to use as if not used the listview will show stale data and be laggy. Its compulsory to have view holders in recyclerview.When implementing a RecyclerView, RecyclerView.ViewHolder class is used to define a ViewHolder object which is used by the adapter to bind ViewHolder with a position. This makes the implementation a little complex, but solves the issues faced in ListView.
Layout Manager In Listview,there is only one possibility and that is vertical layout. In Recyclerview we can have 3 possibilities of the list layouts.To support multiple types of lists it uses RecyclerView.LayoutManager class.
  • LinearLayoutManager - This is the most commonly used layout manager in case of RecyclerView. Through this, we can create both horizontal and vertical scroll lists.
  • StaggeredGridLayoutManager - Through this layout manager, we can create staggered lists. Just like the Pinterest screen.
  • GridLayoutManager - This layout manager can be used to display grids, like any picture gallery.

Comments