How to Display All Registered Users in Social Media Android App?
This is the Part 8 of “Build a Social Media App on Android Studio” tutorial, and we are going to cover the following functionalities in this article:
- We are going to Show all the Registered Users of our App.
- We are going to show the list of users in UsersFragment.
Step By Step Implementation
Step 1: Create a new java class
Working with the ModelUsers.java file. Created this activity to initialize the key so that we can retrieve the value of the key later.
Step 2: Create another new java class
Working with the AdapterUsers.java file.
Step 3: Working with the fragment_user.xml file
Navigate to the app > res > layout > fragment_user.xml and add the below code to that file. Below is the code for the fragment_user.xml file.
Step 4: Working with the row_users.xml file
Create a new layout resource file and name the file as row_users. Below is the code for the row_users.xml file.
Step 5: Working with the UsersFragmnet.java file
Go to the UsersFragmnet.java file and refer to the following code. Below is the code for the UsersFragmnet.java file.
For all the drawable file used in this article please refer to this link: https://drive.google.com/drive/folders/1M_knOH_ugCuwSP5nkYzeD4dRp-Honzbe?usp=sharing
Below is the file structure after performing these operations: