I'd like my app to work on phones (320x480 usually) and tablets (840x600, 800x600 and 1024x600).
I'm not sure which resolution to design for and how it would scale on various devices. Can anyone please suggest what resolution and dpi should I use?
Discussing this with Tim Bray in a conference he said:
You should design for the biggest resolution and the higher dpi and then scale to the smaller ones.
Right now I think that tablet version requieres a different layout with different UX. For instance I would try using Fragments on the tablet version of my app.
Have a look at this resource:
Supporting Multiple Screens
Android handles different screen resolutions automatically in that you specify sizes in "dip" (device independent pixels) and by providing different drawable folders (drawable-hdpi, drawable-mdpi, drawable-ldpi) where drawables are fetched depending on the resolution capabilities of the device your app is running on.
If you want to target tablets specifically, then I'd start coding for the Honeycomb system. Devices will be available soon ;) The SDK is already available on the developer.android.com site.
Recently i developed a android app its in the market by name Starrpartners in this i use the design of 320x480 as a target and putting the images in mdpi folder. it worked pretty well on higher resolution as well .
You can check it by making your app and running it on different resolution simulator .
Hope it helps :)
Related
I’m new to Android programming and I’m stuck with a very specific problem. I want my application to run on multiple screen sizes and densities.
I have several real devices with different screen resolutions (Samsung Galaxy S7 Edge [xxxhdpi], Samsung Galaxy A5(6) [xxhdpi], Samsung Galaxy Note 10.1 tablet [xhdpi].
I made one background and scaled it down for every generalized density. I saved the files as “background.png” in separate folders like suggested in Supporting Multiple Screens.
After testing the APK on the devices, everything worked fine except the background on the S7. It will always load the next lower resolution bitmap (xxhdpi instead of xxxhdpi). I looked countless threads how to fix this problem but nothing worked so far.
The resolutions of my bitmaps are:
drawable-mdpi //320x480
drawable-hdpi //480x800
drawable-xhdpi //720x1280
drawable-xxhdpi //1080X1920
drawable-xxxhdpi //1440X2560
I hope that someone can help me on this one. I’m really losing my mind.
This is a little complex but I'll try to keep it simple. The android system chooses the right resources based on a lot of factors (which you can see when you create a new resource file under the "Available qualifiers" list) which you can group to create a resource shared by different configurations or use only one of them to specify one particular configuration. But you cannot control witch resource the device will use for the most part (there are some you can specify yourself ex: night mode). Your S7 probably uses the wrong resource because probably one of the settings for the display resolution is set at a lower setting (ex: battery saving modes lower resolution, gaming mode.. etc, accessibility settings). And if you want a tablet to use a different drawable then a phone then you should use the "smallest screen width" qualifier since you can specify different screen sizes in Dip(ex: sw320dp is a normal phone, sw440dp is a big pixel phone, sw720dp is a medium tablet and sw1048dp is a bigger tablet). Read more here
I'm also facing like this. My app only works on high resolution mobile only. Then I found that error. I placed my drawable on drawable-hdpi only . For every assets we have to place default drawable in drawable folder
put default drawable in that folder.
drawable
For handling images on the s7 device we can give height and width to the image view. Set the values for height and width from the dimens file. For handling s7 UI need to add the dimens-sw411 file and specify the height and width in that.
Im just made my first little app on android.
I've been using the Android Studio for developing which is quite good but the problem is that the app I designed fits only a 5.5" display. On other devices its just very small or larger. I don't know how to make it autosize according to the size of the device.
Is there any way to fix it or is there any way to make different Apks for different mobiles (according to the display sizes)
PS: there isn't any picture in the app. Just writing and calculations. Kind of Calculator for beginners(ME). :)
If you dont have any images on your app, set your layouts and views width (when needed) to 'match_parent' instead of 'wrap_content' or a fixed size.
Set the parent layouts height to 'match_parent' and if you have a background that fits all the screen, set this too.
Check this for reference of LayoutParams values: http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html
If you want to add images Go to http://developer.android.com/guide/practices/screens_support.html and try to understand all the concepts of densities independence and supporting multiple devices.
Hi I'm developing an android application and I'm having trouble with the layout on nexus phones and tablets as they are very high resolution. I don't know which layout folder would be applicable to best match nexus 5, nexus 7, etc as they both have different screen sizes but very similar resolution. Can anyone give opinion to achieve this? I know probably I'll be needing different folders for the different phones (nexus 5 and nexus 7 to name a couple) but can't figure out the best ones to use. Thanks
Here are some numbers for typical screen widths:
320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
Refer guide
And also:
For nexus 7
layout-large-hdpi
For nexus 10
layout-xlarge-xhdpi
I think you can use folder : layout-normal-land for landscape and layout-normal-port for portrait.
Its all here, if you just read the whole article it'll fixe your problem, ive been dealing with this before and this article helped me. Hope it helps you.
I would like to ask if I'm developing a 4 inch based app device and has a 100x100 px image button, what would be my dynamic images to be placed on the drawables? xhdpi, hdpi, mdpi,ldpi and so on to make it responsive every time it is installed on different devices.
Did you checked out the related best practices for Multiple Screen supports from developer.android.com. It explains nicely how to make layouts fully responsive
Read this article thoroughly and you will get what you want.
I'm using the Canvas and the SurfaceView. I've explicitly mentioned the coordinates for various objects and fonts on the screen. The app runs perfectly on Samsung Galaxy S Advance but the objects are out of scope on smaller screens such as that of Samsung Galaxy Fit or Pop. How do i make it compatible for all screen sizes and pixel densities.
Using dpis seems out of the question as I'm not using any xml layouts.
Thanks in advance.
I think you should get screen resolution at run time and set pixels according to that.
According to the developer guidelines it is discouraged to do so (work with explicit coordinates). Please refer to the android design guidelines for how to do it better. If you cannot avoid it, you'll need to take into account the screen size and density and compute your coordinates accordingly.