-3

I am new to android development, i want to load image from either internal storage/pictures/forldername or sdcard/pictures/foldername with swipe feature as galley. All images should be displayed as swipes. Can I havae an example of some what.

Thanks in Advance

SahSantoshh
  • 73
  • 2
  • 12

2 Answers2

1

You can start creating a example of your attempts. You can start creating a ImageView and load into app.

To load the image insert into your code:

private Bitmap getImage(String imageName) {
    File root = Environment.getExternalStorageDirectory();
    return BitmapFactory.decodeFile(root+"/pictures/forldername/" + imageName + ".jpg");
}

Into your onCreate, put the picture like:

imageView.setImageBitmap(getImage);

Insert permission in Manifest.xml

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Rodrigo Paixão
  • 246
  • 5
  • 12
0

Use Glide for fast and efficient image loading.

String path =Environment.getExternalStorageDirectory()+"/foder_name/locationtoyourimage.png";

 Glide.with(MainActivity.this)
    .load(path)
    .centerCrop()
    .crossFade()
    .into(myImageView);
Victor
  • 4,171
  • 1
  • 29
  • 37