Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This worked with the following code, granted I was being a little dumb with the last one. I still think there's got to be a better way so that the original image is still saved somewhere. It still sends me the smaller 25% size image.</p> <pre><code>public class CameraTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button cameraButton = (Button) findViewById(R.id.cameraButton); cameraButton.setOnClickListener( new OnClickListener(){ public void onClick(View v ){ Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); startActivityForResult(intent,0); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode== 0 &amp;&amp; resultCode == Activity.RESULT_OK) { Bitmap x = (Bitmap) data.getExtras().get("data"); ((ImageView)findViewById(R.id.pictureView)).setImageBitmap(x); ContentValues values = new ContentValues(); values.put(Images.Media.TITLE, "title"); values.put(Images.Media.BUCKET_ID, "test"); values.put(Images.Media.DESCRIPTION, "test Image taken"); values.put(Images.Media.MIME_TYPE, "image/jpeg"); Uri uri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values); OutputStream outstream; try { outstream = getContentResolver().openOutputStream(uri); x.compress(Bitmap.CompressFormat.JPEG, 70, outstream); outstream.close(); } catch (FileNotFoundException e) { // } catch (IOException e) { // } } } </code></pre> <p>Also, I do know that the cupcake release of Android should fix the small image size soon.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload