Support Multiple Screen Sizes - Android Studio Tutorial
Вставка
- Опубліковано 6 вер 2024
- 🏆 My Online Courses
⭐Discount Coupon: LAUNCH-STEVDZA-SAN
stevdza-san.com
🐱👤 Wanna become a member? Join!
/ @stevdzasan
📸 Instagram
/ stevdza_san
Android devices come in all shapes and sizes, so your app's layout needs to be flexible. That is, instead of defining your layout with rigid dimensions that assume a certain screen size and aspect ratio, your layout should gracefully respond to different screen sizes and orientations.By supporting as many screens as possible, your app can be made available to the greatest number of users with different devices, using a single APK.
And in this video I'm going to show you how your application can fit on different screen resolutions by creating layout files for each screen density.The pixel density is the number of pixels within a physical area of the screen and is referred to as dpi (dots per inch).
This is different from the resolution, which is the total number of pixels on a screen.To ensure that your layout is flexible and adapts to different screen sizes, you should use "wrap_content" and "match_parent" for the width and height of most view components, instead of hard-coded sizes.
Download Background Vector: bit.ly/3bmYeSK
I searched this for months but i didn't found it. Thank you very much for making this video. Sub and like!
There is no other way to make the app responsive for all devices.
I mean this is the long process to make the app responsive.
We can use multiple dimen files instead of multiple layout files
Is this the only solution for supporting multiple screen sizes ?
You can also create multiple dimens xml files for various margin sizes.
@@StevdzaSan plz provide
I did it using only weights.
great tutorial. But wouldn't it be better to use ratios and constraints along with vector drawables rather than creating same screen for each dpi? In that way the UI will always scale according to the ratios and fit all devices
Yes, but sadly that's not enough on more complex layouts.
I would say the same but knowing this option exist and how to use it might be helpful.
very informative, but you are making login screen three times right? that sound so not efficient when building a big app.
Soo.. If we want to add new / modified View, we do the same things many times? 🙊🙊🙊
Brilliant , This is how tutorials should be
So when I make any update to the app I need to do manually for all the device resolutions?
thank you sir , you're videos are very clear and straight to the point . keep going !
Thank you so much, that really helped me understand what i was missing. Just one question, why you don't use any Density?
So if u have 20 screens you create 60 xmls to support those 3 densities ..
Is there a way we don't have to go through this tedious process
Other way is to declare different size values in dimens.xml. Each dimens.xml with different qualifier like in layouts.
Hello sir i need to Know how to résolve the same problem but the view (table. Button) are create programmatically please help me
how did you know, if nexus S using High density not XXX-Density, how do you check it ?
In Device Manager it tells you under resolution
I wanna ask something, is that not make the code boilerplate??
Great video and a really professional info section. Great job my man
In which software did you create you design 0:09 . Kindly reply with the name of that software as soon as possible...
Adobe xd
I have 2 devices with different sizes but they both have the same xhdpi , when i run my app they look different different, why is that, help please
For more info, read this: developer.android.com/training/multiscreen/screensizes
@ Brian Puron, same problem is occured me.were you able to resolve it?.if you have an idea help me.
Cool this is topic i have been waiting for !! Thank you
What does error "E/MultiWindowProxy: getServiceInstance failed!" mean?
please help me regards this
Oh. A video in english. Take your like
great video! Question How does a device know which layout file to display? Do I need to program that logic in the kotlin file?
What to do when two phones with the same density have different screen sizes?
Why not choose the any density option when creating activities with the same same background so as to avoid maximizing and minimizing?
thank you it helped a lot!
Very easy to understand! Thank you simplifying this topic
This tutorial helps me a lot ! thank you sir!
Sir make a video on searchview on recycleview
Why can't you use different dimensions based on density
Thanks, but why don't you just export from xd for Android. It will export that background in different resolutions, and will also do everything for you.
Tell me more, please?
Does wrap-content, match-parent, weights usage will prevent from using differend layout?
I added all different screen sizes but when i run my project the main_activity.xml is never used! I tried multiple devices in the emulator but never managed to use it! should I delete the main_activity.xml ?!
Hello bro. Please help me. How can i calculate all dps in the each layout file??
The file is no longer available
whats the difference between density and size when you create new xml file?
which is best multi screen size, Smallest widht (SW600),or Density
Great tutorial, thank you so much!
Really curious what is the program name used to export to SVG?
Great video dude 👍🏽
Thank you so much
thanks for the video :) I have one question. Is it really important to save background file as .svg? Won't it work on .png?
Using vectors has many benefits, less apk size, pixel perfect images and better performance.
@@StevdzaSan Thanks for answer. So I'm gonna make some changes in my app !
Having images of all dpi's VS creating multiple screen size layout.....which one is bettter or which one should be used at which moment
Multiple layouts and preferably vector assets.
@@StevdzaSan I'm confused when to use all pixel size images and when to use multiple layout for single screens
How can I handle same density with different screen size?
excellent work, could you tell me the name of the software I use to design in the background vector?
Adobe Xd
Ne znam hoces li vidjeti komentar, ali pozdrav iz Hrvatske. Naisao sam slucajno na tvoj kanal i mogu ti reci samo nastavi!
Which site use for design please asked
If I have five interfaces is this method efficient?
Brilliant! Thank you Sir
so damn good tutorial sir, suscribed inmediatly, keep going!
Guys, I have created Low Density, then I install 2 device which is LDPI, but each other have different layout design and didn't match the layout which I created. why? how support all resolutions?
P.S I have RecyclerView which I want to show current DPs on the screen
Thank you nice tutorial keep it up
Hello, what i need to do with a lot of xml files? add one by one?
Great video! Thanks a lot!
Thank you
Nice, so we always have to make different XMLs to support multiple DPIs
There's no special layout (relative, linear etc) which would adjust the layout according to screen size?
Well you could use match parent for a view instead of using fixed dimensions, that way the view will expand everytime your app is running of different screen sizes or even on landscape mode. However for more complex layouts you would use multiple layout files.
Umm,, how did you handle image size that come from api?
Maybe like for a banner? It usually have fixed height in android. What is the better solution for this? Thanks
Use glide library. I have made a video about that
Should I repeat this method for any layout for example if I made Recycleview when I made the custom layout for it should I make it 4 times hdpi and xhdpi ...
Basically recycler view fits well in all devices. You have to worry about your startup Screens
@@gajendrapandeya5081 thanks bro 🌹
Awesome video
Super fast but super good haha !
Thanks
Thank for the Tutorial :)
wow. That's amazing video... Thanks
Thanks .Great video
perfect simple and clear !
Thanks dude
Awesome this is a very useful video, please can you make a video on how to upload list of images to firebase
I'm planning to make a full course for Firebase realtime database and firestore in the future.
@@StevdzaSan I really appreciate you replying....Thanks
Awesome!
What the application name?
Thanks for your great tutorials. Sub and like
thanks!
Thanks!
Thank you
You sure are teaching us great stuff and thanks but... do we have to do that for every single xml layout that will be shown in our app? 🙄
is there any way to make this automatically?
So the question is, which screen you gonna publish to playstore? I don't think it's the right solution.
Among many different layouts, Android OS automatically choses the right one for your smartphone.
Would've been better without the music. It's distracting
Damn!
First viewer
you just messed up the tutorial...remember not everyone is expert as you
????