Office Hours — Today, October 7

Yesterday, October 6

Oct 7
3:50 PM
Mark M.
has entered the room
3:55 PM
Mark M.
turned on guest access
4:35 PM
Chandra S.
has entered the room
Mark M.
hello, Chandra!
how can I help you today?
Chandra S.
Hi Mark
If we use the layout_weight, must we change the height/width to 0dp?
Mark M.
"must" is a strong term :-)
4:40 PM
Mark M.
if your objective is to distribute purely based on weight, then yes, you set that axis' dimension to 0dp
if you want to distribute space based on something else first (e.g., wrap_content), and handle excess space via weight, you can do that too
Chandra S.
What happened if we keep the axis to non-zero and set the layout_weight?
Mark M.
if the sum of the axis' sizes is less than the available space, the rest is apportioned via weight
if the sum of the axis' sizes is greater than the available space, I think the weight is used to try to shrink the sizes to fit, though it has been years since I tried this
Chandra S.
Ah, I see, thanks, Mark
Actually I'm following udacity tutorial
In a custom adapter, in the getView method, its method is to catch the null value of the convertView
line 50-52
Is this the same as calling super method as in your book?
Mark M.
not precisely
4:45 PM
Mark M.
calling super inflates the layout if needed, the same as those lines
super.getView() also fills in the one TextView with toString() of your model object
in many cases, this is not desired, in which case, you use code like what you showed
though I strongly recommend getLayoutInflater() over LayoutInflater.from()
Chandra S.
Got it
I'm trying to create like a file explorer app
I'm installing ES File Explorer and it needed superuser. Did the normal permission not enough for a normal file explorer?
Mark M.
you can only explore files that you can access
with root, you can explore everything
4:50 PM
Chandra S.
So, something like 'dir' operation can not be done without root?
Or what is the limitation of files that we can access? Is it from 'public' directory only?
Mark M.
your file explorer has access to external storage
and that's about it, using standard Java file I/O
(e.g., File class)
Chandra S.
Is it the same File library from Java for the normal desktop that's used by Android?
Mark M.
um, in a manner of speaking, yes
Chandra S.
I see, I'll try
I want to ask a honest question :-)
what is the good way to effectively mastering the android development?
I'm trying to create a target to make 1 production app, but when I face a difficulty, I read from stackoverflow, sometimes it's hard to understand
But when I read the specific topic only from your book, it's also confusing if not reading the previous chapter
So I decided to read chapter-to-chapter, but takes long time, and sometimes I get boring
Mark M.
the core chapters (first 800 pages or so) are definitely designed to be read in sequence
4:55 PM
Mark M.
the trails are designed to be read pretty much in any order, with the prerequisites pointed out at the beginning of each chapter
I cannot tell you what it takes to "master" Android development, other than lots of practice
Chandra S.
Topic like RecyclerView came later so sometimes I jumped to specific chapter
Mark M.
assuming that you have read the core chapters, the RecyclerView chapter should be OK in general
some specific samples tie into other stuff (e.g., the samples loading videos to show using a Cursor for the model data)
Chandra S.
I see.. OK, I'll try.. Thanks, Mark :-)
5:00 PM
Mark M.
that's a wrap for today's chat
the transcript will be posted to https://commonsware.com/office-hours/ shortly
the next chat is tomorrow at 7:30pm US Eastern time
have a pleasant day!
Chandra S.
has left the room
Mark M.
turned off guest access

Yesterday, October 6

 

Office Hours

People in this transcript

  • Chandra Siahaan
  • Mark Murphy