Office Hours — Today, February 18

Friday, February 14

Feb 18
3:50 PM
Mark M.
has entered the room
Mark M.
turned on guest access
3:55 PM
EGHDK
has entered the room
Mark M.
hello, EGHDK
how can I help you today?
4:00 PM
EGHDK
A couple of questions I've jotted down from reading your book other java books.
First, is I'm extremely confused anytime I say anything like AlertDialog.Builder builder = new...
Mark M.
um, could you be more specific?
confused about what?
EGHDK
I'm unsure of why it's not just AlertDialogBuilder builder = new...
Anytime a class name has a . I get confused.
Mark M.
because there is no class named AlertDialogBuilder
EGHDK
I feel like I'm missing something. It doesn't make sense of why it has a dot.
Mark M.
AlertDialog.Builder refers to the Builder static inner class of AlertDialog
EGHDK
It didn't make sense to me because I looked up android docs on AlertDialog.Builder. and it seems to be its own class.
View paste
public static class
AlertDialog.Builder
extends Object
Mark M.
it is a static inner class of AlertDialog
EGHDK
But what you're saying is that Builder is inside of AlertDialog?
Mark M.
yes
EGHDK
okay.
Interesting.
I knew you could do that, but I didn't know that it was a convention.
I don't see why google didn't decide to just make an AlertDialogBuilder class.
4:05 PM
Mark M.
fewer .java files
EGHDK
hm... ill take your word for it. Makes sense.
Mark M.
syntactically, other than the dot, there is no substantive difference between a static inner class and a separate Java class
different developers use different styles
some might have gone with AlertDialogBuilder
not everyone codes the same way
EGHDK
Gotcha.
Okay. That makes sense now. Thanks
My second question comes from your book, and the @Override annotation.
You said that this indicates that methods are implementing a java interface, rather than truly overriding a superclass method.
Mark M.
no
it is used for both
however, the implementing-an-interface usage was added in Java 6
Eclipse used to default developers to code validation for Java 5 (or 1.5, depending on what numbering scheme you like)
4:10 PM
Mark M.
which is why I have to point out to make sure that you are set to Java 6
EGHDK
Okay. Got it.
Mark M.
Eclipse should be more sensible nowadays
EGHDK
There seems to be a problem with two spots in your book. I believe they contradict each other, but I'm not sure. Maybe I'm reading it wrong.
1. "By default, your application will not support small screens..." then later in the book you say 2. "We will add a <supports-screens> element to keep our application off "small" screen devices"
Mark M.
where is the first quote?
EGHDK
Erm. I dont have the exact page number. I have it running on my kindle.
Mark M.
give me a section heading or something
EGHDK
It's in the begining.
"Supporting Multiple Screens"
3% into your book (According to Amazon... heh)
Mark M.
yeah, I will need to think through that
4:15 PM
Mark M.
I may have been referring to some defaults from long ago that are no longer in place
the second one is correct
well, rephrase that
the second one is correct for its location and purpose
yeah, the first one is wrong, android:smallScreens is true by default
I'll tighten that up for the next release
which, since Version 5.6 was released a couple of hours ago, the next release will be in about a month
4:20 PM
EGHDK
Got it. Thanks
4:25 PM
EGHDK
That's all for today for me.
Mark M.
OK
5:00 PM
Mark M.
that's a wrap for today's chat
the next one is Thursday at 7:30pm US Eastern Time
the transcript for this one will be available on http://commonsware.com/office-hours/ shortly
have a pleasant day!
EGHDK
has left the room
Mark M.
turned off guest access

Friday, February 14

 

Office Hours

People in this transcript

  • EGHDK
  • Mark Murphy