I would like to create photo gallery in my app. My requirements are:
infinite scrolling (like in Infinite Gallery http://blog.blundell-apps.com/infinite-scrolling-gallery/)
view - like in the picture below - selected photo is visible and on the right there is small part of next photo
pics are dynamically downloaded from server while scrolling - problem is that I don't have ready url list before creating gallery - I only have codename for image, for example:
codename is "photocar",
and url for the images are like:
http://www.MY_SERVER.com/pics/photocar1.png
http://www.MY_SERVER.com/pics/photocar2.png
http://www.MY_SERVER.com/pics/photocar5.png
...
(after codename there is counter). I don't know how much images there is but assume that I want to add max 20 images (if exists), another problem is that image counter is not continuous - I mean sometimes only images 1, 2, 3 exists, but sometimes it may be 3, 5, 10, 19. How to check which ones exists and add them do gallery (I thought about opening HttpURLConnection and checking response code but it's pretty slow)?
images have different sizes and aspect ratio so they have to be cut to aspect ratio around 16:9
What's the best approach?
Related
I have a mobile app which has a screen with list of small images (3x3 grid). Click on image takes user to detail screen, where user can see that image in original size. Now, problem is that, for now, on backend side i only store full sized images (which i know is bad), but when i retrieve images for list i would like to return thumbs for original sized images.
The question is - what is the recommended thumbnail size to return?
Consider that this is an iOS and Android app.
Thanks in advance!
It depends how big you want to show it to the user.
i personally prefer 256X256
I am using "https://code.google.com/p/carousel-layout-android/" in my android application. When it load first time images in carousel are of different sizes, when I scroll all the images till last item, then its images size becomes ok, like center image is big in size and left and right image is bit small in size.
I have a image (resolution 8328x3987). And I want to load that image in my app with zoom controls for better viewing.
As we all know that Android will not load large images directly on device (like in my example). So Android system suggested us to scale down the image to load large images. I have tried this and scale my image upto four times as:
options.inSampleSize = 4;
Using this way my image will displayed on screen, but when I zoom-in the image then this image becomes unreadable (text becomes very blurry), this is because, maybe I scale down the image before showing?
But when I see that image in to device's default gallery app (Android Lollipop, Photos app), then this image looks like a mapview (only visible portion is readable and outside is blurry, and when I move the image then visible area becomes readable) when I zoomed in at max level. So my questions is:
Is Android lollipop added any new way to load large files that looks like mapview?
If not, then do you have an idea how that apps do this or any example?
Reducing the sample size of an image that big will not work at all.(very very bad resolution and memory consumption)
I suggest you to divide image to tiles and recycle the views just like map views do.
This library may help you. Or you can do it your way too.
I have multiple large images and I would like to use these in such a way that it would allow users to do continuous panning. I couldn't stitch all the images into one image as it would give memory limit error. Also I want to compress the images. I believe one option is to place the images in a virtual grid shape and show image based on current viewport & touch position (it might have some issues when switching between images). I was wondering if there is any other easy ways to solve this.
You can split the images into smaller ones and load only the images currently visible on the screen and probably the next one to provide smoothness while panning. So if you have 6000x4000 you may want to automatically split them into 24 images 1000x1000.
I am working on a project related to some image viewer. I get images from some server and display their thumbnail version on screen. I want to show the images in 3 x 2 matrix means 2 images per row and 3 rows. Images can be from 1 to 50. User may click on a particular image, its details are loaded and shown on screen. The problem I am facing is how to create a matrix view and when user click on a particular image, how to identify which image was clicked so that its details can be loaded and displayed...???
Gridview is easy way.Besides with fixed matrix, you can use normal layout.GoodLuck