SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
preview = new Preview(this, surfaceView);
preview.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
FrameLayout previewFrameLayout = (FrameLayout) findViewById(R.id.preview);
previewFrameLayout.addView(preview);
preview.setKeepScreenOn(true);
on button action
camera.takePicture(shutterCallback, rawCallback, jpegCallback);
This code will let you capture picture from camera
ShutterCallback shutterCallback = new ShutterCallback() {
public void onShutter() {
// Log.d(TAG, "onShutter'd");
}
};
PictureCallback rawCallback = new PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
// Log.d(TAG, "onPictureTaken - raw");
}
};
PictureCallback jpegCallback = new PictureCallback() {
private String fileName;
public void onPictureTaken(byte[] data, Camera camera) {
FileOutputStream outStream = null;
}
};
-
Notifications
You must be signed in to change notification settings - Fork 0
Sudhakar91221/Android-Camera-Gallery
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published