How to create an android image viewer - Part 4 Displaying the image

preview_player
Показать описание

This is part 4 of the android tutorial series about creating an android image viewer using the android local storage framework that was introduced in android lollipop.

For part 4 we show how we can get the bitmap from the uri by using FileDescriptors. And then how to set the bitmap to the ImageView, therefore displaying the image in the application.

Github details:

or you can run this command

In this tutorial we will cover:
- How to open a read only raw descriptor
- How to get a FileDescriptor from a ParcelFileDescriptor
- How to load a bitmap from a FileDescriptor
- How to clean up a ParcelFileDescriptor
- How to set an bitmap to an ImageView

API's covered
- FileDescriptor
- ParcelFileDescriptor

For much more information checkout

The previous tutorials were aimed at beginners to android but over time have been getting more complex as the original camera_intent app has developed.
This tutorial series is more aimed towards the intermediate developers thought for those who have been following the previous tutorial series, feel free to watch this android performance series.

Android studio (1.5) is the editor of choice (IDE) for this tutorial series.

This tutorial series is the start of what I expect to be many so I encourage comments and feedback to improve the quality and viewing experience.
Рекомендации по теме
Комментарии
Автор

Thank you so much, you are legend. I always love tutorial that discuss part to part deeply.

ardihanitya
Автор

thanks you! you help me A LOT! ;)
hope you can make a video about android google map ~!

lance
Автор

does what you tried with bitmap ? Is there a difference between them?

redduckto
Автор

hi Nigel!!! Awesome vids as always... got one quick question how did you create the surround with try/catch in Android Studio at min 5:06

Themusicaligera
Автор

When I tap a thumbnail, Android throws an error message that says: "Unfortunately, Documents has stopped". When I tap "OK", it goes back to a blank main screen. Any thoughts? I'm running Android 4.4.2. . Anybody?

bobboland
Автор

i dont see any image at the end of this part..im clicking but i see white screen
REPLY

ShiRaNo
welcome to shbcf.ru