![]() The counter-intuitive part is realizing that specifying a low density results an image that appears like what you might see in an ultra-hi-res monitor - everything is tiny. Set it to 80, and now you're rocking 2048dp x 1200dp. If instead we use 240, that changes to a meager 683dp x 400 dp, and conversely, if we use 120, we get an impressive 1365 dp x 800 dp. That means if we specify our dpi at 160, the app will believe that the available space is 1024dp x 600dp. Let's take a look at the consequences of using various densities with a screen size of 1024圆00.įirst, keep in mind that dp = px * (160 / dpi) (Duh, I know, but I at first thought the specified DPI would be used mainly to select resources, which indeed it also does.) When you set the DPI, you're setting the other half of the equation that will determine the dimensions in DP of the virtual application space, which the app will use to render itself. That's the tricky part (well, the part I didn't get at first). For this discussion, let's say we're going to use 1024圆00. But it's actually pretty simple.įirst, set the size you want in pixels. That's probably because when I first started this, my mind was not accustomed to the Android way of thinking about things. I'm not sure why, but it took me a little while to grasp this. So how do I use "adb shell wm" effectively?. ![]() Someone please chime in if there's a solution to this. Sometimes it's massive, sometimes it's just missing. Maybe I'm doing it wrong, but for me, the menu bar behaves in bizarre and unpredictable ways. Is there any way to cause the tablet to simulate a phone in terms of what happens to the menu bar during an orientation change?.(And believe me, what you get is the farthest thing possible from pixel-perfect.) I think the main point of using the adb shell wm commands is to test layout, not to see pixel-perfect graphics. Is there any way to make the device render the screen using 1 pixel of the new size to 1 pixel of the physical screen?.I don't think it really applies to a regular phone or tablet. I've found only oblique references to this, but the best I can determine, it's for TVs or other displays where not all of the screen is guaranteed to be usable/visible. Simply press the power button to turn off the screen, adjust the size and density as you like, then power the screen back on, unlock, and you're app will be running properly at the new size and density. The key is to start your app first, then adjust the size and density while already running it. However, you can usually at least unlock the device, which is enough to be useful. Not that I've discovered, and changing the settings seems to have a cumulative effect that will usually royally screw up the home screen until you restart the device. Is there any way to avoid messing up the menu bar when at the home screen?.Then I'll share a few other things I've learned about how to use this effectively. ![]() I will attempt to answer each of the questions I raised in my original post. Okay, I think I figured out enough of this to be useful. I like this device so far, but if I could just get this device simulation stuff working, I'd love it! Thanks in advance for any pointers. I suspect that overscan might be the answer, but when I tried to set it to 0,0,800,480, it permanently hung my system and I had to reset to the factory image to recover.įinally, is there any way to cause the tablet to simulate a phone in terms of what happens to the menu bar during an orientation change? On a tablet, the menu bar goes to new bottom of the screen, but on a phone, it stays where it is. Instead, what seems to happen is the 800x480 screen is stretched so that the longest side just fits on the physical display. Thirdly, is there any way to make the device render the screen using 1 pixel of the new size to 1 pixel of the physical screen? That is to say, if I set the size to 800x480, I'd like to see the new screen take up exactly that much space. Secondly, what does the overscan command do? I can't find any documentation for it anywhere. In fact, even after you reset everything, it's still missing until you restart the device. In portrait mode, only some of the buttons will be present and at the wrong scale, and in landscape mode, the menu bar is completely missing. For the sake of this discussion, let's say I'm trying to simulate a typical phone, running the following: adb shell wm size 800x480įirst, setting the size messes up the menu bar. ![]() I'd like to see if anyone else has encountered/overcome these. However, I've had a few problems making this work. So I bought a Nexus 10 for development and was super excited by the prospect of being able to simulate other devices using the "adb shell wm" command, with its size, density, and overscan subcommands. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |