Search code examples
androidandroid-gallery

How to implement gallery when data(Images and audio path) are coming from server, with swipe on it?


I have implemented gallery which is showing only images right now,but i have to display both images and audio files having swipe option on it.On swipe it has to show next image/audio,all the data(image/audio path) are coming from server.Any example or code is much appreciated. Thank you in advance.


Solution

  • To achieve it :

    1 : Create a simple ViewPager and set adapter which will contain a view and your audio file. -http://developer.android.com/training/animation/screen-slide.html

    1. Use Lazy loading for image and download audio file in your sd-card and show loader on view while its loading.

    -https://github.com/novoda/image-loader

    -https://github.com/wuman/AndroidImageLoader

    If below link is help ful then you can use it.

    https://github.com/Trinea/android-common

    for download audio file :

    http://www.coderzheaven.com/2012/04/29/download-file-android-device-remote-server-custom-progressbar-showing-progress/

    1. After download audio file you can play it.

    2. And please mention a check to download only undownloaded audio.