
The basic building block for user interface is a View object which is created from the View class and occupies a rectangular area on the screen and is responsible for drawing and event handling.There are different types of views:
What is the difference between:
pxdipdpsppx: Pixels - corresponds to actual pixels on the screen.
dp: Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Note: The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp
sp: Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and user's preference.
Moreover you should have clear understanding about the following concepts:
Screen size: Actual physical size, measured as the screen's diagonal. For simplicity, Android groups all actual screen sizes into four generalized sizes: small, normal, large, and extra large.
Screen density: The quantity of pixels within a physical area of the screen; usually referred to as dpi (dots per inch). For example, a "low" density screen has fewer pixels within a given physical area, compared to a "normal" or "high" density screen. For simplicity, Android groups all actual screen densities into four generalized densities: low, medium, high, and extra high.
Orientation: The orientation of the screen from the user's point of view. This is either landscape or portrait, meaning that the screen's aspect ratio is either wide or tall, respectively. Be aware that not only do different devices operate in different orientations by default, but the orientation can change at runtime when the user rotates the device.
Resolution: The total number of physical pixels on a screen. When adding support for multiple screens, applications do not work directly with resolution; applications should be concerned only with screen size and density, as specified by the generalized size and density groups.
Density-independent pixel (dp): A virtual pixel unit that you should use when defining UI layout, to express layout dimensions or position in a density-independent way. The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, which is the baseline density assumed by the system for a "medium" density screen. At runtime, the system transparently handles any scaling of the dp units, as necessary, based on the actual density of the screen in use. The conversion of dp units to screen pixels is simple: px = dp * (dpi / 160). For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels. You should always use dp units when defining your application's UI, to ensure proper display of your UI on screens with different densities.
I have attached a pdf document with this lecture which talks about common Android views. Please click on the download tab in this lecture.
Android Development for Beginners – Build Apps with Java & Android Studio
Learn to Build Android Apps from Scratch and Launch Your Career in Just 6 Weeks
Are you ready to turn your ideas into real Android apps? Maybe you’ve always dreamed of creating an app but didn’t know where to start. Or perhaps you’re looking for a career in Android Development that can open doors to high-paying jobs and even allow you to start your own app business on the side.
This course is designed to take you from absolute beginner to a confident Android Developer — even if you’ve never written a single line of code before.
Over 5000 students have already enrolled and are now on their way to building and publishing Android apps. Now it’s your turn.
Why Android Development?
Android powers the majority of smartphones across the world. From social media apps to banking solutions, millions of businesses and entrepreneurs rely on Android developers to bring their ideas to life.
Android is the primary OS for more than 90 tablets, 6 e-Readers, and 300 smartphones.
The Google Play Store has over 1.4 million apps, and it’s growing every day.
Around 1.5 million new Android devices are activated worldwide — every single day.
Learning Android Development means opening the door to a future-proof, high-demand skill set that can change your career and unleash your creative potential.
What You’ll Learn
This hands-on course will guide you step by step through:
Section 1: Building Layouts
Writing XML for Android apps
Using TextViews, ImageViews, and styling your views
Positioning elements with LinearLayout and RelativeLayout
Section 2: Making an App Interactive
Learning Java while building the JustJava Coffee Ordering App
Handling button clicks and user interaction
Declaring and using variables
Working with strings, integers, and layouts
Section 3: Working with the Android Framework and Control Flow
Writing and calling methods
Understanding parameters and return values
Introduction to Object-Oriented Programming
Using if/else logic to control app behavior
Dynamically changing your app’s attributes
By the end, you’ll have a strong foundation in Java, Android Studio, and app development — plus your very own working apps.
What Makes This Course Different?
Learn by Doing: From the second lecture, you’ll be building apps — not just reading slides.
Beginner-Friendly: Designed for students with zero programming background.
Real Support: Access resources, developer forums, and instructor guidance when you’re stuck.
Lifetime Access: Revisit lessons, assignments, and projects anytime.
Quizzes and Assignments: Reinforce your skills with practical exercises.
This course doesn’t just teach you concepts — it makes you a developer.
Why Learn From Me?
I live and breathe Android. With over a decade of programming experience, five years of app development, and more than fifty published apps and games across Google Play and the Apple App Store, I know what it takes to succeed.
My mission is simple: to help you become an Android Developer in the shortest possible time, without skipping the fundamentals that matter.
Your Future Starts Here
In just six weeks, you’ll go from zero programming knowledge to creating apps and even publishing them on the Google Play Store — reaching millions of potential users.
You don’t need to be a pro. You don’t need prior experience. All you need is curiosity, dedication, and the willingness to learn.
Enroll today in Android Development for Beginners – Build Apps with Java & Android Studio and take the first step toward a rewarding career and the freedom to bring your ideas to life.