I'm part of the Android development team at a small company in the city where I live.
We're working on building different apps and currently there's this app we have the design as a .sketch file but the layouts are only drawn for iOS devices and we need to adapt based on those guidelines. The thing is there are 2 different layouts for the iPhone SE and for the iPhone X. They are mainly the same but a few things differ like font sizes, margins, paddings, etc.
I want to implement the design on Android to also be dynamic depending on the user's resolution (or DPI, better said) so I'm trying to use the dimens-xyz.xml files to set my sizes in there and use those values as references in my layouts so I only write one layout xml for each screen, no matter the DPI.
So far, so good. My question is: What are the Android equivalent screen DPIs for the iPhone SE and iPhone X? What dimens-xyz files do I need to use in order to keep the UI consistent for smaller and larger screen devices and have the UI be "responsive".
It's hard to find a relevant answer on Google because it's kind of a technical question and when Google sees iphone and screen in the same search query it starts throwing results of comparing screens for iOS vs Android phones.
PS: I have 0 prior knowledge on iOS development and internals
For iPhone SE, having a 4.7 inch display and 1334 by 750 resolution, you can go with 4.7 WXGA which is a 720 by 1280 equivalent in Android (the closest i could find).
As for Iphone X it has a resolution of 2436×1125, with a 5.8 inch display giving a PPI of 462.63. Closest in Android would be Pixel 3A, with 2220x1080 and 440 dpi.
Related
I have read an much more documents on android and other blogs about how to support multiple screen sizes. And To some extent I am successful in making some good looking designs for apps. Now let me start from the start what is the problem and what I wanted to ask from you guys.
Android has now different screen sizes of different screen densities and having different resolutions. so We have to face 3 different things the size , density and the resolution.
Now Let take example of Samsung s4(xxhdpi device having 1080*1920px) , Samsung Grand (hdpi 480*800px) and both has same screen size that is 5 inch
and Samsung galaxy note 10.1 (Mdpi devices ) 10 inch screen size.
Now android says to make different drawable and put them into respective folder, its ok, let suppose its done. Now what ?
lets suppose , What if I have to set the image in left top with the marginleft of 5 dp and some other views according to them with different specific paddings and margins in dps and suppose I have set all of these in my layout according to hdpi device, which we know is not going to look good in samsung s4 xxhdpi device and tablet.
and Also as design pattern says to change design for the tablets according to your need , but on the other hand the support of making different layout has been deprecated now we have to use different values folder.
so in short what is a best way and what is clear thing for making drawables.
how should we re size our drawables to support all devices , and also if making different layout has been deprecated now what should we do to make our design look good and approximately same in all devices?
also how to judge that device is tablet and we should now start showing the multi pane design ?
please do not refer me to android developer website , I know its very helping and I learnt a lot from there , but right now I just want to discuss the technical issues and want to take advantage of some experienced developers. Thanks
I need to redesign an app from IOS to Android (only the GUI, no coding), but it has to be compatible (from the design point of view) with ICS, JB and KitKat versions.
I only designed apps for IOS not for android so, the problem is - I don't know what resolutions should I use (screen sizes in px and density - dpi). I understood that I have to do different sizes and I found this on google and this, but I still don't know where to begin from. Can anyone please tell me what sizes should I take in mind when designing the UI for the app? (like 480x800px at 320dpi, and so on).
you can try having a look at below page by android:
Supporting Multiple Screens
For total understanding of UI design in android you can have a look over here
Supporting Different Screen Sizes
Android have no standard screen size predefined but things getting better in Andoid 3.2+ by new qulalifiers like sw (screens wider than ...). Before that you could only use size-buckets like large, normal, small which was not suitable for all ranges of android devices (in order to have a big picture, there are around 4000+ differnet android devices out there!).
you can have a look over official android blog for comprehensive details about this.
My application is supporting 3 type of density ldpi (120),mdpi(160),hdpi(320) and for that we have three folder for resources (ldpi,mdpi,hdpi).
But my problem is occurring in HTC sensation XE (540x960) having density ~256 dpi.and my resources is stretched.
In manifest file
<supports-screens android:xlargeScreens="false" />
means i am not supporting for xlarge screen so does 540x960 come in high density??.
How can i overcome this problem???
Android Multiscreen Support issue says "You can also use a combination of density and size qualifiers but that still leaves some room for two different resolutions falling into the same bucket."
What should be the name of drawble folder for this kind of resolution??
or is there any other way to short out this issue.
EDIT : My problem is not with layout, my problem 540x960 come in HDPI but my hdpi drawbles are designed related to 480x800
Help me..
Thanks in advance..
you can use below combination for Layout for HTC sensation XE (540x960) :
res/layout-w540dp-h960dp/layout.xml
this will use for pick layout for this device and for drawable it will pick image from hdpi because in this developer site 256 dp come in range of hdpi . http://developer.android.com/guide/practices/screens_support.html.
hope this will help you.
Your problem is that you have designed your bitmaps for a particular screen size rather than screen density.
Plainly put, you should not do that. There are a huge number of different form factors and screen sizes out there, and you cannot hope to have graphics sized for all of them. So you fix this issue for 540x960 screens... what then with your users who are on 480x854 displays (most hdpi motorola devices)? Will you include different graphics for 1024x720 and 1280x720 displays if you're developing for that? What about 1280x800?
Granted - it can be a pain to deal with these issues, but that is the price we pay for diversity of devices. And Google has provided a fair amount of powerful tools at our disposal to deal with this.
When you are designing an app for Android, you need to think of the design as if you were designing a website - not a desktop (or IOS) program. All (or most) of the tricks that you use for designing a website also apply here - plus you have the density-awareness and 9.patch tools.
And if you really cannot adjust your graphics/layout to the screen without messing it up, you can always center the layout on the display (or align it left or right, depending on what you think looks best).
Edit:
As I mention above, the core to flexible UI design in Android is to think of your app like a web site. Roman Nurik has an article discussing this on the Android blog.
http://android-developers.blogspot.com/2011/09/thinking-like-web-designer.html
Apart from that, it is mostly covered by the Android site, etc.
http://developer.android.com/training/multiscreen/index.html
Using the right layouts and 9-patch images (not always - sometimes static images are better) will allow you to create designs that look good on all phones. But you have to realize that - like a website designed in a browser - you do not and can not have 100% control over how things are displayed on every single device. What you need to achieve is that it is still accessible and good-looking even when displayed on a device that you did not anticipate beforehand.
You have to name the drawable as per your pixel density and the screen size. The calculation is here...
dpi = sqrt (540^2+960^2) / 4.3"(Device size) = ~256 dp = px / (dpi / 160) = 540 / (dpi / 160) = 330
The drawable will be named as drawable-sw330dp. I have tested this. And this works good. No problem with other drawables either. Layout Will be layout-sw330dp
Or you can try this by drawable-sw540p. I haven't tested it yet. But I guess it will work good. Layout Will be layout-sw540p
I developed and application and uploaded all the images in the respective drawable folders (different pixels for different desnities).
Now I am confused when it comes to layout. If I used the layout editor with 4.1 inc (thats considered Med screen I guess?) everything looks great.
Now when I use the editor with 10.1 inch which is the tablet, then I see icons very small and the text is small. I have not run the emulator yet.
So I am wondering:
1- why would the text be small although I didn't specify text size? Shouldnt scalle appropriately? or should I give it a specific size for bigger layouts?
2- Why the icons are small given that I provided the different drawables? I thought it would scale up accordingly.
Please don't give me the supporting multiple screens link in android as an answer, as I already went through it and still no luck with above. I need your personal advice as I think I am missing something here
Thank you so much in advance
Android support for different screens is a little tricky. That's because you can have large, small, medium and xlarge screens, plus high, medium and low density ones. There are a dozen possibilities (xlarge low density, small high density) and not a single resolution is defined. So you must know the principles which the API is designed upon and must define your layout thinking about the role the widget has inside your UI. You also must bear in mind that your layout won't be pixel perfect on 100% of devices, so your aim should be being usable on all possible devices.
In your specific case it seems that either you don't manage to specify the correct resources, or the system doesn't pick up the right ones for you, but I must remark that it doesn't make sense on Android to talk about big, small and scale: you should design your layout with a (good) webdeveloper mindset, who daily deals with tons of different displays, resolutions, physical sizes and even devices.
I also suggest not using the graphical builder if you are new to Android, because you really need to know how Android lays out components, otherwise you will come back to SO very often :)
If you do not specify the text size in your layout file Android will take the default value, which is most likely in DIP (density independent pixel) therefore it will be the same physical size on any devices. That should explain why the text looks so small on your 10 inch tablet.
What I would do in this case is have 3 layouts for each activities and specify the text size for larger devices (given you already like the look on phones) and put them in this folder scheme :
res/layout/layout.xml // phones
res/layout-sw600dp/layout.xml // 7” tablets
res/layout-sw720dp/layout.xml // 10” tablets
Information above was taken in this article. I have this applied in my current personal project and so far it works like a charm.
Secondly, as far as icons go, I'm no drawable expert but if you provided the same file in each folder (like I think you did from what I understand in your question), it will not make it scale. You'll have to create 4 difference icons, one for each possible pixel density.
Information about icon sizes can be found on this page.
Hope this is of some help to you.
My experience with the Android device zoo drew me to the sad conclusion that the built-in screen size/layout facility is useless. Cases in point, straight from support:
a 10 inch tablet with Android 2.2. Screen size xlarge is not supported by Android 2.2
Kindle Fire, which is 7 inch and claims it's xlarge.
I ended up putting all three layouts (med/large/xlarge) into layout, loading one based on run-time density and resolution, and providing an option for user to force a specific layout.
Just sayin'.
I'm a graphic designer and am designing an android app for a client for the first time. Currently my comps are 1280x752 pixels (found these dimensions here: http://www.smashingmagazine.com/2011/08/09/designing-for-android-tablets/) for a 10" tab, however I can't find out what the dimensions should be for the 7" tab?? The client wants to see some of the comps sized down to the 7" size.
I've read through the android developer app and everything is in "mdpi". is that the same as dpi?
Thank you for any assistance!
Android screen design is no straight forward process like for the IPhone for example. Android devices can come in (almost) all densities (XHDPI, HDPI, MDPI, LDPI) and Sizes.
You have to understand the principles of android screen-layouts to understand how to design apps for android. This documentation is a good starting point, also the Android Design Page has a lot to offer.
Or talk directly to the developer which has to turn your design into code - what resolutions does he need etc.