1

I came across plenty of code and I am confused.

My goal is when I launch the app, the front camera automatically launches as well. Then by clicking the button I have in the app it would take pictures and save it in the main gallery.

to call the camera:

Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
startActivity(intent);

MainActivity.java

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

This is a school project. My teacher told us to come up with something cool.

  • possible duplicate: http://stackoverflow.com/questions/18291630/how-to-capture-a-photo-from-the-camera-without-intent and see https://developer.android.com/training/camera/cameradirect.html for documentation regarding controlling the camera. – Frederic Klein May 19 '16 at 08:12
  • 1
    http://androideasylessons.blogspot.in/2012/09/capture-image-without-surface-view-as.html – Rajesh May 19 '16 at 09:01

1 Answers1

0

You could find this links useful to start camera intent and get the images on Gallery.

Rolf ツ
  • 8,611
  • 6
  • 47
  • 72
Franklyn
  • 325
  • 2
  • 8
  • Please remove the indentation for code (4 spaces at beginning of line). – Frederic Klein May 19 '16 at 08:51
  • Will it stop the user from accessing the links? – Franklyn May 19 '16 at 09:00
  • Formatted as code the links are not clickable. Besides: giving only links makes your answer invalid if the links die, so it might be better to post the basic information stated in the linked pages, or post the links as a comment. – Frederic Klein May 19 '16 at 09:03