Office Hours — Today, March 29

Thursday, March 24

Mar 29
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:05 AM
Smital D.
has entered the room
Mark M.
hello, Smital!
how can I help you today?
Smital D.
Hi Mark
I have a question regarding the type of event we can receive when we use Loader Manager talking with content provider based on the selected query
we do get events but type of events such as [ INSERT / DELETE / UPDATE ] is unknown at that point
Mark M.
correct; you are simply told that the data changed
9:10 AM
Smital D.
yes , is there any changeS I can make to get the type of event
Mark M.
if it is your own ContentProvider, do not use a ContentProvider
or, at least, do not use a ContentObserver and a Loader
instead, use an event bus, and come up with your own events that describe in greater detail what happened
if it is a third-party ContentProvider, including standard ones like the MediaStore, there is nothing that you can do
Smital D.
ah ok . Thanks Mark . I was really writing too much of code and it was becoming messy when i was expecting multiple events in activity
I have another question regarding image loading technique , when we have one activity showing thumbnail views of multiple images and other activity showing detail view with large image. Is it generally good practice to download a single large image and show it in both acitvities [ scaling down in first one and as is in detail activity ]
9:15 AM
Mark M.
probably not, if the user has to sit and wait for the download, as large images may be slow to dowload
there is also the heap consideration: you only want thumbnail-sized Bitmaps loaded in for the thumbnail scenarios, not the full-size images that then ImageView scales down
as you'll run out of heap space quickly that way
now, in a case where you are showing a single thumbnail, and there is a decent chance that the user will do something that will cause you to show a larger rendition of that image,
then maybe it makes sense to load the image once and use it in both places
but in a "gallery" sort of setup, where you have N images, and the user is unlikely to view any one of them in full-size, you are better off downloading thumbnails for the N images, if that's possible
Smital D.
right i missed heap consideration but was more focusing on if i could batch network requests fo these images
*for
Mark M.
that depends a lot on the server
if your server allows the socket connection to stay open a bit (e.g., Keep-Alive, SPDY, HTTP/2), then lots of smaller requests shouldn't be that expensive compared to one larger one
9:20 AM
Mark M.
that being said, I haven't researched this point in detail recently
Smital D.
Thank Mark I will study about it and try to find out more.
9:40 AM
Smital D.
Hi Mark , I am still trying to understand dependency injection and how it helps , i cam across DAGGER which i will study further . But are there any other ways to achieve the same without the fragmework like DAGGER even that means i have to write a lot of code
Mark M.
I am not a dependency injection experts
er, expert
one scenario that I know of where it proves useful is in testing, where you want to be able to inject some sort of mock in place of the real implementation of an object
9:50 AM
Smital D.
ok
What is a window inset of a view ? and under which scenario we might need to take control of that using http://developer.android.com/reference/android/...
Mark M.
sorry, but I have no idea
Smital D.
sure np. just to give you more reference I was studying PLAID app https://github.com/nickbutcher/plaid/blob/maste...
// drawer layout treats fitsSystemWindows specially so we have to handle insets ourselves
10:00 AM
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 Thursday at 7:30pm US Eastern
have a pleasant day!
Smital D.
have a good day !!
Smital D.
has left the room
Mark M.
turned off guest access

Thursday, March 24

 

Office Hours

People in this transcript

  • Mark Murphy
  • Smital D