Android layout folder name for Nexus 5 mobile - android

I want to design an android layout for nexus 5 mobile and need to give a fixed width/height. After searching with many websites I have used the layout folder named as "layout-normal-xxhdi". It works perfectly for nexus 5 but unfortunately it will affect other mobiles. Ex) I tried with moto e it also takes the layout file from "res/layout-normal-xxhdpi.xml" folder. Please someone give the exact layout folder name for nexus5.
My layout folders,
res/layout.xml
res/layout-normal-xxhdpi.xml
Note:
For other mobiles it will need to take the layout file from "res/layout.xml"

You cannot do this with folder name. But you could try to recognize the device model (here Nexus 5) in your Java code and use the appropriate layout. To do that, you could use Build.MODEL.

Testing in AS v1.5 using the default Nexus 5 emulator (selected replicate device during creation), you can almost specifically target Nexus 5's specs using the "sw384dp-xxhdpi" folder name.

Related

Android Device compatibility issue in Normal Device

i am suffering from last few days but i am not getting any perfect answer for that
android developer website
i
and apart from that i am also study lot of website but most of the website say's use dimen and used it for
small
normal
large
and x-large
but it is not giving me the perfect solution because most of the device which i am testing they all target normal dime such like that device start from 3.7 to 5 inch and because of that my card get moved up according to device i want the perfect appearance on each device there is a image attached to it
actually i want the perfect apperance on each device i found one method which is work fine to make a dimens xml according to the dimension of screen but it is not reliable i have to make more then 25 xml and if another device will come i have to make for these also this is image Url
If you want to support all devices then I think under my opinion You need make a check up on several points. These points are given below:
first you should make it sure that you are using right sizes in all drawable bucket. I am saying this because I think You are looking it perfect in some device but not looking good in other devices.
Do not make multiple xmls it is deprecated.
TO give margins for all devices you need to make different values folder or Dimens folder for different devices.
This is new way of supporting multiple devices , multiple xml is deprecated.
Here I am posting 2 links , this and this , check them out. I think that this is good for you to learn , just give it a try. And Up vote if this helps.

create values folder for specific android device samsung gt s5303

I have an application that works fine in almost devices but the only device that fail is samsung gt s5303, I want to add a different value folder just for that device and add to it my dim file , I have tried to add values-sw320dp , but I found that it make other devices read from the same values folder
so how can I solve this problem please
This is the full specs. of the device
http://www.gsmarena.com/samsung_galaxy_y_plus_s5303-5357.php

Issues with Android Alternative Layouts in Xamarin Studio

I'm nearly flipping out. I'm trying to develop an app for several devices. The app should nearly look the same on all devices. I tried to create the layout like this:
first i created the layout in the standard layout folder for an Samsung Galaxy S Plus device
as that's the only hardware device I have
the layout looks nice on the device
after that I took one layout file and switched through the available virtual devices such as 2.7in QVGA...5.4in FWVGA...7in WSVGA...
everytime when a switched the virtual device and the layout doesn´t look good I set the lock on qualifiers Smallest screen width and Screen size
I make the changes so that the layout looks good for that specific virtual device and saved it.
Xamarin creates an new folder like layout-sw480dp-large. In that folder I can see the recently changed file
I have done this for all layout files in the standard layout folder and for all virtual devices.
back in the standard layout folder I check all layout files with all devices. everything looks great.
I have tested the app on a Samsung Galaxy S3 and the layout looks awful, textviews are not in the right place, image views are not in the right place etc.
so back in Xamarin studio I checked all layout folders and each file. For example, in the folder layout-sw480dp-xlarge the layoutfile doesn't look good.
I changed that file but then something weird happened: all files with the same name lying in a layout folder containing the qualifier xlarge are changed too (see the screenshot).
I thought that changes in a layout folder don't cause changes in other folders. Is this a bug of Xamarin?
So I have 3 questions:
Is this weird behavoir of changing layoutfiles a bug of xamarin?
what is the best way to create layouts for different devices (please practical advises, i know the site of supporting multiple screens)
how can i create layout for Samsung S3 with Xamarin, how can i create a virtual device in xamarin which emulates the Samsung S3
Thank you very much.
i have informed xamarin about this issue. [link] (https://bugzilla.xamarin.com/show_bug.cgi?id=13705).
The way i create layouts for several devices:
Create the layouts for in standard layout folder (i take a normal mdpi device)
when all layouts were created i copy them to another folder outside xamarin and rename .axml to .xml
i use eclipse to create alternative layouts in their specific folders
rename all files inside alternative layout folder from .xml to .axml
in xamarin studio create alternative layout folders and import specific files
run and test them on real hardware devices
this works for me.
If you open axml file in Xamarin Studio, you'll find two options graphical representation/ scrip. You can switch between layouts by changing alternate layouts, switching available near top left corner of axml file.
For custom virtual device creation set same configuration as device which you want and create AVD

How to load right layout in emulator?

I have two folder res/layout and res/layout-sw600dp. When I try to run my app in Tablet Emulator 7 inch (1024x600) I see on screen layout from res/layout. How to see another layout for tablet from layout-sw600dp in Emulator?
Double click the layout you want to open or choose a different setting from the drop down menus and the relevant layout will be loaded. e.g Nexus One, Nexus S etc
Add a custom layout in this menu if the defaults do not suit your devices.
To see these layouts at runtime you need to run your app on a device\emulator that matches the layout settings.
To be able to see both layouts, you will need to use different Android Virtual Devices (AVD's), or in other words, a different Emulator. The android documentation has a page dedicated to managing AVD's.
The android development team has provided a tool that you use to create AVD's called AVD Manager. I believe that you have used it, because to be on an emulator means that you have already created one!
You can find it in Eclipse in the following location:
Window -> AVD Manager
To actually see the different layouts between the different emulators, you will need to configure them differently, to accurately represent the device you want to target. You should be able to tweak the Hardware options to make your emulators behave differently. You can find a list of hardware options here.

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