-3

I'm working on an app which needs to take a picture with the front facing camera of the device without preview and/or asking the user for it. It's a Anti Steal app. I've seen alot of code where they show previews of the camera, where they use the front and/or back camera and so on.

My question now is: How can I take a snapshot of the front camera and save it onto the sd card, without asking the user for permission and without previewing the camera?

Thanks alot for help.

user754730
  • 1,341
  • 5
  • 31
  • 62
  • 1
    How will taking a picture prevent the phone from being stolen? – musefan Jul 29 '13 at 13:31
  • not preventing but showing who the thief is. Like this app right here: http://www.digitaltrends.com/android/lock-cam-snaps-a-picture-of-anyone-trying-to-break-into-your-phone/ – user754730 Jul 29 '13 at 13:32
  • 1
    It will not, but it can upload it later so you can identify the thief. – npace Jul 29 '13 at 13:32
  • Pretty lame "Anti Steal" (theft) app then... perhaps the photos could be uploaded to the thief's facebook account. You know a sort of "latest acquisitions" trophy gallery type of feature – musefan Jul 29 '13 at 13:34
  • What you already have tried?? Give us some code snippet. – IronBlossom Jul 29 '13 at 13:37
  • http://www.vogella.com/articles/AndroidCamera/article.html http://android-er.blogspot.com/2010/12/implement-takepicture-function-of.html http://stackoverflow.com/questions/10283467/android-front-facing-camera-taking-inverted-photos http://stackoverflow.com/questions/2779002/how-to-open-front-camera-on-android-platform http://stackoverflow.com/questions/6913415/how-to-take-picture-from-front-camera-in-android2-2 http://digitaldumptruck.jotabout.com/?p=797 just to name a few... – user754730 Jul 29 '13 at 13:46

1 Answers1

0

This is working for back camera:

private void OpenCamera() {
        buttonCapture.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                Intent intentOpenCamera = new Intent();
                intentOpenCamera.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
                startActivityForResult(intentOpenCamera, REQUEST_CAMERA);
            }
        });
    }
Satheesh
  • 1,722
  • 25
  • 35