Closed aalap03 closed 6 years ago
Hi, are there any ideas about this question or any feedback on this ?
You can get media URL through REST api, but it's not available to the SDK.
I'm still not quite getting what you're trying to do and what the problem is, can you give some simple examples?
So, I am trying to fill a MessagesActivity with Images and texts with pagination (15 msgs at a time), my issue is If I have lots of images and user scrolls too fast then some images gets distorted.
I use glide to populate downloaded Images, I save image file in local directory to avoid multiple downloads of image. It works in normal case but with too many images and fast scrolling It gets tedious to manage inside ViewHolder.
Also, as you mentioned if URL is available via REST call, Can developer make those calls from android client ??
Well, this is how you supposed to do - chat only manages uploading and downloading attached images; caching and fast drawing is your responsibility.
You could make REST calls from Android but this will be insecure - REST calls require your secret key auth.
You should probably rearchitect your approach to media downloading and caching, put more work upfront, preload images before scrolling in etc.
Closing as there is no followup.
Right now in twilio we have
media.download(byteoutputStream, statusListener, progressListener)
method to download image.So, Is there a way we can get the image link instead of bytearraystream with the REST call for already uploaded images in twilio? And we use
download
method when image upload is ongoing ???I asked this because, It seems to get overwhelmed if I have too many images in a chat group and user enters first time and tries to download bytearrays while scrolling through the messages. With already uploaded links, glide can do the work, thus we handle only ongoing uploading images. My back-end colleague said they use image links for web client.