01-17-2013 10:12 AM
In Android 4.1.2, I use "layout" and "layout-sw600dp" folders to differentiate xml layouts for phones and tablets. However I cannot use that for 2.3.3 as they started supporting such feature from 3.2. And anyways, it doesnt affect as far as android is concerned because there's no tablet out there with Androd 2.3.3.
But BB10 phones and tablets support only 2.3.3 runtime. So is there anyway I can declare different layout for Phones and PlayBooks in a single application project? Otherwise I need to make two different applications one for Phones and One for Tablets. Please let me know what's the best way to support different screen sizes.
Solved! Go to Solution.
01-22-2013 06:59 PM
For the BlackBerry PlayBook tablet, you can use the drawable-mdpi folder, and for BlackBerry 10 devices you can reference the drawable-xhdpi folder.
I think that you will find the following porting guide of use.
I hope that this has adequately addressed your concern.
01-22-2013 07:44 PM
01-23-2013 03:57 AM - edited 01-23-2013 03:58 AM
You can use layout-xlarge for the PlayBook and layout for the phones, just as you would do to support Honeycomb devices and phones in one app.
01-23-2013 09:55 AM
01-31-2013 06:38 PM
01-31-2013 06:47 PM
I think, unlike drawable folder, this layout xmls are not picked according to resolution. It's picked according to screen size. So, BB 10 smartphones pick from layout folder, PlayBooks pick from layout-large or layout-xlarge. May be they reserved xlarge for 10" PlayBook if they release it in future. But now, you can use either layout-large or layout-xlarge for PlayBooks. It works.
01-31-2013 07:22 PM - edited 02-01-2013 09:16 AM
Layouts are picked according to both resolution and size. So you can have a layout-normal-hdpi folder and a layout-large-mdpi folder. Where "large" and "normal" indicate the screen size and hdpi and mdpi indicate the resolution.
So the issue for developers right now is this:
We have to target 4 different divices sizes
Playbook size: 1024 x 600
720 x 1280
720 x 720
Now for unreleased phones we don't exactly know whether these are mdpi, hdpi, xhdpi or what. We also don't know the physical size of them. So we are sort of up a creek for those. For the Z10 and Q10 that have been annouced we know that they are:
Z10: 4.2 inch, 356 ppi, 768 x 1280 display
Q10: 3.1 inch, ~329 ppi, 720 x 720 display
So they are both in the xhdpi category. The size is less clear. Some experimentation is needed. I suspect large for the Z10 and Small for the Q10, but it could be Normal for the Z10 and Small for the Q10 as well. Or Q10 could be Normal sized.
UPDATE: Alpha Dev Simulator is xhdpi-large, but strangely the pixels are showing up as 864x1400 using:
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth(); // deprecated
int height = display.getHeight(); // deprecated
So I'm trying to figure that one out.