Code example for Camera

Methods: autoFocuscancelAutoFocus

  private void takePicture(final ShutterCallback shutter, final PictureCallback raw,
      final PictureCallback jpeg) {
    mCamera.autoFocus(new Camera.AutoFocusCallback() {
      public void onAutoFocus(boolean success, Camera camera) {
        mCamera.takePicture(shutter, raw, jpeg);
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.camera_fragment_layout, container, false);
    mPreview = (Preview) view.findViewById(;
    mPictureButton = ((Button) view.findViewById(;
    mPostButtons = (ViewGroup) view.findViewById(;
Connect your IDE to all the code out there  Get Codota for Java