What's the difference between layout-large-v11 and layout-xlarge - android

I'm working on a Tablet application.
What's the difference between this two res folders: layout-large-v11 and layout-xlarge?
The first option is from the IOSched app.
Are both valid for tablets? Which one is better for design tablets layouts?
Many thanks for the help.

v11 is there to help distinguish between large devices that are still running older versions of android. This distinguishing is necessary because there were some big changes at Android 3.0 (version 11 of the api), in terms of style. So the v11 allows you to say "Ok, if this is a newer version of android, use this newer style of layout, other wise use this older style".
Bottom line, you only need to use it if you want to provide two different layouts: one for versions of android that are pre-3.0, and one for versions that are post-3.0. v11 actually has nothing to do with the size of the screen itself, merely what version of android you're running on.

Related

different appearance on different phones for Android

We are getting ready to release an app, there is a slight difference in appearance on my development phones a Moto X and Galaxy Nexus, and my clients phones. He has a HTC One S with Android 4.4.4. Are there any websites or tools that I can test the appearance on for different phones? He lives in Brazil and me in Florida, so using his is out.
You should use the Android Virtual Device for this. You can use whatever version of android you would like, there are tons of predefined device sizes/resolutions or if none of those suit your needs you could always define your own.
Are you using Eclipse/ADT as your IDE? If so, the layout editor provides different views for a handful of different devices.
I am having trouble attaching a screen shot, so I will just explain. In the layout editor, you will see drop-down selectors for (a) Device/Screen Type, (b) Orientation, (c) Application Theme, (d) Android API level. This provide reasonable previews of you layouts.

Designing android app for multiple screen sizes

I'm designing an android app with a minimum SDK version of 8. I have currently been testing it on a emulator running an about 4 inch phone...
I recently got a Nexus 7 and ran it on that. I thought it would just enlarge the screen (button and text including) so it was basically magnified... it wasn't
I thoroughly googled it and came up with using different layout sizes (I am using Eclipse by the way) so I made a 'layout-large' folder but I got the following error and no design view of the screen layout would show
'It looks like you are using a render target where the layout library does not support the tvdpi density.
Please try either updating to the latest available version (using the SDK manager), or if no updated version is available for this specific version of Android, try using a more recent render target version.
Exception raised during rendering: Index: 2, Size: 2
Exception details are logged in Window > Show View > Error Log'
How can I solve this? I don't want to change the minimum SDK from 8
The tvdpi seems to have been implemented in Android 3.2 (meaning SDK level 13). If you want to target the Nexus 7 displays, with alternate resources, I suggest targeting large screens instead of tvdpi. You shouldn't have to change your minimum requirement of SDK level 8 as it doesn't make sense to target TV densities when aiming for Nexus 7, but maybe that's just me.
There is another similar question here on Stackoverflow with a great answer: How to create different layout for Galaxy S3 and Nexus 7?
Also visit the Android developers design guidelines and specifically Designing for Multiple Screens for more information. The Android guidlines is a very good website that I use consistently.
First thing first, there is great information at developer.android.com about programming for different screen sizes. Fragments are great for this. Did you get rid of the 'layout' folder. It sounds from your question you just renamed the layout folder. I would start by reading at a lot at the Android developer information center. Check the first link.

Combine Layout files for multiple version numbers

All I have a different layout files for different versions of android like layout-v13 , but I noticed that the files are the same for newer versions of android (API 11-16). Is there a way to group them together as something like layout-v11,12,13,14,15,16? Thanks for your time!
If what you're trying to do is show a different layout depending on which API version is available on the device, you want to use configuration qualifiers. The specifics for alternative resources are also documented.
The most basic way to do it is to create a layout folder for each API level you want to use, formatted as follows:
res/layout/layout.xml (Default)
res/layout-v4/layout.xml (Android 1.6 and higher)
res/layout-v11/layout.xml (Android 3.0 and higher)
From Android official documentation
In your case layout-v11 this will be used by devices running Android 3.0 Honeycomb and above
layout-v11 will be used by all devices running Android 3.0 and above. You should only break up the folders (i.e. layout-v11, layout-v12, etc.) if devices running the specific version require a different layout.

Program different layouts for different versions in android

I have to program my Android app with the best compatibility to different screen sizes (tablets and smartphones) and to the versions 2.3, 3.2 and 4.0.
I know about the possibliy to name the folders of the layout like res/layout-sw600dp/. to match the layout exactly to different screen sizes.
So, cause I will use completely different layouts for Tablets / Smartphones, I would start with a "Load Screen", which tests which Android-version is used and if there is used a tablet-or smartphone-device, cause for example in the layout for the Tablet, there will be Buttons on some screens that won't be there on the smartphone.
So I will have to separate all this in packages, like this:
Common
2.3
Tablet
Smartphone
3.2
Tablet
Smartphone
4.0
Tablet
Smartphone
I would choose this separation, cause it's the best way, in my opinion, to be prepared for upcoming *updates*, if, let's say there should be added a Button in the ToolBar in Android 4.0.
Is this separation a good thing in your opinion or is this a complete overload?
Are there any other new features in 4.0 that I should be aware of?
You can also name your resource folders to indicate version number (like /res/layout-v11) or (/res/values-v13)
Regarding your question about separation - it really depends on your particular requirement. A common approach to this problem is a fall-back mechanism: You provide a few specific layouts (for example, an xlarge landscape v11 layout), and a few generic ones to fall back to.
Of course, this is an "idealistic" solution; and it doesn't always work that way. In other words, it is mighty difficult to practically implement an app that is compatible with so many versions of Android solely by providing alternative resources. Even if you use the compatibility libraries (which helps a bit in reducing version-specific code); you will still have to adapt your code based on the version at run-time.
You can find out the Android version looking at Build.VERSION.
The documentation recommends you check Build.VERSION.SDK_INT against the values in Build.VERSION_CODES.
And based on that version you can set your layouts in if else conditions

Android phone and Tablet problem

I know this is not a technical related question.But i do not have any idea.I am going to develop a project which should be supported in both phone and tablet.Is it possible having one project working for both tablet and phone ?
Yes. The only thing you need to keep in mind where you keep your graphics. Because it will cause different problems if you do not treat and handle them depending on the screen size. Only thing matters is the android version. If you deploy your app in any phone or a tablet where the version is newer or equal to the target version it works. But of course you cant take a call or some other mobile functionality from a tablet if its not supporting that features.
You can use drawable-hdpi,drawable-mdpi and drawable-ldpi for the graphics(images which use in project) and also use layout with multiple screen by custom layout like layout-480x320 , layout-600x1024 etc. in layout you can custom screen xml file.

Categories

Resources