Hi Jens

On Tuesday, September 9, 2014 3:01:59 PM UTC-4, Jens Alfke wrote:
>
>
> On Sep 9, 2014, at 11:44 AM, Suresh Joshi <[email protected] <javascript:>> 
> wrote:
>
> Hi all, I noticed in iOS, there is a contentUrl for an attachment and 
> there doesn't seem to be a publicly used analogy in the Android world. In 
> the CBL code, I see there is a database table used to store the attachment 
> blob location with the SHA-1 key, but it's not publicly accessible. 
>
>
> Yes, and I don't recall the reason that the URL accessor wasn't made part 
> of the cross-platform API. I *think* it was because there are Cocoa APIs 
> for media playback that require a file path for streaming.
>
>  

>  I want to use Picasso to load these images and handle all my caching, but 
> Picasso and OkHttp require a URL to hit with cache-control values set.
>
>
> I don't develop for Android so I don't know what Picasso or OkHttp are. 
> Are these for downloading over HTTP? The attachments in your local database 
> are already on the filesystem so they don't need to be downloaded.
>

Picasso is an image loading/smart caching library (something like 
FastImageCache for iOS). OkHttp is a HTTP protocol library, that Picasso 
uses internally. I'm trying to override OkHttp to point at the filesystem 
instead of a web URL (there aren't too many other ways to customize how 
Picasso works)


> I wanted to write a custom 'downloader' for Picasso, where I would just 
> pull an inputSteam from a file pointer
>
>
> There's already an Attachment method to get an InputStream; will that do?
>

I tried doing something like this in the past, however, it means having my 
HTTP protocol know about my Couchbase database, and I was having dependency 
injection issues with this, because of how the rest of the app is set-up. I 
could probably hack something together again, but it really is a hack. 
That's why I wanted to go the route of pulling file blobs, as I think that 
would be a lot cleaner in the app's sense (this all stems from having to 
alter several 3rd party libraries, and trying to stay within each's 
paradigms).
 

>
> —Jens
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/af669b21-7eac-43cc-86fc-68235903465f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to