![]() |
VOOZH | about |
This is the Part 3 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article:
Step 1: Add dependency to build.gradle (Module: app)
Navigate to the Gradle Scripts > build. gradle(Module: app) and add the below dependency in the dependencies section.
implementation "androidx.recyclerview:recyclerview:1.1.0" implementation 'de.hdodenhof:circleimageview:3.1.0' implementation 'com.github.bumptech.glide:glide:4.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
Now sync the project from the top right corner option of Sync now.
Step 2: Add read, write and camera permission in the AndroidManifest.xml file
Navigate to the AndroidManifest.xml file and add the below permission for getting read, write and camera permission in the app.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.CAMERA" />
Step 3: Create a new empty activity and name the activity as EditProfilePage
Working with the activity_edit_profile_page.xml file. On this page will be changing the email, name, and profile picture of the user. Navigate to the app > res > layout > activity_edit_profile_page.xml and add the below code to that file. Below is the code for the activity_edit_profile_page.xml file.
Step 4: Create a new layout resource file
Go to the app > res > layout > New > Layout Resource File and name the file as dialog_update_password. Navigate to the app > res > layout > dialog_update_password.xml and add the below code to that file. Below is the code for the dialog_update_password.xml file.
Step 5: Working with the EditProfilePage.java file
Go to the EditProfilePage.java file and refer to the following code. Below is the code for the EditProfilePage.java file. Comments are added inside the code to understand the code in more detail.
Step 6: Create Realtime Database inside the firebase console
Go to the firebase console > Realtime Database and create your database.
Then Start in Test Mode and Enable the real-time database.
Output:
When you update the data, the data is stored like the following
Note: Please Add drawable items before running the Application
Below is the file structure after performing these operations: