Profile

Cover photo
Matthew Bishop
Lives in Salt Lake City, Utah
635 followers|25,154 views
AboutPostsPhotos

Stream

Matthew Bishop

Discussion  - 
 
I installed Android5.1_NXCM_R3.0_MotoX2014 on my XT1095. But now it won't connect to mobile data. Any ideas about what I should do? Also, if there's a better place for me to post about this (Github issue or something?) let me know.
3
Matthew Bishop's profile photoAlexis Zacarias's profile photo
4 comments
 
T-Mobile 4G LTE APN
Nombre: de Tmobile
APN: fast.t-mobile.com
MMSC: http://mms.msg.eng.t-mobile.com/mms/wapenc
MMS Proxy: 216.155.165.50
Servidor: wap.voicestream.com
MCC: 310
MNC: 260
Tipo de APN: default
 ·  Translate
Add a comment...
Have him in circles
635 people
matthew chen's profile photo
Samuel Woods's profile photo
teja hn's profile photo
Cristóbal Morales's profile photo
Evgeny Kazakov's profile photo
kyle lau's profile photo
Tobias Lønnerød Madsen's profile photo
William Sherer's profile photo
Cyber News Alerts's profile photo
 
Merge a fetch & into request?

I was wondering if this is already possible, and if not how difficult it might be to add.

I have an "infinite scrolling" style view pager that shows user profiles. On each profile page is relatively large (say 500x500 pixels on a Nexus 4) image of the user. As the user approaches the end of the already loaded profiles, I make a request for an additional set of profiles. When I receive the additional profiles, I go through and use Picasso to *fetch* the images for all the users I just downloaded.

Then, when the user swipes into the new set of users I use Picasso like normal to load the images *into* a Target. Hopefully they should now be cached either in memory or on disk, so this is fast.

I don't fully understand the internals -- but it seems like if the user gets to new profiles before the fetch has completed, a new request is made instead of piggy backing off of the (probably nearly completed) fetch request.

So my question: is there any way to "merge" the *fetch* and *into* requests so that the prefetching doesn't get dropped on the floor?

By the way, does this question make any sense or is there a better way to achieve what I'm looking for?
1
Jake Wharton's profile photoDimitris Koutsogiorgas's profile photoDandre Allison's profile photoMatthew Bishop's profile photo
5 comments
 
Hi +Dimitris Koutsogiorgas and +Jake Wharton, this might be a little too device / situation specific for you to answer, but the *tl;dr; is that I added logging to OkHttpDownloader and I'm getting results like*:

D/OkHttpDownloader(23322): OkHttpDownloader.load(Uri = http://graph.facebook.com/1212197/picture?height=320&width=320&migration_overrides=%7Boctober_2012%3Atrue%7D)
D/OkHttpDownloader(23322): took 22206 milliseconds
D/OkHttpDownloader(23322): From CACHE 200

This is an image that I prefetched, so basically it's taking 22 seconds to load a 320x320 image from the cache. That seems unusual to me. Plus if for some reason that's hitting the network it's on WiFi so that still seems slow for such a small image.

I wish I could use Traceview to figure out exactly what the problem is -- unfortunately it's manifesting itself on the only device used by my client (a Nexus S). By the way, I don't see the same problem on my Nexus One (which is more than a year older than the Nexus S), so I don't think it's simply device performance related.

I checked out the master branch from Github and added some logging to OkHttpDownloader to see if the problem is in the network, or OkHttp, or somewhere else (i.e my code). Logging code & and example of the problem from the logs I had the client send me:

https://gist.github.com/bishopmatthew/6719532

Notice the java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer) exception? Does that just mean my client is on a really shitty connection? And obviously there are some slow network requests in there:

D/OkHttpDownloader(23322): OkHttpDownloader.load(Uri = https://scontent-b.xx.fbcdn.net/hphotos-frc3/s320x320/827_10151160068811861_387770408_n.jpg)
D/OkHttpDownloader(23322): took 26232 milliseconds
D/OkHttpDownloader(23322): From NETWORK 200

But there's also slow cache calls too, like the first one I showed you or this one:

D/OkHttpDownloader(23322): OkHttpDownloader.load(Uri = http://graph.facebook.com/1526100/picture?height=80&width=80&migration_overrides=%7Boctober_2012%3Atrue%7D)
D/OkHttpDownloader(23322): took 10031 milliseconds
D/OkHttpDownloader(23322): From CACHE 200

Basically -- can I just chalk this up to a slow device and slow network connection or could there be something more happening (especially with the disk cache)?
Add a comment...

Matthew Bishop

Shared publicly  - 
 
One of those great This American Life podcasts. Makes me wanna give them money (again).
Alexis Ohanian originally shared:
 
The more light we can shine on this broken patent system, the better. Software patents suck.
1
Jase Cutler's profile photoJessi Sawyer's profile photoMatthew Bishop's profile photo
4 comments
 
Ha, +Jessi Sawyer , where do you get your non-rage-inducing news? It would be good for my stress levels and blood pressure.
Add a comment...
People
Have him in circles
635 people
matthew chen's profile photo
Samuel Woods's profile photo
teja hn's profile photo
Cristóbal Morales's profile photo
Evgeny Kazakov's profile photo
kyle lau's profile photo
Tobias Lønnerød Madsen's profile photo
William Sherer's profile photo
Cyber News Alerts's profile photo
Basic Information
Gender
Male
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Salt Lake City, Utah
Previously
Nampa, Idaho - Salt Lake City, Utah
Links