Office Hours — Today, June 11

Thursday, June 6

Jun 11
7:25 PM
Mark M.
has entered the room
Mark M.
turned on guest access
7:30 PM
Yurii
has entered the room
Mark M.
hello, Yurii
how can I help you today?
Yurii
Hi Mark, how are you?
I'm about to implement new Drawer pattern, and want to ask your advice
should I go with one activity and multiple fragments approach or parent activity ?
Mark M.
IMHO, the nav drawer pattern does not imply one or the other
hence, I would use whatever you would have used without the nav drawer
Yurii
but I want to use drawer to navigate between activity and want it to be available in all activities I will have a lot of code dublication, don't I?
Mark M.
not necessarily
most of the Java code could be in a base class or a helper class
the DrawerLayout definition itself could be driven in part by <include> tags
Yurii
ok let say I have activities A1 and A2 and drawer in fragment Drawer,
Mark M.
moreover, the decision to go with several activities or one activity/several fragments is a MAJOR architectural decision
Yurii
right!!! <include> how could I forgot about this one :) Thank you
7:35 PM
Mark M.
code duplication is one criteria, but not the sole one, or (IMHO) even the primary one
Yurii
what is the primary one in your opinion?
Mark M.
I don't know that I can name one primary one
navigation flows (e.g., how the BACK button works), entry points (e.g., what <intent-filter> elements you need), memory management (one fat activity?) all play a part
Yurii
thanks, another question, have you seen https://github.com/coocood/VContentProvider ?
Mark M.
I think I clicked on that link before, but I have never downloaded or used it
Yurii
is there any easy way to create ContentProvider? except standard one?
Mark M.
I do not know what you mean by "standard one"
Yurii
one by documentation
Mark M.
since I avoid content providers wherever possible, I have not researched third-party code to try to simplify their creation
7:40 PM
Yurii
how do you prefer have UI update? implementing Observer by hand?
Mark M.
I am a fan of the event bus approach: Otto, greenrobot's EventBus, LocalBroadcastManager, etc.
you could call that "implementing Observer by hand"
Yurii
what is your opinion on Volley?
Mark M.
it is undocumented and unsupported
otherwise, it's cool
of the current cool HTTP wrappers, I'd lean towards Retrofit and Picasso if they fit your needs
7:45 PM
Mark M.
but if you have HTTP operations that aren't images and aren't Retrofit-compatible REST, Volley is worth considering
I expect to cover all of these in a chapter in the book in the next few months
Yurii
that is great news, will wait for that. Another question will be on encryption
I haven't read encryption chapter in book yet, but I can see that there is openFile()m so basically I will be able to encrypt all the date and serv it unencrypted state to "Video Player" and Doc reader?
Mark M.
do you mean from a ContentProvider?
Yurii
yes
Mark M.
then for a document, that is very possible
7:50 PM
Mark M.
while I do not do encryption, I show how to serve up streams via pipes and openFile()
it's one of the few things I like about ContentProvider...
however, video is a problem, because video players need to traverse forwards and backwards
and ContentProvider-supplied streams are forward-only
hence, I'll be surprised if you can get video playback to work
even audio won't work for all codecs
Yurii
so basically only device encryption can provider that workflow?
*provide
Mark M.
I am sorry, but I do not understand your question
Yurii
for example I've got video file from back-end, encrypted it and stored in file system
Mark M.
I have no idea how to handle that scenario
sorry
Yurii
now I want to play it to user, user will have to w8 till whole 50mb file will be decrypted before playing?
no worries, you already helped a lot, Thank you for such a great book.
Mark M.
I am glad that you like it!
Yurii
do you plan release a paper version? I'd be happy to have one on my table
Mark M.
at over 2300 pages, it's a bit impractical to print
moreover, it is not very cost-effective to print, either
however, there is no DRM on the book, so you are welcome to print it out yourself
7:55 PM
Mark M.
just don't tell any trees that you're doing it, or they might get mad
:-)
Yurii
:)
looks like I will stack with PDF format
it is just search takes a while in the PDF format.
Mark M.
search will be slower in print :-)
if I am lucky, I will get time in July to update the APK edition with a full-text index for rapid keyword searching
Yurii
View paste
couldn't agree more :)
Thank you for chat. Have to get back to work. Cheers
that will be terrific
8:00 PM
Yurii
has left the room
8:30 PM
Mark M.
turned off guest access

Thursday, June 6

 

Office Hours

People in this transcript

  • Mark Murphy
  • Yurii