-1

I am trying to make an app that dynamically loads images from my computer to a imageview on a scroll view. i want to make it simillar to instagram (with likes). im using ftp to download the images from my computer.

I need some ideas that will direct me with the code.

Thank you!

eilonmore
  • 69
  • 6

1 Answers1

0

Ok, here is a simple workflow:

  1. Use FTPClient from org.apache.commons.net.ftp package to download file from FTP. The example snippet can be found here
  2. Once you've got input stream, use BitmapFactory.decodeStream to convert it to a Bitmap
  3. After that you can use setImageBitmap method to set the source for the ImageView.
  4. Since ScrollView can have only one children, you can have a following layout structure, for example: ScrollView -> vertical LinearLayout with id = container.
  5. Add all the needed ImageViews to container by calling addView method.
Community
  • 1
  • 1
nikis
  • 11,166
  • 2
  • 35
  • 45