Hi Guys,
Trying to use the camera on a G1 to get a full resolution image.
Can get an image, but it is only 15KB in size (rather than ~350KB). I
thought this was going to be fixed
in cupcake, but look like it hasn't been.
Using the EXTRA_OUTPUT field....
Any help will be appreciated!
Regards,
Ambarish
Here is my code:
public class Start extends Activity {
/** Called when the activity is first created. */
Uri mUri;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button cameraButton = (Button) findViewById(R.id.Camera);
cameraButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
ContentValues values = new ContentValues();
values.put(Media.TITLE, "Image");
values.put(Images.Media.BUCKET_ID, "test");
values.put(Media.DESCRIPTION, "Image capture by
camera");
mUri = getContentResolver().insert
(Media.EXTERNAL_CONTENT_URI, values);
Intent i = new Intent
("android.media.action.IMAGE_CAPTURE");
i.putExtra(MediaStore.EXTRA_OUTPUT, mUri);
startActivityForResult(i, 1);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent intent) {
byte[] b = new byte[1024];
int rv = 0;
super.onActivityResult(requestCode, resultCode, intent);
try {
InputStream in = getContentResolver().openInputStream(mUri);
int available;
available = in.available();
rv = in.read(b, 0, 1000);
} catch (Exception e) {
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---