Oct 27 | 7:20 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Oct 27 | 7:30 PM |
EGHDK | has entered the room |
Mark M. |
hello, EGHDK
|
Mark M. |
how can I help you today?
|
EGHDK |
Two "kinda" big issues I've been having that I would like your input on.
|
Mark M. |
will it be OK if I "kinda" try to answer them? :-)
|
EGHDK |
Hahaha =)
|
EGHDK |
First, so with all of this material design and such theres a big push on imagery. A lot of google apps now how one large image towards the top portion of the screen and then a listView below that.
|
EGHDK |
My question is more on the imageview section of it. How do they decide how tall the image is going to be (is there a guideline I haven't found yet?) and how to include that image if I wanted to include it in my app.
|
Mark M. |
well, I don't use many of the apps you're describing
|
Mark M. |
the height of the image is probably determined in part by graphic design and part by the aspect ratio of the image in question
|
Mark M. |
I do not know what you mean by "how to include that image if I wanted to include it in my app"
|
EGHDK |
Google Play music and stuff has a lot of images at the top third usually of the layout.
|
Mark M. |
I'll take your word for that
|
Oct 27 | 7:35 PM |
EGHDK |
Okay I'll go on to the "include that image" part of the question.
|
EGHDK |
So I do have an app that is doing it right now. The app uses all images that are bundled with the apk.
|
EGHDK |
But I have one image in multiple densities... but it seems like a waste
|
EGHDK |
So I have a picture of mountains, but I have it saved in like 5 different dpis
|
EGHDK |
Okay so I found an example. material design contact book
|
EGHDK | |
EGHDK |
So I want to implement something like that... and I know if I was going to a server to retrieve that image, I would measure the room and request the server to give me back something in that size. But for my app, I want to bundle my image that is being used as the header image.
|
EGHDK |
So in your opinion would it be better to include one high res picture of my mountain landscape to use as the header and scale it appropriately and treat it as an image from online (measure the required size and then resize my highres image to that size?)
|
Mark M. |
I don't really know what constitutes "better"
|
Oct 27 | 7:40 PM |
EGHDK |
I know I'm kind of rambling at this point, but I just don't know what the best way to include high resolution images in my app.
|
Mark M. |
shipping artwork in multiple densities is designed to give quality output on that range of densities
|
Mark M. |
using a single density, regardless of its source, runs the risk of looking poor in various situations, as that image is scaled up and down
|
EGHDK |
Yeah but lets say I set the hieght to be 200 dp, I still don't know the width of the image should be... so I still don't know what resolution to ship anyway.
|
EGHDK |
Lets say I have a button that is 48 x 48dp then I KNOW exactly what resolutions to ship.
|
EGHDK |
for each dpi bucket
|
Mark M. |
you have a photo of a mountain landscape
|
Mark M. |
it was taken at a particular resolution
|
EGHDK |
but for a "header" image or whatever you want to call it, it's tough to decide what resolutions to ship in a particular dpi bucket
|
Mark M. |
it is the same process
|
Mark M. |
back to your photo
|
Mark M. |
somebody owned a camera
|
Mark M. |
they took a picture of some mountains
|
Mark M. |
somewhere, you got that picture
|
Mark M. |
it has a resolution
|
Mark M. |
now, at this point, you have two options:
|
Mark M. |
1. allow Android to do all of the rescaling, taking into account both density and the size of the image that you will wind up needing
|
Mark M. |
2. you provide different scaled images for different densities, and Android only scales to take into account screen size
|
Mark M. |
Android's algorithms for scaling are optimized for things like CPU usage, more so than quality
|
Mark M. |
versus desktop graphics tools, which tend to be optimized for quality
|
Mark M. |
either 1 or 2 is a valid approach
|
Mark M. |
but you will need to do your own testing to see which one gives you results that you like
|
Mark M. |
as only you know what you like
|
EGHDK |
Gotcha. I guess I'll try both and see what works for me.
|
Oct 27 | 7:45 PM |
Mark M. |
but in terms of scaled images for different densities, you apply the same algorithms for a 349 x 304 image as you would a 48 x 48 image
|
EGHDK |
Okay, I guess I will just try it myself.
|
EGHDK |
"Hero images" http://www.google.com/design/spec/style/imagery...
|
EGHDK |
That seems to be what I'm referring to.
|
EGHDK |
They make those apps look so nice, but I'm just afraid trying to include images in my apps will be the end of me.
|
Mark M. |
more generally, "hero elements", as they might not always be an image
|
EGHDK |
Yeah, I feel like I'm going to encounter more and more images though. But okay so that solves my first issue.
|
Oct 27 | 7:50 PM |
EGHDK |
Second issue is that I have a project that is using GCM.
|
EGHDK |
It's in Android studio, so I have two different build flavors. Production and beta.
|
EGHDK |
I set the applicationId in the build.gradle file to two separate package names. com.myapp.prod and com.myapp.beta
|
EGHDK |
Now at the top of the manifest there is a declaration for the package name
|
EGHDK |
I only have one manifest in my src/main
|
EGHDK |
any time I try to change the package name my app complains because it messes with importing R.java.whatever
|
EGHDK |
But for GCM permissions I have to use the proper package name so I'm just kind of lost on how I should do it so that I don't have to change it manually each time.
|
Mark M. |
probably via manifest placeholders
|
Mark M. | |
Mark M. |
I think I may have even used GCM as an example in my manifest merger chapter
|
EGHDK |
Aha. Didn't know about that.
|
Mark M. |
for your permission-related manifest bits, you'd use something like android:name="${applicationId}.C2D_MESSAGE"
|
Oct 27 | 7:55 PM |
Mark M. |
which would pull in your applicationId from Gradle
|
EGHDK |
So what do I do for manifest tag package name?
|
EGHDK |
Because whenever I touch that, my java files complained.
|
Mark M. |
then leave it alone
|
Mark M. |
if you are overriding the applicationId role of the package name in Gradle, then the package name is just for code generation
|
Mark M. |
R and BuildConfig
|
EGHDK |
Hmmm... makes sense I guess.
|
EGHDK |
II liked how in eclipse I could make a member variable or a method private from public and I could see all of the affected java files live in the project directory. It doesn't work like that in Android Studio. Any idea why and if there is a way to make it behave like eclipse in that regard?
|
Mark M. |
no clue
|
Mark M. |
sorry
|
Mark M. |
but I'd check the refactoring context menu and see if there is some sort of "change visibility" option that may give you what you want
|
EGHDK |
Okay. That just about does it for the two issues I ran into today.
|
Oct 27 | 8:00 PM |
EGHDK |
Any other big updates you have left for your book? I'd like to read it once through fully but now that it seems you big pivot is complete I'll start. Any other big changes planned?
|
Mark M. |
that depends on your definition of "big"
|
Mark M. |
Android 5.0 coverage will stream in over the next few updates
|
Mark M. |
that won't affect the core chapters too terribly much
|
EGHDK |
Besides what you usually post as a "changelog" is there any deadsimple way to read what exactly was changed between two versions? Almost like a git diff?
|
Mark M. |
the table of contents shows sections with changes in bold-italic
|
Mark M. |
the prose itself has changebars on the right to show the specific paragraphs/bullets that changed
|
EGHDK |
Okay I'll look into that. I just want to make sure I don't miss anything.
|
Oct 27 | 8:05 PM |
EGHDK |
Some random questions I'll shoot off since no one else is here. Everything done in widgets ends up being rendered in OpenGL?
|
Mark M. |
not really
|
Mark M. |
it is rendered by the GPU
|
Mark M. |
but not using OpenGL
|
EGHDK |
Can using any Orm db library perform queries faster than just plain sql that I can do myself? Kind of tempted to go toward Orm but I'm fine using raw sql statements
|
Mark M. |
by definition, no, as it is doing the same SQL you could do by hand
|
Oct 27 | 8:10 PM |
Mark M. |
so, the optimal hand-rolled SQL is as fast as the ORM, without the ORM overhead
|
Mark M. |
however, not all developers are skilled at creating optimal hand-rolled SQL
|
EGHDK |
Okay. I think that is all for me for right now. Thanks mark. see ya sometime in november!
|
Mark M. |
have a pleasant day!
|
Oct 27 | 8:30 PM |
EGHDK | has left the room |
Mark M. | turned off guest access |