Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading image from private area

 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

I am capturing image from camera and saving it to applications private area(not on sdcard).
I want to display those images using Bitmap class.
I know we can do this using InputStream but InputStream is an abstract class.Can we pass BufferedInputStream while calling the function decodeStream().

If you know how to read image from applications private area(not from drawable folder) and displaying it .
Please help me.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chetan,

As already pointed out in one of the other threads, you will have to use standard Java I/O for this. Reading/Writing from/to files is not any different on Android.

Anyways, here is what you can do:
1. Create an abstraction for the file in your application. (Use java.io.File)
2. Open this file in FileInputStream(use appropriate constructor of java.io.FileInputStream)
3. Pass this FileInputStream object to BitmapFactory.decodeStream(FileInputStream); to create a Bitmap.


Hope that helps.
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply ,

I am able to that what you have suggested.
But now i want to draw buttons and image on single screen.
I am able to draw stored image.

Thanks
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chetan dhumane wrote:
.
.
But now i want to draw buttons and image on single screen.
..


[Not sure if this is a question..]
This can be done using XML layouting. Use ImageViews, buttons etc. as per your requirement.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic