Jun 11 | 7:25 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jun 11 | 7:30 PM |
Yurii | has entered the room |
Mark M. |
hello, Yurii
|
Mark M. |
how can I help you today?
|
Yurii |
Hi Mark, how are you?
|
Yurii |
I'm about to implement new Drawer pattern, and want to ask your advice
|
Yurii |
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
|
Mark M. |
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
|
Mark M. |
most of the Java code could be in a base class or a helper class
|
Mark M. |
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
|
Jun 11 | 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
|
Mark M. |
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
|
Jun 11 | 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.
|
Mark M. |
you could call that "implementing Observer by hand"
|
Yurii |
what is your opinion on Volley?
|
Mark M. |
it is undocumented and unsupported
|
Mark M. |
otherwise, it's cool
|
Mark M. |
of the current cool HTTP wrappers, I'd lean towards Retrofit and Picasso if they fit your needs
|
Jun 11 | 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
|
Mark M. |
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
|
Yurii |
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
|
Jun 11 | 7:50 PM |
Mark M. |
while I do not do encryption, I show how to serve up streams via pipes and openFile()
|
Mark M. |
it's one of the few things I like about ContentProvider...
|
Mark M. |
however, video is a problem, because video players need to traverse forwards and backwards
|
Mark M. |
and ContentProvider-supplied streams are forward-only
|
Mark M. |
hence, I'll be surprised if you can get video playback to work
|
Mark M. |
even audio won't work for all codecs
|
Yurii |
so basically only device encryption can provider that workflow?
|
Yurii |
*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
|
Mark M. |
sorry
|
Yurii |
now I want to play it to user, user will have to w8 till whole 50mb file will be decrypted before playing?
|
Yurii |
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
|
Mark M. |
moreover, it is not very cost-effective to print, either
|
Mark M. |
however, there is no DRM on the book, so you are welcome to print it out yourself
|
Jun 11 | 7:55 PM |
Mark M. |
just don't tell any trees that you're doing it, or they might get mad
|
Mark M. |
:-)
|
Yurii |
:)
|
Yurii |
looks like I will stack with PDF format
|
Yurii |
it is just search takes a while in the PDF format.
|
Mark M. |
search will be slower in print :-)
|
Mark M. |
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 | |
Yurii |
that will be terrific
|
Jun 11 | 8:00 PM |
Yurii | has left the room |
Jun 11 | 8:30 PM |
Mark M. | turned off guest access |