aspose file tools*
The moose likes Android and the fly likes Reading image from private area Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Reading image from private area" Watch "Reading image from private area" New topic
Author

Reading image from private area

chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

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.


http://www.androcid.com/
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

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.

[List of FAQs] | [Android FAQ] | [Samuh Varta]
chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

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

Joined: Oct 12, 2008
Posts: 1369
    
    1

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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading image from private area