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

Capture image using android emulator

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

How to capture an image using android emulator and store to specified path.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have an SDcard image, start your emulator with sdcard switch, start camera and press the capture button. It pops up a menu (Save img,discard img etc.). When you save your image, it will be stored on SDcard.

Also read: Limitations of Android emulator
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please provide how to provide the switches using eclipse plugin
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Specifying switches for the emulator is not different from what we do for Java Applications.

Right mouse your project -> Run As -> Run configurations -> Tab to Target -> In Additonal Emulator Command Line Options text box specify whatever switches you want.

[You can find a more graphical solution if you know how to google]
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Monu ,

I am able to store the images to sdcard .
I am also able to read and write files to private area of the application , mostly that is not on the sdcard.
When i create new file it gets stored in application area not on sdcard.

But i am facing problem like NullPointerException while saving the image.Please check following code.


Can you provide me some solution also checkout
Help for saving images on applications area

You have to edit the ImageCaptureCallBack.java with above code stated.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be able to write your images on to SD card using standard Java I/O code. To get the location of SD card use Environment.getExternalStorageDirectory().getAbsolutePath()

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

Thanks for your reply for the Sd card usage.

Now i have another query that can we display both camera Preview mode and append text box on the same screen.

For available examples on internet , I have only seen applications that captures images on one screen and then it goes on another screen for saving the image.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic