![]() |
VOOZH | about |
This is the Part 5 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article:
Step 1: Working with the fragment_add_blogs.xml file
On this page will be the having two EditText to enter the title and description and an image view in which the user will be selecting an image. Navigate to the app > res > layout > fragment_add_blogs.xml and add the below code to that file. Below is the code for the fragment_add_blogs.xml file.
Step 2: Working with the AddBlogsFragment.java file
Go to the AddBlogsFragment.java file and refer to the following code. Below is the code for the AddBlogsFragment.java file. Comments are added inside the code to understand the code in more detail.
Output:
After successfully adding the data in the blog the data will be shown in the firebase like the following:
👁 ImageNote: Please Add drawable items before running the Application
Below is the file structure after performing these operations:
👁 Image