I am creating an Android app for class that will take you to the camera app if you click the "capture" button on my user interface. It then returns you to the app and displays the images thumbnail and if you click the "save" button, it will save the button in a SQLite database that I haven't created yet.
My problem is trying to figure out how to access the actual picture and its data, not information about the thumbnail.
The tutorial I was reading has information for storing the image in Android's built in Android's directories, but I can not figure out how to access the actual fullsize image data to store into the database I will be creating myself.
This is the link to the tutorial: https://developer.android.com/training/camera/photobasics#java
This is not the complete code, just a snipet and it was created in Android Studio:
'''
ImageView pic;
public void capture(View view) {
dispatchTakePictureIntent();
}
public void save(View view) {
}
static final int REQUEST_IMAGE_CAPTURE = 1;
private void dispatchTakePictureIntent() {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {
Bundle extras = data.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data");
pic.setImageBitmap(imageBitmap); // sets the imageview on the UI as the thumbnail
}
}
'''