- Create a new android application project.
- Enter the project details (like: application_name, package_name, minimum_supported_version, etc.).
- Select the type of activity on the next screen as
Empty Activityand keep the default name.
`app -> src -> main -> res -> layout -> activity_main.xml`
- Add the TextView and Buttons
`app -> src -> main -> java -> <package-name> -> MainActivity.java`
- STEP-1: Declare view variables globaly and BindViews from the xml
- STEP-2: Declare a variable
mCountand initialize it to0 - STEP-3: Setup clicks on the buttons to increment / decrement the value of count variable
- STEP-4: Display the updated value of the
mCountvariable in the TextView