I have an Android app and it has a layout that is duplicated in res->layout folder and in res->layout-xxhdpi. When the device is xxhdpi it uses the second layout and when its other resolution it uses default layout. It works good on real devices.
The problem is when I'm working in Eclipse and I want to change something on default layout. If I change the emulator device (on eclipse ide) to see the render it always open xxhdpi\layout. Is there anyway I could avoid eclipse to open the other layout and render the default layout with the screen I selected. I know if I select a xxhdpi device it must open the second layout but if I select a mpi device I would like to stay on default layout and render it. It is how it works on a real device.
Thanks in advance.
Related
I'm at the moment developing an app for tablets and the app isn't supposed to be available for phones.
When I edit an XML in Android Studio, there's the design preview that shows roughly how the XML will be rendered on the device. By default it's set to show it in a phone device. How do I set this to be a tablet view?
By default, it should have a nexus 5 and an icon at the top. Click on that icon ans a list of devices will appear.In the third listView you will find Nexus 7 where it is a tablet. CHoose one from that listView.
Go to XML EDITOR
Click on Device Editor
Now you will see different type of Device with there Name ,resolution and size
Bottom of the device list you will see Generic Phones and Tablets
In Android Studio, go to Preview - Top Toolbar:
The pixel phone name will let you choose the screen to show in the
Android Studio Preview so, this can be helpful to design the layout
for Tablets.
The second icon, has two options called Landscape and portrait which the first one Landscape will help to design the layout for the purpose.
The second option & important is, Create Tablet Variation which creates few directories for designing the Tablet layout.
There is also an option in the phone icon called Generic phones and Tablets which you might consider using.
A friend of mine (who doesn't have enough reputation to post images) is facing a problem with his emulator. It is not rendering as it should, even though the clicks are where they should be. In order to click on the Back button, he must click down in the black part of the "screen".
He already tried to restart his computer, change monitor resolutions and creating another emulator images.
He uses KDE and is using his NVidia hardware to process graphics.
My answer from this post: Android emulator screen fills up only some fraction part of actual android emulator screen
Best and simplest way to do it on Windows 10:
Close your Android Emulator if it is open
Right-click desktop
Click Display Settings
Set Scale and layout to 100%
Open Android Emulator
Revert your Scale and layout to the (Recommended) percentage
WORKS 100%
You can fix the scaling issue when using the Hardware rendering by simply making windows override the scaling setting. How?, it's very easy. Simply locate the .exe file for the emulator that you are using, (e.g. "qemu-system-armel.exe" for ARM and "qemu-system-x86_64.exe" for x86). To make sure which .exe file, just run the emulator then use task manager to locate the .exe file is running, see the screenshot. locate the .exe file using task manager
In my case it was in this location: "C:\Users[Username]\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe"
Now just right click on the file then click on properties then choose the "Compatibility" tab. Under "Settings" at the bottom, click on "Change high DPI settings". A new window will open. Tick the last checkbox "Override high DPI scaling behavior." under "High DPI scaling override". Then select from the drop down below it "System" (this is very important or it will not make any difference!), see the screenshot below. Now just hit OK and OK. Restart Android Studio and that's it, problem solved :)
I have an Android 7.1 device, and I need something to change my "minimum width". I change that through "Developer mode" options, there I can change that.
The point is that I want to create an app that does that without going every time to options menu, and I just press on a widget and it changed. I want to know if there is any API or function to access and change that option directly from Android Studio....
Thanks for helping!
I dont think that Android Studio is able to interact with device developer options.
But if you need is to test screen layouts with different device screen widths, Android Studio let you visualize screen layout rendering preview ("design" bottom tab of layout editor) and choose different device configurations (device combobox in top of editor) with different min-widths configuration. You can also create your custom configuration.
I've created a custom device with AVD manager and it runs fine on the emulator.
However, when I open a XML layout file and switch to graphical view, in the top of the view I want to select my custom device to view how the layout fits on it.
But my device doesn't appear in the list! And there's no way to select it. All I see is the standard devices: Nexus One, Nexus 7, Galaxy Nexus etc.
Am I missing something?
In the tab where You can choose devices, there must be a category "user". If You have created the device, close eclipse and open it again and it should appear in this category
So I've searched for an answer but found nothing. Basically, whenever I run a simple little menu app for android tablets using the eclipse android emulator 3.0, only about 1/6th of the app is shown (the top center piece, if the tablet is held landscape.) I've done tutorials using the 2.2 emulator and they work just fine, but whenever I launch the 3.0, the app (and only the app - the android home runs fine) just doesn't appear. When I look at it in the main.xml layout folder, the graphical layout shows it exactly the way I want it to appear.
Is this a problem with the emulator? This can't be a common problem, otherwise I'm sure I would have found a solution by now, but there must be some switch or something that I'm not seeing that's making the app appear as if it were running on a phone and not a tablet.
Do you have a low resolution set for your 3.0 AVD? If you run the AVD Manager, what resolution does it show?