![]() |
VOOZH | about |
Android mobiles are very handy, and they provide the information instantaneously. Just assume that you are continuously flying or attending patients or participating in meetings etc., very often. During those times, there are possibilities of getting stressed and hence meditation is very much essential in this fast running lives. Here providing the source code for the breathing exercise app and surely that will be helpful to get more energetic and enthusiastic.
To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio.
Go to the app > res > values > colors.xml file and set the colors for your app.
colors.xml:
Create a drawable for setting the background of the screen and a drawable for the background and circle shape of the breathing view.
Go to the activity_main.xml file and refer to the following code. Below is the code for the activity_main.xml file.
activity_main.xml:
Navigate to app > res and right of the res folder and select New > Android Resource Directory and set the name and type as anim. Now in that folder create 4 animation files for circle and text inhale and exhale animations respectively.
Navigate to app > java > {package-name} > MainActivity.kt/MainActivity.java and add the following code.
Refer to the following repo to get the entire code:Breathing_Exercise_in_Android