• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Reading image from private area

 
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 deol
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
reply
    Bookmark Topic Watch Topic
  • New Topic