Mar 29 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Mar 29 | 9:05 AM |
Smital D. | has entered the room |
Mark M. |
hello, Smital!
|
Mark M. |
how can I help you today?
|
Smital D. |
Hi Mark
|
Smital D. |
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
|
Smital D. |
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
|
Mar 29 | 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
|
Mark M. |
or, at least, do not use a ContentObserver and a Loader
|
Mark M. |
instead, use an event bus, and come up with your own events that describe in greater detail what happened
|
Mark M. |
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
|
Smital D. |
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 ]
|
Mar 29 | 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
|
Mark M. |
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
|
Mark M. |
as you'll run out of heap space quickly that way
|
Mark M. |
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,
|
Mark M. |
then maybe it makes sense to load the image once and use it in both places
|
Mark M. |
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
|
Smital D. |
*for
|
Mark M. |
that depends a lot on the server
|
Mark M. |
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
|
Mar 29 | 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.
|
Mar 29 | 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
|
Mark M. |
er, expert
|
Mark M. |
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
|
Mar 29 | 9:50 AM |
Smital D. |
ok
|
Smital D. |
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...
|
Smital D. |
// drawer layout treats fitsSystemWindows specially so we have to handle insets ourselves
|
Mar 29 | 10:00 AM |
Mark M. |
that's a wrap for today's chat
|
Mark M. |
the transcript will be posted to https://commonsware.com/office-hours/ shortly
|
Mark M. |
the next chat is Thursday at 7:30pm US Eastern
|
Mark M. |
have a pleasant day!
|
Smital D. |
have a good day !!
|
Smital D. | has left the room |
Mark M. | turned off guest access |