How to add OnClickListener in Android App in Android Studio| Android App Development For Beginners in Urdu Hindi

Android App Development Urdu Hindi - Adding Button Contols in Android Studio

This is lesson 2 for Android App development for beginners in Urdu and Hindi. Today we will learn how to add button control in an Android application using Android studio. Further, it will be explained how to change attributes and properties of a button and other controls using XML and design in Android studio. In the end, we will see, we can attach an on-click listener with button control to make it clickable in Android studio with the help of two methods using XML are the on-click listener.

In this video demonstration, the following activities are performed in step by step to make sure that a beginner-level learner can easily learn Android app development. You can add all kinds of controls bi drag and drop from the control palette already discussed in lesson 1 about introduction to the Android studio interface.

Here is the code snippet that is discussed in the video when you will try to write on click listener functionality for a button control in an Android development application.

btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view)
            {
                // Do something
            }
        });

Working with Button Controls in Android App Development

Today’s objective (Lesson2)

  1. Adding controls
  2. Adding button control
  3. Setting attributes/properties ( XML, Atttibute Sheet Desin)
  4. Attching java code
  5. Adding JAVA button onclicklistener
    • Declare an object
    • Attach this object with activity control

Android App Development For Beginners in Urdu Hindi | Working Button Controls | Onclick Listener

Author: Habibullah Qamar

Its me Habib Ullah Qamar working as a Lecturer (Computer Sciences) in Pakistan. I have an MS(M.Phil) degree in computer sciences with specialization in software engineering from Virtual University of Pakistan Lahore. I have an experience of more than 15 years in the filed of Computer Science as a teacher. Blog Writing is my passion. I have many blogs, This one is special made with the aim of providing 100% Free online coaching and training to the students of under-graduate and postgraduate classes. Most of the students enrolled in computer sciences, information technology, software engineering and related disciplines find it difficult to understand core concepts of programming and office automation. They find difficult in understanding and solving their assignments.