Mark M. | has entered the room |
Mark M. | turned on guest access |
Jan 27 | 3:55 PM |
Steve | has entered the room |
Steve |
Hi, Mark
|
Mark M. |
hello, Steve!
|
Mark M. |
how can I help you today?
|
Steve |
I have some questions about Pixel Perfect. Here they are:
|
Steve |
View paste
|
Mark M. |
5. No, you cannot modify layouts
|
Steve |
Ok
|
Mark M. |
3. That's up to you. You know what density the emulator is set for, so you need to do the back calculations to derive dp from the px that you see.
|
Jan 27 | 4:00 PM |
Steve |
Ok. Is there anyplace in your book where you talk about how to make those calculations?
|
Mark M. |
um, it's just division
|
Steve |
Ok.
|
Mark M. |
1 dp = 1 px for mdpi screens (~160dpi)
|
Mark M. |
there's documentation outlining the dpi values for the different density buckets, and that should be in the book somewhere as well
|
Steve |
Great.
|
Mark M. |
so, if your emulator is emulating xhdpi (~320dpi), then 1dp = 2px, and so to get dp from px, divide the px by 2
|
Mark M. |
in terms of 1/3/4, I have not used "Pixel Perfect" in ~5 years
|
Mark M. |
other than the occasional light bit of poking around
|
Steve |
Sure. Then let me back up and ask a general question.
|
Steve |
What would you recommend for trying to create layouts that match what a designer has provided?
|
Mark M. |
IMHO, that's somewhat the designer's job
|
Mark M. |
giving you plain screen mockups is tantatmount to useless
|
Mark M. |
er, tantamount
|
Mark M. |
the designer needs to give you rules for sizing, not static imagery
|
Mark M. |
those rules need to take into account screen size and density variations
|
Steve |
That's very helpful. Can you say quickly what a couple of those rules might look like?
|
Steve |
Would they use proportions?
|
Jan 27 | 4:05 PM |
Mark M. |
"this button should be 8dp from the left, 8dp from the top of the row"
|
Mark M. |
"this label should be 8dp from the right side of the button"
|
Eric S. | has entered the room |
Mark M. |
and so on
|
Steve |
I see. Do you know of any tools a designer can use to provide such rules?
|
Mark M. |
for example, the designer might have a Photoshop layer with annotations outlining the rules
|
Steve |
He's using Sketch.
|
Mark M. |
I don't even know what that is, sorry
|
Steve |
Great. This is helpful. I'll speak to the designer about this.
|
Mark M. |
in which case, I would recommend written instructions, using the diagram merely as a reference and a guide to what things should look like, more or less, when the work is done
|
Mark M. |
let me take a question from Eric, and I'll be back with you in a bit
|
Steve |
Thank you. I have an idea of how to proceed.
|
Mark M. |
Eric: your turn! do you have a question?
|
Eric S. |
Hi!
|
Eric S. |
First I just wanted to thank you for the "Stack Overflow Bump" feature - you have answered two of my questions and it's been very helpful
|
Mark M. |
I'm happy to be useful!
|
Eric S. |
I had a quick question about emulators - I was curious what people are mostly using these days
|
Eric S. |
I have started using Genymotion
|
Eric S. |
I know that Intel ships one that Google distributes
|
Eric S. |
But it is incompatible with Docker when i attempt to run it on OSX
|
Mark M. |
Genymotion is fairly popular, though I expect that most developers stick to the one with the Android SDK
|
Eric S. |
Are there any others that I should consider for running locally, that you have seen in use?
|
Eric S. |
Previously I had been using a physical device
|
Mark M. |
not that I can think of off the top of my head, unless you consider android-x86.org to be an emulator
|
Steve | has left the room |
Eric S. |
I have not heard of android-x86.org -- I will check that out
|
Mark M. |
note that the Android SDK emulator is being overhauled for Android Studio 2.0, which may or may not impact your Dockerization
|
Mark M. |
as the name suggests, it's a build of Android that runs on x86
|
Jan 27 | 4:10 PM |
Mark M. |
it's designed to be run from a USB stick or installed on hardware
|
Mark M. |
in principle, you should be able to run it in a VirtualBox or equivalent
|
Eric S. |
Are you doing any development in Android Studio 2.0 now, or would you recommend it's use?
|
Mark M. |
I don't touch pre-release stuff from Google
|
Mark M. |
re-phrase that: I don't touch pre-release tools from Google
|
Eric S. |
OK
|
Mark M. |
my life is complicated enough as is
|
Mark M. |
that being said, there are a fair number of people using it, and I'm not hearing above-average screams of anguish
|
Eric S. |
I'd love to be able to use a fast, integrated, compatible-with-docker emulator, so I will check it out
|
Eric S. |
& let you know at a future Office Hours
|
Mark M. |
if you don't mind my asking: why do you want an emulator to run in Docker?
|
Eric S. |
I use docker to emulate my server as I do development locally on my MacBook Pro
|
Eric S. |
The Android emulator itself need not run in Docker
|
Eric S. |
However
|
Eric S. |
The Intel Emulator is somehow incompatible with Docker
|
Eric S. |
Whereas Genymotion, which requires docker, works just fine
|
Eric S. |
err
|
Eric S. |
Sorry
|
Eric S. |
Intel is incompatible with VirtualBox
|
Eric S. |
Genymotion uses VirtualBox
|
Eric S. |
VirtualBox is also used by Docker
|
Eric S. |
Thus, whatever Android emulator I use needs to play nice with VirtualBox so I can also run docker so I can emulate my server and do proper testing/development
|
Jan 27 | 4:15 PM |
Mark M. |
perhaps things are different on OS X, but your emulator/VirtualBox problems shouldn't be an Intel thing, but just an Android SDK emulator thing, because the Android SDK emulator uses qemu
|
Mark M. |
oh, no, wait
|
Mark M. |
:: continues dusting off unused corner of synapses ::
|
Mark M. |
well, on Linux, I think the problem was qemu/KVM with x86 conflicting with VirtualBox; I suppose that would translate to HAXM on OS X
|
Mark M. |
I would not be surprised if the rules here change with the next-gen emulators coming with Android Studio 2.0, as they said that the emulators emulate multiple cores now, and that might require new qemu bits or something
|
Eric S. |
Yah I'm Googling it now and see chatter on that -- https://software.intel.com/en-us/forums/android...
|
Jan 27 | 4:20 PM |
Eric S. |
I'll checkout Android Studio 2.0 and see how it works
|
Eric S. |
But it sounds like I'm not overlooking any commonly used tools right now
|
Mark M. |
Reto Meier recently posted some stuff on how best to have Android Studio 2.0 alongside another Android Studio installation
|
Mark M. |
but, yes, I am not aware of any other frequently-used emulator-ish thing
|
Eric S. |
Great, thanks so much!
|
Jan 27 | 4:25 PM |
Mark M. |
if you have another question, go right ahead
|
Jan 27 | 4:40 PM |
Eric S. | has left the room |
Jan 27 | 5:00 PM |
Mark M. | turned off guest access |